|
Open Journal Systems
3.3.0
|
Public Member Functions | |
| __construct ( $fileName, $pathPrefix='', $fileEncoding='UTF-8') | |
| calculateHash ($fileName) | |
| clear () | |
| getData () | |
| getFileEncoding () | |
| getFileName () | |
| getHash ($fileName) | |
| getHashEncoding () | |
| read ($fileName=null) | |
| setFileEncoding ($fileEncoding) | |
| setHashEncoding ($hashEncoding) | |
| update ($fileList) | |
| validate (&$errors) | |
| write ($fileName=null) | |
Data Fields | |
| $data | |
| $fileEncoding | |
| $fileName | |
| $hashEncoding | |
| $pathPrefix | |
Definition at line 45 of file bagit_manifest.php.
| BagItManifest::__construct | ( | $fileName, | |
$pathPrefix = '', |
|||
$fileEncoding = 'UTF-8' |
|||
| ) |
Define a new BagItManifest instance.
| string | $fileName | This is the file name for the manifest file. |
| string | $pathPrefix | This is the prefix to remove from the beginning of file names before they're used as keys in the hash mapping. The default is an empty string (i.e., nothing removed). |
| string | $fileEncoding | This is the encoding to use when reading or writing the manifest file. The default is 'UTF-8'. |
Definition at line 115 of file bagit_manifest.php.
References $fileEncoding, $fileName, $pathPrefix, and read().
| BagItManifest::calculateHash | ( | $fileName | ) |
This calculates the hash for a file.
| string | $fileName | The path of the file to calculate the hash for. |
Definition at line 205 of file bagit_manifest.php.
References $fileName.
Referenced by update(), and validate().
| BagItManifest::clear | ( | ) |
This clears the data in the manifest, both in memory and on disk.
Definition at line 167 of file bagit_manifest.php.
| BagItManifest::getData | ( | ) |
This returns all of the hash data.
Definition at line 261 of file bagit_manifest.php.
References $data.
| BagItManifest::getFileEncoding | ( | ) |
This returns the file encoding.
Definition at line 282 of file bagit_manifest.php.
References $fileEncoding.
| BagItManifest::getFileName | ( | ) |
This returns the manifest file's path.
Definition at line 271 of file bagit_manifest.php.
References $fileName.
| BagItManifest::getHash | ( | $fileName | ) |
This returns the hash for a file.
| string | $fileName | This can be either the absolute file name or the file name without the path prefix. |
Definition at line 245 of file bagit_manifest.php.
References $fileName.
| BagItManifest::getHashEncoding | ( | ) |
This returns the hash encoding.
Definition at line 310 of file bagit_manifest.php.
References $hashEncoding.
| BagItManifest::read | ( | $fileName = null | ) |
This reads the data from the file name.
| 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. |
Definition at line 141 of file bagit_manifest.php.
References $fileName.
Referenced by __construct().
| BagItManifest::setFileEncoding | ( | $fileEncoding | ) |
This sets the file encoding.
The value for this should be either 'sha1' or 'md5', but this doesn't verify that.
This also re-sets the manifest file name based upon this value.
| string | $fileEncoding | The new encoding to use when reading or writing the manifest file. |
Definition at line 300 of file bagit_manifest.php.
References $fileEncoding.
| BagItManifest::setHashEncoding | ( | $hashEncoding | ) |
This sets the hash encoding.
| string | $hashEncoding | This sets the encoding to use when creating the manifest hash data. This must be either 'md5' or 'sha1'; however, it does not test for this. |
Definition at line 324 of file bagit_manifest.php.
References $fileName, and $hashEncoding.
| BagItManifest::update | ( | $fileList | ) |
This updates the data in the manifest from the files passed in.
| array | $fileList | A list of files to include in the manifest. |
Definition at line 180 of file bagit_manifest.php.
References calculateHash(), and write().
| BagItManifest::validate | ( | & | $errors | ) |
This validates the data in the manifest.
This tests three things:
Problems will be added to the errors.
| array | &$errors | A list of error messages. Messages about any errors in validation will be appended to this. |
Definition at line 357 of file bagit_manifest.php.
References $fileName, and calculateHash().
| BagItManifest::write | ( | $fileName = null | ) |
This writes the data to the manifest file.
| string | $fileName | This is the file name to write to. It defaults to the current value of the $fileName property. If given, it will set the value of the property also. |
Definition at line 219 of file bagit_manifest.php.
References $fileName.
Referenced by update().
| array BagItManifest::$data |
A mapping of relative path name ($pathPrefix removed) to hash.
Definition at line 99 of file bagit_manifest.php.
Referenced by getData().
| string BagItManifest::$fileEncoding |
The file encoding to use when reading or writing the manifest file.
Definition at line 89 of file bagit_manifest.php.
Referenced by __construct(), getFileEncoding(), and setFileEncoding().
| string BagItManifest::$fileName |
The absolute file name for the manifest file.
Definition at line 69 of file bagit_manifest.php.
Referenced by __construct(), calculateHash(), getFileName(), getHash(), read(), setHashEncoding(), validate(), and write().
| string BagItManifest::$hashEncoding |
The hash encoding to use. This must be one of 'sha1' or 'md5'.
Definition at line 79 of file bagit_manifest.php.
Referenced by getHashEncoding(), and setHashEncoding().
| string BagItManifest::$pathPrefix |
If given, this is the path prefix to strip off of files before using them as keys in the hash mapping (data property).
Definition at line 59 of file bagit_manifest.php.
Referenced by __construct().