Inherits FileRepo.
Inherited by LocalRepo.
Public Member Functions | |
__construct ($info) | |
getRootDirectory () | |
Get the public root directory of the repository. | |
getRootUrl () | |
Get the public root URL of the repository. | |
isHashed () | |
Returns true if the repository uses a multi-level directory structure. | |
getZonePath ($zone) | |
Get the local directory corresponding to one of the three basic zones. | |
getZoneUrl ($zone) | |
Get the URL corresponding to one of the three basic zones. | |
getVirtualUrl ($suffix=false) | |
Get a URL referring to this repository, with the private mwrepo protocol. | |
resolveVirtualUrl ($url) | |
Get the local path corresponding to a virtual URL. | |
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. | |
freeTemp ($virtualUrl) | |
Remove a temporary file or mark it for garbage collection. | |
publishBatch ($triplets, $flags=0) | |
Publish a batch of files. | |
deleteBatch ($sourceDestPairs) | |
Move a group of files to the deletion archive. | |
getDeletedHashPath ($key) | |
Get a relative path for a deletion archive key, e.g. | |
enumFilesInFS ($callback) | |
Call a callback function for every file in the repository. | |
enumFiles ($callback) | |
Call a callback function for every file in the repository May use either the database or the filesystem. | |
getFileProps ($virtualUrl) | |
Get properties of a file with a given virtual URL The virtual URL must refer to this repo. | |
getErrorCleanupFunction () | |
Path disclosure protection functions. | |
simpleClean ($param) | |
Public Attributes | |
$directory | |
$deletedDir | |
$url | |
$deletedHashLevels | |
$fileFactory = array( 'UnregisteredLocalFile', 'newFromTitle' ) | |
Factory functions for creating new files Override these in the base class. | |
$oldFileFactory = false | |
$pathDisclosureProtection = 'simple' | |
Protected Member Functions | |
initDeletedDir ($dir) | |
Take all available measures to prevent web accessibility of new deleted directories, in case the user has not configured offline storage. |
Does not support database access or registration.
Definition at line 8 of file FSRepo.php.
FSRepo::__construct | ( | $ | info | ) |
Reimplemented from FileRepo.
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 14 of file FSRepo.php.
FSRepo::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.
array | $sourceDestPairs Array 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. |
Reimplemented from FileRepo.
Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.
Definition at line 384 of file FSRepo.php.
References $status, initDeletedDir(), FileRepo::newGood(), FileRepo::validateFilename(), and wfMkdirParents().
FSRepo::enumFiles | ( | $ | callback | ) |
Call a callback function for every file in the repository May use either the database or the filesystem.
Reimplemented from FileRepo.
Definition at line 492 of file FSRepo.php.
References enumFilesInFS().
FSRepo::enumFilesInFS | ( | $ | callback | ) |
Call a callback function for every file in the repository.
Uses the filesystem even in child classes.
Definition at line 470 of file FSRepo.php.
Referenced by enumFiles().
FSRepo::freeTemp | ( | $ | virtualUrl | ) |
Remove a temporary file or mark it for garbage collection.
string | $virtualUrl The virtual URL returned by storeTemp |
Reimplemented from FileRepo.
Definition at line 252 of file FSRepo.php.
References $path, $success, resolveVirtualUrl(), wfDebug(), wfRestoreWarnings(), and wfSuppressWarnings().
FSRepo::getDeletedHashPath | ( | $ | key | ) |
Get a relative path for a deletion archive key, e.g.
s/z/a/ for sza251lrxrc1jad41h5mgilp8nysje52.jpg
Definition at line 458 of file FSRepo.php.
References $i, $key, and $path.
Referenced by LocalRepo::cleanupDeletedBatch().
FSRepo::getErrorCleanupFunction | ( | ) |
Path disclosure protection functions.
Get a callback function to use for cleaning error message parameters
Reimplemented from FileRepo.
Definition at line 510 of file FSRepo.php.
FSRepo::getFileProps | ( | $ | virtualUrl | ) |
Get properties of a file with a given virtual URL The virtual URL must refer to this repo.
Reimplemented from FileRepo.
Definition at line 500 of file FSRepo.php.
References $path, File::getPropsFromPath(), and resolveVirtualUrl().
FSRepo::getRootDirectory | ( | ) |
FSRepo::getRootUrl | ( | ) |
FSRepo::getVirtualUrl | ( | $ | suffix = false |
) |
Get a URL referring to this repository, with the private mwrepo protocol.
The suffix, if supplied, is considered to be unencoded, and will be URL-encoded before being returned.
Definition at line 86 of file FSRepo.php.
References $path, and $suffix.
Referenced by storeTemp().
FSRepo::getZonePath | ( | $ | zone | ) |
Get the local directory corresponding to one of the three basic zones.
Definition at line 52 of file FSRepo.php.
Referenced by LocalRepo::cleanupDeletedBatch(), initDeletedDir(), resolveVirtualUrl(), and storeBatch().
FSRepo::getZoneUrl | ( | $ | zone | ) |
Get the URL corresponding to one of the three basic zones.
Definition at line 68 of file FSRepo.php.
FSRepo::initDeletedDir | ( | $ | dir | ) | [protected] |
Take all available measures to prevent web accessibility of new deleted directories, in case the user has not configured offline storage.
Definition at line 219 of file FSRepo.php.
References getZonePath().
Referenced by deleteBatch(), and storeBatch().
FSRepo::isHashed | ( | ) |
Returns true if the repository uses a multi-level directory structure.
Definition at line 45 of file FSRepo.php.
FSRepo::publishBatch | ( | $ | triplets, | |
$ | flags = 0 | |||
) |
Publish a batch of files.
array | $triplets (source,dest,archive) triplets as per publish() | |
integer | $flags Bitfield, may be FileRepo::DELETE_SOURCE to indicate that the source files should be deleted if possible |
Reimplemented from FileRepo.
Definition at line 271 of file FSRepo.php.
References $flags, $i, $status, $success, FileRepo::newFatal(), FileRepo::newGood(), resolveVirtualUrl(), FileRepo::validateFilename(), wfDebug(), wfMkdirParents(), wfRestoreWarnings(), and wfSuppressWarnings().
FSRepo::resolveVirtualUrl | ( | $ | url | ) |
Get the local path corresponding to a virtual URL.
Definition at line 97 of file FSRepo.php.
References $url, and getZonePath().
Referenced by freeTemp(), getFileProps(), publishBatch(), and storeBatch().
FSRepo::simpleClean | ( | $ | param | ) |
FSRepo::storeBatch | ( | $ | triplets, | |
$ | flags = 0 | |||
) |
Store a batch of files.
array | $triplets (src,zone,dest) triplets as per store() | |
integer | $flags 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 |
Reimplemented from FileRepo.
Definition at line 127 of file FSRepo.php.
References $flags, $i, $status, getZonePath(), initDeletedDir(), FileRepo::newFatal(), FileRepo::newGood(), resolveVirtualUrl(), FileRepo::validateFilename(), wfIsWindows(), and wfMkdirParents().
FSRepo::storeTemp | ( | $ | originalName, | |
$ | srcPath | |||
) |
Pick a random name in the temp zone and store a file to it.
string | $originalName The base name of the file as specified by the user. The file extension will be maintained. | |
string | $srcPath The current location of the file. |
Reimplemented from FileRepo.
Definition at line 236 of file FSRepo.php.
References $result, FileRepo::getHashPath(), getVirtualUrl(), and FileRepo::store().
FSRepo::$deletedDir |
Definition at line 9 of file FSRepo.php.
FSRepo::$deletedHashLevels |
Definition at line 9 of file FSRepo.php.
FSRepo::$directory |
Definition at line 9 of file FSRepo.php.
FSRepo::$fileFactory = array( 'UnregisteredLocalFile', 'newFromTitle' ) |
Factory functions for creating new files Override these in the base class.
Reimplemented from FileRepo.
Reimplemented in ForeignDBRepo, ForeignDBViaLBRepo, and LocalRepo.
Definition at line 10 of file FSRepo.php.
FSRepo::$oldFileFactory = false |
FSRepo::$pathDisclosureProtection = 'simple' |
FSRepo::$url |