MediaWiki  REL1_19
NullRepo Class Reference

File repository with no files, for performance testing. More...

Inheritance diagram for NullRepo:
Collaboration diagram for NullRepo:

List of all members.

Public Member Functions

 __construct ($info)
 append ($srcPath, $toAppendPath, $flags=0)
 appendFinish ($toAppendPath)
 concatenate ($fileList, $targetPath, $flags=0)
 Concatenate a list of files into a target file location.
 deleteBatch ($sourceDestPairs)
 Move a group of files to the deletion archive.
 fileExistsBatch ($files, $flags=0)
 Checks existence of an array of files.
 findFile ($title, $options=array())
 Find an instance of the named file created at the specified time Returns false if the file does not exist.
 getFileProps ($virtualUrl)
 Get properties of a file with a given virtual URL/storage path.
 newFile ($title, $time=false)
 Create a new File object from the local repository.
 publishBatch ($triplets, $flags=0)
 Publish a batch of files.
 storeBatch ($triplets, $flags=0)
 Store a batch of files.
 storeTemp ($originalName, $srcPath)
 Pick a random name in the temp zone and store a file to it.

Detailed Description

File repository with no files, for performance testing.

Definition at line 13 of file NullRepo.php.


Constructor & Destructor Documentation

NullRepo::__construct ( info)

Definition at line 14 of file NullRepo.php.


Member Function Documentation

NullRepo::append ( srcPath,
toAppendPath,
flags = 0 
)

Definition at line 23 of file NullRepo.php.

NullRepo::appendFinish ( toAppendPath)

Definition at line 26 of file NullRepo.php.

NullRepo::concatenate ( srcPaths,
dstPath,
flags = 0 
)

Concatenate a list of files into a target file location.

Parameters:
$srcPathsArray Ordered list of source virtual URLs/storage paths
$dstPathString Target file system path
$flagsInteger: bitwise combination of the following flags: self::DELETE_SOURCE Delete the source files
Returns:
FileRepoStatus

Reimplemented from FileRepo.

Definition at line 47 of file NullRepo.php.

NullRepo::deleteBatch ( sourceDestPairs)

Move a group of files to the deletion archive.

If no valid deletion archive is configured, this may either delete the file or throw an exception, depending on the preference of the repository.

The overwrite policy is determined by the repository -- currently LocalRepo assumes a naming scheme in the deleted zone based on content hash, as opposed to the public zone which is assumed to be unique.

Parameters:
$sourceDestPairsArray of source/destination pairs. Each element is a two-element array containing the source file path relative to the public root in the first element, and the archive file path relative to the deleted zone root in the second element.
Returns:
FileRepoStatus

Reimplemented from FileRepo.

Definition at line 32 of file NullRepo.php.

NullRepo::fileExistsBatch ( files,
flags = 0 
)

Checks existence of an array of files.

Parameters:
$filesArray: Virtual URLs (or storage paths) of files to check
$flagsInteger: bitwise combination of the following flags: self::FILES_ONLY Mark file as existing only if it is a file (not directory)
Returns:
Either array of files and existence flags, or false

Reimplemented from FileRepo.

Definition at line 35 of file NullRepo.php.

NullRepo::findFile ( title,
options = array() 
)

Find an instance of the named file created at the specified time Returns false if the file does not exist.

Repositories not supporting version control should return false if the time is specified.

Parameters:
$titleMixed: Title object or string
$optionsarray Associative array of options: time: requested time for an archived image, or false for the current version. An image object will be returned which was created at the specified time.

ignoreRedirect: If true, do not follow file redirects

private: If true, return restricted (deleted) files if the current user is allowed to view them. Otherwise, such files will not be found.

Returns:
File|false

Reimplemented from FileRepo.

Definition at line 44 of file NullRepo.php.

NullRepo::getFileProps ( virtualUrl)

Get properties of a file with a given virtual URL/storage path.

Properties should ultimately be obtained via FSFile::getProps().

Parameters:
$virtualUrlstring
Returns:
Array

Reimplemented from FileRepo.

Definition at line 38 of file NullRepo.php.

NullRepo::newFile ( title,
time = false 
)

Create a new File object from the local repository.

Parameters:
$titleMixed: Title object or string
$timeMixed: Time at which the image was uploaded. If this is specified, the returned object will be an instance of the repository's old file class instead of a current file. Repositories not supporting version control should return false if this parameter is set.
Returns:
File|null A File, or null if passed an invalid Title

Reimplemented from FileRepo.

Definition at line 41 of file NullRepo.php.

NullRepo::publishBatch ( triplets,
flags = 0 
)

Publish a batch of files.

Parameters:
$tripletsArray: (source, dest, archive) triplets as per publish()
$flagsInteger: bitfield, may be FileRepo::DELETE_SOURCE to indicate that the source files should be deleted if possible
Returns:
FileRepoStatus

Reimplemented from FileRepo.

Definition at line 29 of file NullRepo.php.

NullRepo::storeBatch ( triplets,
flags = 0 
)

Store a batch of files.

Parameters:
$tripletsArray: (src, dest zone, dest rel) triplets as per store()
$flagsInteger: bitwise combination of the following flags: self::DELETE_SOURCE Delete the source file after upload self::OVERWRITE Overwrite an existing destination file instead of failing self::OVERWRITE_SAME Overwrite the file if the destination exists and has the same contents as the source self::SKIP_LOCKING Skip any file locking when doing the store
Returns:
FileRepoStatus

Reimplemented from FileRepo.

Definition at line 16 of file NullRepo.php.

NullRepo::storeTemp ( originalName,
srcPath 
)

Pick a random name in the temp zone and store a file to it.

Returns a FileRepoStatus object with the file Virtual URL in the value, file can later be disposed using FileRepo::freeTemp().

Parameters:
$originalNameString: the base name of the file as specified by the user. The file extension will be maintained.
$srcPathString: the current location of the file.
Returns:
FileRepoStatus object with the URL in the value.

Reimplemented from FileRepo.

Definition at line 20 of file NullRepo.php.


The documentation for this class was generated from the following file: