lib/bagit_manifest.php
public function read($fileName=null)
    {
        $this->_resetFileName($fileName);

        $manifest = array();
        $hashLen = ($this->hashEncoding == 'sha1') ? 40 : 32;
        $lines = readLines($this->fileName, $this->fileEncoding);

        foreach ($lines as $line) {
            $hash = trim(substr($line, 0, $hashLen));
            $payload = trim(substr($line, $hashLen));

            if (strlen($payload) > 0) {
                $manifest[$payload] = $hash;
            }
        }

        $this->data = $manifest;
        return $manifest;
    }
public function read($fileName=null)
    {
        $this->_resetFileName($fileName);

        $manifest = array();
        $hashLen = ($this->hashEncoding == 'sha1') ? 40 : 32;
        $lines = readLines($this->fileName, $this->fileEncoding);

        foreach ($lines as $line) {
            $hash = trim(substr($line, 0, $hashLen));
            $payload = trim(substr($line, $hashLen));

            if (strlen($payload) > 0) {
                $manifest[$payload] = $hash;
            }
        }

        $this->data = $manifest;
        return $manifest;
    }
public function read ( $ fileName = null ) { $ this -> _resetFileName ( $ fileName ) ; $ manifest = array ( ) ; $ hashLen = ( $ this -> hashEncoding == 'sha1' ) ? 40 : 32 ; $ lines = readLines ( $ this -> fileName , $ this -> fileEncoding ) ; foreach ( $ lines as $ line ) { $ hash = trim ( substr ( $ line , 0 , $ hashLen ) ) ; $ payload = trim ( substr ( $ line , $ hashLen ) ) ; if ( strlen ( $ payload ) > 0 ) { $ manifest [ $ payload ] = $ hash ; } } $ this -> data = $ manifest ; return $ manifest ; }
This reads the data from the file name.

@param string $fileName This is the file name to read. It defaults to
the current value of the $fileName property. If given, it will set the
value of the property also.

@return array The data read.
This reads the data from the file name .