MediaWiki REL1_28
|
Class representing a non-directory file on the file system. More...
Public Member Functions | |
__construct ( $path) | |
Sets up the file object. | |
exists () | |
Checks if the file exists. | |
getPath () | |
Returns the file system path. | |
getProps ( $ext=true) | |
Get an associative array containing information about a file with the given storage path. | |
getSha1Base36 ( $recache=false) | |
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding, zero padded to 31 digits. | |
getSize () | |
Get the file size in bytes. | |
getTimestamp () | |
Get the file's last-modified timestamp. | |
Static Public Member Functions | |
static | extensionFromPath ( $path) |
Get the final file extension from a file system path. | |
static | getPropsFromPath ( $path, $ext=true) |
Get an associative array containing information about a file in the local filesystem. | |
static | getSha1Base36FromPath ( $path) |
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding, zero padded to 31 digits. | |
static | placeholderProps () |
Placeholder file properties to use for files that don't exist. | |
Protected Attributes | |
string | $path |
Path to file. | |
string | $sha1Base36 |
File SHA-1 in base 36. | |
Class representing a non-directory file on the file system.
Definition at line 29 of file FSFile.php.
FSFile::__construct | ( | $path | ) |
Sets up the file object.
string | $path | Path to temporary file on local disk |
Reimplemented in TempFSFile.
Definition at line 41 of file FSFile.php.
References $path.
FSFile::exists | ( | ) |
Checks if the file exists.
Reimplemented in MockFSFile.
Definition at line 59 of file FSFile.php.
Referenced by getProps().
|
static |
Get the final file extension from a file system path.
string | $path |
Definition at line 188 of file FSFile.php.
References $path.
FSFile::getPath | ( | ) |
Returns the file system path.
Definition at line 50 of file FSFile.php.
References $path.
Referenced by File\getThumbnailSource().
FSFile::getProps | ( | $ext = true | ) |
Get an associative array containing information about a file with the given storage path.
Resulting array fields include:
string | bool | $ext | The file extension, or true to extract it from the filename. Set it to false to ignore the extension. Currently unused. |
Reimplemented in MockFSFile.
Definition at line 105 of file FSFile.php.
References $mime, exists(), false, getSha1Base36(), getSize(), list, and placeholderProps().
|
static |
Get an associative array containing information about a file in the local filesystem.
string | $path | Absolute local filesystem path |
string | bool | $ext | The file extension, or true to extract it from the filename. Set it to false to ignore the extension. |
Definition at line 202 of file FSFile.php.
Referenced by FileBackendTest\doTestStore().
FSFile::getSha1Base36 | ( | $recache = false | ) |
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding, zero padded to 31 digits.
160 log 2 / log 36 = 30.95, so the 160-bit hash fills 31 digits in base 36 fairly neatly.
bool | $recache |
Reimplemented in MockFSFile.
Definition at line 166 of file FSFile.php.
References $sha1Base36.
Referenced by getProps().
|
static |
Get a SHA-1 hash of a file in the local filesystem, in base-36 lower case encoding, zero padded to 31 digits.
160 log 2 / log 36 = 30.95, so the 160-bit hash fills 31 digits in base 36 fairly neatly.
string | $path |
Definition at line 218 of file FSFile.php.
References $path.
Referenced by ApiTestCaseUpload\deleteFileByContent(), UploadBase\getTempFileSha1Base36(), and LocalFile\publishTo().
FSFile::getSize | ( | ) |
Get the file size in bytes.
Reimplemented in MockFSFile.
Definition at line 68 of file FSFile.php.
Referenced by getProps().
FSFile::getTimestamp | ( | ) |
Get the file's last-modified timestamp.
Reimplemented in MockFSFile.
Definition at line 77 of file FSFile.php.
References $timestamp, TS_MW, and wfTimestamp().
|
static |
Placeholder file properties to use for files that don't exist.
Resulting array fields include:
Definition at line 143 of file FSFile.php.
Referenced by FileBackendStore\getFileProps(), getProps(), and MWFileProps\newPlaceholderProps().
|
protected |
Path to file.
Definition at line 31 of file FSFile.php.
Referenced by __construct(), TempFSFile\__construct(), TempFSFile\autocollect(), extensionFromPath(), TempFSFile\factory(), getPath(), getPropsFromPath(), getSha1Base36FromPath(), and TempFSFile\purgeAllOnShutdown().
|
protected |