MediaWiki  REL1_24
CopyFileBackend Class Reference

Copy all files in one container of one backend to another. More...

Inheritance diagram for CopyFileBackend:
Collaboration diagram for CopyFileBackend:

List of all members.

Public Member Functions

 __construct ()
 execute ()

Protected Member Functions

 copyFileBatch (array $srcPathsRel, $backendRel, FileBackend $src, FileBackend $dst)
 delFileBatch (array $dstPathsRel, $backendRel, FileBackend $dst)
 filesAreSame (FileBackend $src, FileBackend $dst, $sPath, $dPath)
 getListingDiffRel (FileBackend $src, FileBackend $dst, $backendRel)

Protected Attributes

array null $statCache = null
 (path sha1 => stat) Pre-computed dst stat entries from listings *

Detailed Description

Copy all files in one container of one backend to another.

This can also be used to re-shard the files for one backend using the config of second backend. The second backend should have the same config as the first, except for it having a different name and different sharding configuration. The backend should be made read-only while this runs. After this script finishes, the old files in the containers can be deleted.

Definition at line 37 of file copyFileBackend.php.


Constructor & Destructor Documentation

Reimplemented from Maintenance.

Definition at line 40 of file copyFileBackend.php.

References Maintenance\addOption(), and Maintenance\setBatchSize().


Member Function Documentation

CopyFileBackend::copyFileBatch ( array srcPathsRel,
backendRel,
FileBackend src,
FileBackend dst 
) [protected]
Parameters:
array$srcPathsRel
string$backendRel
FileBackend$src
FileBackend$dst
Returns:
void

Definition at line 212 of file copyFileBackend.php.

Referenced by execute().

CopyFileBackend::delFileBatch ( array dstPathsRel,
backendRel,
FileBackend dst 
) [protected]
Parameters:
array$dstPathsRel
string$backendRel
FileBackend$dst
Returns:
void

Definition at line 299 of file copyFileBackend.php.

Referenced by execute().

CopyFileBackend::filesAreSame ( FileBackend src,
FileBackend dst,
sPath,
dPath 
) [protected]
Parameters:
FileBackend$src
FileBackend$dst
string$sPath
string$dPath
Returns:
bool

Definition at line 337 of file copyFileBackend.php.

CopyFileBackend::getListingDiffRel ( FileBackend src,
FileBackend dst,
backendRel 
) [protected]
Parameters:
FileBackend$src
FileBackend$dst
string$backendRel
Returns:
array (rel paths in $src minus those in $dst)

Definition at line 176 of file copyFileBackend.php.

Referenced by execute().


Member Data Documentation

array null CopyFileBackend::$statCache = null [protected]

(path sha1 => stat) Pre-computed dst stat entries from listings *

Definition at line 38 of file copyFileBackend.php.


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