Squiz Matrix
4.12.2
|
Public Member Functions | |
File_Versioning ($dir) | |
initRepository () | |
_iso8601Ts ($iso8601) | |
_tsIso8601 ($timestamp) | |
_getFileInfoAtVersion ($fileid, $version=null) | |
_getFileInfoFromRealFile ($real_file) | |
_getFileInfoFromPath ($file_path, $version=null) | |
_lockFile ($fileid) | |
_releaseFile ($fileid) | |
add ($rep_path, $real_file, $extra_info='') | |
_updateFile ($fileid, $rep_path, $real_file, $extra_info='') | |
_createFFVFile ($real_file, $fileid, $version) | |
_checkOutCheck ($rep_file, $version=null, $date=null) | |
_validateFileVersion ($rep_file, $info) | |
_updateFileVersion ($real_file, $fileid, $version) | |
checkOut ($rep_file, $dest_dir, $version=null, $date=null) | |
output ($rep_file, $version=null, $date=null) | |
upToDate ($real_file) | |
_fileModified ($ver_info, $real_file) | |
commit ($real_file, $extra_info='') | |
remove ($real_file, $extra_info='') | |
clearOut ($real_file) | |
changeFvTypeCode ($real_file, $new_type_code) | |
Data Fields | |
$_dir | |
$num_lock_attempts = 4 | |
Definition at line 38 of file file_versioning.inc.
_checkOutCheck | ( | $rep_file, | |
$version = null , |
|||
$date = null |
|||
) |
Before a checkout can occur this function is run to return validated information about the file If array is empty something went wrong
string | $rep_file | the path to the file in the repository |
string | $version | Check out this version of the file (null means latest version) |
string | $date | Check out the file as it was at this date (null means latest version) - Doesn't override $version\ Format is unix timestamp |
Definition at line 690 of file file_versioning.inc.
_createFFVFile | ( | $real_file, | |
$fileid, | |||
$version | |||
) |
Actually updates the file in the repository and returns the new version number or zero on error
string | $real_file | the path to the file in the filesystem to add to the repository |
int | $fileid | the fileid of the file we are updating |
int | $version | the version number to write out |
Definition at line 640 of file file_versioning.inc.
_fileModified | ( | $ver_info, | |
$real_file | |||
) |
Checks to see what the status of the passed (checked out) file
string | $ver_info | the version information from _getFileInfoAtVersion() |
string | $real_file | the checked out filename (ie the path to it on the filesystem) |
Definition at line 1086 of file file_versioning.inc.
_getFileInfoAtVersion | ( | $fileid, | |
$version = null |
|||
) |
Returns the main information about the repository from the the passed path and filename Returns either an error code or the info
int | $fileid | the id of the file to retrieve |
int | $version | the version, NULL to get the latest version |
Definition at line 145 of file file_versioning.inc.
_getFileInfoFromPath | ( | $file_path, | |
$version = null |
|||
) |
Returns the main information about the repository from the the passed path and filename
Returns either an error code or the info
string | $file_path | the path to the file in the repository |
int | $version | the version |
Definition at line 247 of file file_versioning.inc.
_getFileInfoFromRealFile | ( | $real_file | ) |
Returns the information from the checked out files .FFV dir entry Returns either an error code or the info
string | $real_file | the checked out filename (ie the path to it on the filesystem) |
Definition at line 194 of file file_versioning.inc.
_iso8601Ts | ( | $iso8601 | ) |
Takes an ISO-8601 compliant date-time string and returns a unix timestamp for it
string | $iso8601 | date time string in 'YYYY-MM-DD HH:MM:SS' format |
Definition at line 112 of file file_versioning.inc.
_lockFile | ( | $fileid | ) |
Attempt to lock a file
int | $fileid | the id of the file to lock |
Definition at line 278 of file file_versioning.inc.
_releaseFile | ( | $fileid | ) |
Release a lock on a file
int | $fileid | the id of the file to unlock |
Definition at line 344 of file file_versioning.inc.
_tsIso8601 | ( | $timestamp | ) |
Takes a unix timestamp for it and returns an ISO-8601 compliant date-time string
int | $timestamp | unix timestamp |
Definition at line 128 of file file_versioning.inc.
_updateFile | ( | $fileid, | |
$rep_path, | |||
$real_file, | |||
$extra_info = '' |
|||
) |
Actually updates the file in the repository and returns the new version number or zero on error
int | $fileid | the fileid of the file we are updating |
string | $rep_path | the path in the repository to store this file |
string | $real_file | the path to the file in the filesystem to add to the repository |
string | $extra_info | any extra info that can be stored with this version of the file (eg who actually added it) |
Definition at line 519 of file file_versioning.inc.
_updateFileVersion | ( | $real_file, | |
$fileid, | |||
$version | |||
) |
Updates the filesize and hash info for a given file/version
String | $real_file | |
int | $fileid | |
int | $version |
Definition at line 919 of file file_versioning.inc.
_validateFileVersion | ( | $rep_file, | |
$info | |||
) |
Asserts file exists and is valid
Validate the integrity of a given file from the file respiratory If the given file does not exist (or fails its integrity checks) we attempt to replace with the private or public file version. otherwise we find the last valid previous version of this file in the respiratory and replace this version with it.
string | $rep_file | the file we are checking |
array | $info | related file information we are working with |
Definition at line 828 of file file_versioning.inc.
add | ( | $rep_path, | |
$real_file, | |||
$extra_info = '' |
|||
) |
Add's a file to the repository
string | $rep_path | the path in the repository to store this file |
string | $real_file | the path to the file in the filesystem to add to the repository |
string | $extra_info | any extra info that can be stored with this version of the file (eg who actually added it) |
Definition at line 378 of file file_versioning.inc.
changeFvTypeCode | ( | $real_file, | |
$new_type_code | |||
) |
When an asset is morphed, the type code which is still residual in the file repository directory structure and database needs to be changed over.
string | $real_file | the checked out filename (ie the path to it on the filesystem) |
string | $new_type_code | the type code the file has changed to (usually after a morph) |
public
Definition at line 1325 of file file_versioning.inc.
checkOut | ( | $rep_file, | |
$dest_dir, | |||
$version = null , |
|||
$date = null |
|||
) |
Checks a file out of the repository
string | $rep_file | the path to the file in the repository |
string | $dest_dir | the directory to send the file to |
string | $version | Check out this version of the file (null means latest version) |
string | $date | Check out the file as it was at this date (null means latest version) - doesn't override $version |
Definition at line 961 of file file_versioning.inc.
clearOut | ( | $real_file | ) |
Essentially the opposite of checkOut(), removes a checked out real file and any FFV info that was in the directory for it
string | $real_file | the checked out filename (ie the path to it on the filesystem) |
Definition at line 1294 of file file_versioning.inc.
commit | ( | $real_file, | |
$extra_info = '' |
|||
) |
Commit's a file to the repository
string | $real_file | the checked out filename (ie the path to it on the filesystem) |
string | $extra_info | any extra info that can be stored with this version of the file (eg who actually added it) |
Definition at line 1106 of file file_versioning.inc.
File_Versioning | ( | $dir | ) |
initRepository | ( | ) |
Creates a repository for the file versioning system
object | &$db | the PEAR::DB object representing the DB to use for storing our information |
Definition at line 79 of file file_versioning.inc.
output | ( | $rep_file, | |
$version = null , |
|||
$date = null |
|||
) |
Like checking out a file but output's it directly to standard output NOTE: does NOT output any HTTP headers (including 'Content-Type')
string | $rep_file | the path to the file in the repository |
string | $version | Check out this version of the file (null means latest version) |
string | $date | Check out the file as it was at this date (null means latest version) - doesn't override $version |
Definition at line 1015 of file file_versioning.inc.
remove | ( | $real_file, | |
$extra_info = '' |
|||
) |
Removes a file from the repository
string | $real_file | the checked out filename (ie the path to it on the filesystem) |
string | $extra_info | any extra info that can be stored with this version of the file (eg who actually added it) |
Definition at line 1199 of file file_versioning.inc.
upToDate | ( | $real_file | ) |
Checks to see if the passed (checked out) file is up to date
string | $real_file | the checked out filename (ie the path to it on the filesystem) |
Definition at line 1040 of file file_versioning.inc.