MediaWiki  REL1_24
MemoryFileBackend Class Reference

Simulation of a backend storage in memory. More...

Inheritance diagram for MemoryFileBackend:
Collaboration diagram for MemoryFileBackend:

List of all members.

Public Member Functions

 getDirectoryListInternal ($container, $dir, array $params)
 Do not call this function from places outside FileBackend.
 getFileListInternal ($container, $dir, array $params)
 Do not call this function from places outside FileBackend.
 isPathUsableInternal ($storagePath)
 Check if a file can be created or changed at a given storage path.

Protected Member Functions

 directoriesAreVirtual ()
 Is this a key/value store where directories are just virtual? Virtual directories exists in so much as files exists that are prefixed with the directory path followed by a forward slash.
 doCopyInternal (array $params)
 doCreateInternal (array $params)
 doDeleteInternal (array $params)
 doDirectoryExists ($container, $dir, array $params)
 doGetFileStat (array $params)
 doGetLocalCopyMulti (array $params)
 doStoreInternal (array $params)
 doStreamFile (array $params)
 resolveHashKey ($storagePath)
 Get the absolute file system path for a storage path.

Protected Attributes

array $files = array()
 Map of (file path => (data,mtime) *.

Detailed Description

Simulation of a backend storage in memory.

All data in the backend is automatically deleted at the end of PHP execution. Since the data stored here is volatile, this is only useful for staging or testing.

Since:
1.23

Definition at line 34 of file MemoryFileBackend.php.


Member Function Documentation

Is this a key/value store where directories are just virtual? Virtual directories exists in so much as files exists that are prefixed with the directory path followed by a forward slash.

Returns:
bool

Reimplemented from FileBackendStore.

Definition at line 255 of file MemoryFileBackend.php.

MemoryFileBackend::doCopyInternal ( array params) [protected]
See also:
FileBackendStore::copyInternal()
Parameters:
array$params
Returns:
Status

Reimplemented from FileBackendStore.

Definition at line 86 of file MemoryFileBackend.php.

References array(), empty, files, Status\newGood(), resolveHashKey(), and wfTimestamp().

MemoryFileBackend::doCreateInternal ( array params) [protected]
See also:
FileBackendStore::createInternal()
Parameters:
array$params
Returns:
Status

Reimplemented from FileBackendStore.

Definition at line 41 of file MemoryFileBackend.php.

References array(), files, Status\newGood(), resolveHashKey(), and wfTimestamp().

MemoryFileBackend::doDeleteInternal ( array params) [protected]
See also:
FileBackendStore::deleteInternal()
Parameters:
array$params
Returns:
Status

Reimplemented from FileBackendStore.

Definition at line 119 of file MemoryFileBackend.php.

References empty, files, Status\newGood(), and resolveHashKey().

MemoryFileBackend::doDirectoryExists ( container,
dir,
array params 
) [protected]
See also:
FileBackendStore::directoryExists()
Parameters:
string$containerResolved container name
string$dirResolved path relative to container
array$params
Returns:
bool|null

Reimplemented from FileBackendStore.

Definition at line 196 of file MemoryFileBackend.php.

References $path, as, and files.

MemoryFileBackend::doGetFileStat ( array params) [protected]
See also:
FileBackendStore::getFileStat()

Reimplemented from FileBackendStore.

Definition at line 142 of file MemoryFileBackend.php.

References array(), files, and resolveHashKey().

MemoryFileBackend::doGetLocalCopyMulti ( array params) [protected]
See also:
FileBackendStore::getLocalCopyMulti()
Parameters:
array$params
Returns:
array

Reimplemented from FileBackendStore.

Reimplemented in MockFileBackend.

Definition at line 158 of file MemoryFileBackend.php.

References $ext, array(), as, FileBackend\extensionFromPath(), TempFSFile\factory(), files, and resolveHashKey().

MemoryFileBackend::doStoreInternal ( array params) [protected]
See also:
FileBackendStore::storeInternal()
Parameters:
array$params
Returns:
Status

Reimplemented from FileBackendStore.

Definition at line 59 of file MemoryFileBackend.php.

References array(), files, Status\newGood(), resolveHashKey(), wfRestoreWarnings(), wfSuppressWarnings(), and wfTimestamp().

MemoryFileBackend::doStreamFile ( array params) [protected]
See also:
FileBackendStore::streamFile()
Parameters:
array$params
Returns:
Status

Reimplemented from FileBackendStore.

Definition at line 181 of file MemoryFileBackend.php.

References files, Status\newGood(), print, and resolveHashKey().

MemoryFileBackend::getDirectoryListInternal ( container,
dir,
array params 
)

Do not call this function from places outside FileBackend.

See also:
FileBackendStore::getDirectoryList()
Parameters:
string$containerResolved container name
string$dirResolved path relative to container
array$params
Returns:
Traversable|array|null Returns null on failure

Reimplemented from FileBackendStore.

Definition at line 207 of file MemoryFileBackend.php.

References $dir, $dirs, $path, array(), as, empty, and files.

MemoryFileBackend::getFileListInternal ( container,
dir,
array params 
)

Do not call this function from places outside FileBackend.

See also:
FileBackendStore::getFileList()
Parameters:
string$containerResolved container name
string$dirResolved path relative to container
array$params
Returns:
Traversable|array|null Returns null on failure

Reimplemented from FileBackendStore.

Definition at line 236 of file MemoryFileBackend.php.

References $files, $path, array(), as, empty, and files.

Check if a file can be created or changed at a given storage path.

FS backends should check if the parent directory exists, files can be written under it, and that any file already there is writable. Backends using key/value stores should check if the container exists.

Parameters:
string$storagePath
Returns:
bool

Reimplemented from FileBackendStore.

Definition at line 37 of file MemoryFileBackend.php.

MemoryFileBackend::resolveHashKey ( storagePath) [protected]

Get the absolute file system path for a storage path.

Parameters:
string$storagePathStorage path
Returns:
string|null

Definition at line 265 of file MemoryFileBackend.php.

Referenced by doCopyInternal(), doCreateInternal(), doDeleteInternal(), doGetFileStat(), doGetLocalCopyMulti(), doStoreInternal(), and doStreamFile().


Member Data Documentation

array MemoryFileBackend::$files = array() [protected]

Map of (file path => (data,mtime) *.

Definition at line 35 of file MemoryFileBackend.php.

Referenced by getFileListInternal().


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