MediaWiki  REL1_19
ForeignDBRepo Class Reference

A foreign repository with an accessible MediaWiki database. More...

Inheritance diagram for ForeignDBRepo:
Collaboration diagram for ForeignDBRepo:

List of all members.

Public Member Functions

 __construct ($info)
 deleteBatch ($sourceDestPairs)
 Move a group of files to the deletion archive.
 getMasterDB ()
 Get a connection to the master DB.
 getSharedCacheKey ()
 Get a key on the primary cache for this repository.
 getSlaveDB ()
 Get a connection to the slave DB.
 hasSharedCache ()
 publish ($srcPath, $dstRel, $archiveRel, $flags=0)
 Copy or move a file either from a storage path, virtual URL, or FS path, into this repository at the specified destination location.
 store ($srcPath, $dstZone, $dstRel, $flags=0)
 Store a file to a given destination.

Public Attributes

 $dbConn
 $dbFlags
 $dbName
 $dbPassword
 $dbServer
 $dbType
 $dbUser
 $fileFactory = array( 'ForeignDBFile', 'newFromTitle' )
 Factory functions for creating new files Override these in the base class.
 $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' )
 $hasSharedCache
 $tablePrefix

Detailed Description

A foreign repository with an accessible MediaWiki database.

Definition at line 14 of file ForeignDBRepo.php.


Constructor & Destructor Documentation

Definition at line 24 of file ForeignDBRepo.php.

References hasSharedCache().

Here is the call graph for this function:


Member Function Documentation

ForeignDBRepo::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.

The overwrite policy is determined by the repository -- currently LocalRepo assumes a naming scheme in the deleted zone based on content hash, as opposed to the public zone which is assumed to be unique.

Parameters:
$sourceDestPairsArray 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.
Returns:
FileRepoStatus

Reimplemented from FileRepo.

Definition at line 81 of file ForeignDBRepo.php.

Get a connection to the master DB.

Reimplemented from LocalRepo.

Definition at line 36 of file ForeignDBRepo.php.

References DatabaseBase\factory().

Referenced by getSlaveDB().

Here is the call graph for this function:

Here is the caller graph for this function:

Get a key on the primary cache for this repository.

Returns false if the repository's cache is not accessible at this site. The parameters are the parts of the key, as for wfMemcKey().

Reimplemented from LocalRepo.

Definition at line 65 of file ForeignDBRepo.php.

References hasSharedCache().

Here is the call graph for this function:

Get a connection to the slave DB.

Reimplemented from LocalRepo.

Definition at line 52 of file ForeignDBRepo.php.

References getMasterDB().

Here is the call graph for this function:

Definition at line 56 of file ForeignDBRepo.php.

Referenced by __construct(), and getSharedCacheKey().

Here is the caller graph for this function:

ForeignDBRepo::publish ( srcPath,
dstRel,
archiveRel,
flags = 0 
)

Copy or move a file either from a storage path, virtual URL, or FS path, into this repository at the specified destination location.

Returns a FileRepoStatus object. On success, the value contains "new" or "archived", to indicate whether the file was new with that name.

Parameters:
$srcPathString: the source FS path, storage path, or URL
$dstRelString: the destination relative path
$archiveRelString: the relative path where the existing file is to be archived, if there is one. Relative to the public zone root.
$flagsInteger: bitfield, may be FileRepo::DELETE_SOURCE to indicate that the source file should be deleted if possible

Reimplemented from FileRepo.

Definition at line 78 of file ForeignDBRepo.php.

ForeignDBRepo::store ( srcPath,
dstZone,
dstRel,
flags = 0 
)

Store a file to a given destination.

Parameters:
$srcPathString: source FS path, storage path, or virtual URL
$dstZoneString: destination zone
$dstRelString: destination relative path
$flagsInteger: 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 self::SKIP_LOCKING Skip any file locking when doing the store
Returns:
FileRepoStatus

Reimplemented from FileRepo.

Definition at line 75 of file ForeignDBRepo.php.


Member Data Documentation

ForeignDBRepo::$dbConn

Definition at line 20 of file ForeignDBRepo.php.

ForeignDBRepo::$dbFlags

Definition at line 16 of file ForeignDBRepo.php.

ForeignDBRepo::$dbName

Definition at line 16 of file ForeignDBRepo.php.

ForeignDBRepo::$dbPassword

Definition at line 16 of file ForeignDBRepo.php.

ForeignDBRepo::$dbServer

Definition at line 16 of file ForeignDBRepo.php.

ForeignDBRepo::$dbType

Definition at line 16 of file ForeignDBRepo.php.

ForeignDBRepo::$dbUser

Definition at line 16 of file ForeignDBRepo.php.

ForeignDBRepo::$fileFactory = array( 'ForeignDBFile', 'newFromTitle' )

Factory functions for creating new files Override these in the base class.

Reimplemented from LocalRepo.

Definition at line 21 of file ForeignDBRepo.php.

ForeignDBRepo::$fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' )

Reimplemented from LocalRepo.

Definition at line 22 of file ForeignDBRepo.php.

ForeignDBRepo::$hasSharedCache

Definition at line 16 of file ForeignDBRepo.php.

ForeignDBRepo::$tablePrefix

Definition at line 16 of file ForeignDBRepo.php.


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