Go to the documentation of this file.
46 if ( $dst ===
null ) {
47 $status->fatal(
'backend-fail-invalidpath',
$params[
'dst'] );
52 $this->files[$dst] =
array(
64 if ( $dst ===
null ) {
65 $status->fatal(
'backend-fail-invalidpath',
$params[
'dst'] );
71 $data = file_get_contents(
$params[
'src'] );
73 if ( $data ===
false ) {
74 $status->fatal(
'backend-fail-store',
$params[
'src'],
$params[
'dst'] );
79 $this->files[$dst] =
array(
91 if ( $src ===
null ) {
92 $status->fatal(
'backend-fail-invalidpath',
$params[
'src'] );
98 if ( $dst ===
null ) {
99 $status->fatal(
'backend-fail-invalidpath',
$params[
'dst'] );
104 if ( !isset( $this->files[$src] ) ) {
105 if ( empty(
$params[
'ignoreMissingSource'] ) ) {
106 $status->fatal(
'backend-fail-copy',
$params[
'src'],
$params[
'dst'] );
112 $this->files[$dst] =
array(
113 'data' => $this->files[$src][
'data'],
124 if ( $src ===
null ) {
125 $status->fatal(
'backend-fail-invalidpath',
$params[
'src'] );
130 if ( !isset( $this->files[$src] ) ) {
131 if ( empty(
$params[
'ignoreMissingSource'] ) ) {
132 $status->fatal(
'backend-fail-delete',
$params[
'src'] );
138 unset( $this->files[$src] );
145 if ( $src ===
null ) {
149 if ( isset( $this->files[$src] ) ) {
151 'mtime' => $this->files[$src][
'mtime'],
152 'size' => strlen( $this->files[$src][
'data'] ),
161 foreach (
$params[
'srcs']
as $srcPath ) {
163 if ( $src ===
null || !isset( $this->files[$src] ) ) {
170 $bytes = file_put_contents( $fsFile->getPath(), $this->files[$src][
'data'] );
171 if ( $bytes !== strlen( $this->files[$src][
'data'] ) ) {
176 $tmpFiles[$srcPath] = $fsFile;
186 if ( $src ===
null || !isset( $this->files[$src] ) ) {
187 $status->fatal(
'backend-fail-stream',
$params[
'src'] );
192 print $this->files[$src][
'data'];
198 $prefix = rtrim(
"$container/$dir",
'/' ) .
'/';
199 foreach ( $this->files
as $path => $data ) {
200 if ( strpos(
$path, $prefix ) === 0 ) {
210 $prefix = rtrim(
"$container/$dir",
'/' ) .
'/';
211 $prefixLen = strlen( $prefix );
212 foreach ( $this->files
as $path => $data ) {
213 if ( strpos(
$path, $prefix ) === 0 ) {
214 $relPath = substr(
$path, $prefixLen );
215 if ( $relPath ===
false ) {
217 } elseif ( strpos( $relPath,
'/' ) ===
false ) {
220 $parts = array_slice( explode(
'/', $relPath ), 0, -1 );
221 if ( !empty(
$params[
'topOnly'] ) ) {
222 $dirs[$parts[0]] = 1;
225 foreach ( $parts
as $part ) {
226 $dir = ( $current ===
'' ) ? $part :
"$current/$part";
234 return array_keys(
$dirs );
239 $prefix = rtrim(
"$container/$dir",
'/' ) .
'/';
240 $prefixLen = strlen( $prefix );
241 foreach ( $this->files
as $path => $data ) {
242 if ( strpos(
$path, $prefix ) === 0 ) {
243 $relPath = substr(
$path, $prefixLen );
244 if ( $relPath ===
false ) {
246 } elseif ( !empty(
$params[
'topOnly'] ) && strpos( $relPath,
'/' ) !==
false ) {
268 if ( $relPath ===
null ) {
272 return ( $relPath !==
'' ) ?
"$fullCont/$relPath" : $fullCont;
doCopyInternal(array $params)
doDirectoryExists( $container, $dir, array $params)
doStreamFile(array $params)
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
doDeleteInternal(array $params)
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
getDirectoryListInternal( $container, $dir, array $params)
Do not call this function from places outside FileBackend.
doGetFileStat(array $params)
wfSuppressWarnings( $end=false)
Reference-counted warning suppression.
static newGood( $value=null)
Factory function for good results.
doStoreInternal(array $params)
wfRestoreWarnings()
Restore error level to previous value.
array $files
Map of (file path => (data,mtime) *.
doGetLocalCopyMulti(array $params)
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
isPathUsableInternal( $storagePath)
Check if a file can be created or changed at a given storage path.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
static factory( $prefix, $extension='')
Make a new temporary file on the file system.
Simulation of a backend storage in memory.
resolveStoragePathReal( $storagePath)
Like resolveStoragePath() except null values are returned if the container is sharded and the shard c...
getFileListInternal( $container, $dir, array $params)
Do not call this function from places outside FileBackend.
doCreateInternal(array $params)
Base class for all backends using particular storage medium.
resolveHashKey( $storagePath)
Get the absolute file system path for a storage path.
if(count( $args)==0) $dir
static extensionFromPath( $path)
Get the final extension from a storage or FS path.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
directoriesAreVirtual()
Is this a key/value store where directories are just virtual? Virtual directories exists in so much a...