LocalRepo Class Reference
[FileRepo]

A repository that stores files in the local filesystem and registers them in the wiki's own database. More...

Inherits FSRepo.

Inherited by ForeignDBRepo, and ForeignDBViaLBRepo.

List of all members.

Public Member Functions

 newFileFromRow ($row)
 newFromArchiveName ($title, $archiveName)
 cleanupDeletedBatch ($storageKeys)
 Delete files in the deleted directory if they are not referenced in the filearchive table.
 checkRedirect ($title)
 Checks if there is a redirect named as $title.
 findBySha1 ($hash)
 Get an array or iterator of file objects for files that have a given SHA-1 content hash.
 getSlaveDB ()
 Get a connection to the slave DB.
 getMasterDB ()
 Get a connection to the master DB.
 getSharedCacheKey ()
 Get a key on the primary cache for this repository.
 invalidateImageRedirect ($title)
 Invalidates image redirect cache related to that image.

Public Attributes

 $fileFactory = array( 'LocalFile', 'newFromTitle' )
 Factory functions for creating new files Override these in the base class.
 $oldFileFactory = array( 'OldLocalFile', 'newFromTitle' )
 $fileFromRowFactory = array( 'LocalFile', 'newFromRow' )
 $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' )

Protected Member Functions

 getArticleID ($title)
 Function link Title::getArticleID().


Detailed Description

A repository that stores files in the local filesystem and registers them in the wiki's own database.

This is the most commonly used repository class.

Definition at line 7 of file LocalRepo.php.


Member Function Documentation

LocalRepo::checkRedirect ( title  ) 

Checks if there is a redirect named as $title.

Parameters:
Title $title Title of image

Reimplemented from FileRepo.

Definition at line 76 of file LocalRepo.php.

References $dbr, $title, $wgMemc, getArticleID(), FileRepo::getLocalCacheKey(), getSharedCacheKey(), getSlaveDB(), Title::makeTitle(), and Title::newFromText().

LocalRepo::cleanupDeletedBatch ( storageKeys  ) 

Delete files in the deleted directory if they are not referenced in the filearchive table.

This needs to be done in the repo because it needs to interleave database locks with file operations, which is potentially a remote operation.

Returns:
FileRepoStatus

Reimplemented from FileRepo.

Definition at line 34 of file LocalRepo.php.

References $dbw, $ext, $path, File::DELETED_FILE, FSRepo::getDeletedHashPath(), getMasterDB(), FSRepo::getZonePath(), FileRepo::newGood(), File::normalizeExtension(), and wfDebug().

LocalRepo::findBySha1 ( hash  ) 

Get an array or iterator of file objects for files that have a given SHA-1 content hash.

Reimplemented from FileRepo.

Definition at line 150 of file LocalRepo.php.

References $dbr, $res, $result, getSlaveDB(), newFileFromRow(), and LocalFile::selectFields().

LocalRepo::getArticleID ( title  )  [protected]

Function link Title::getArticleID().

We can't say Title object, what database it should use, so we duplicate that function here.

Definition at line 129 of file LocalRepo.php.

References $dbr, $title, and getSlaveDB().

Referenced by checkRedirect().

LocalRepo::getMasterDB (  ) 

Get a connection to the master DB.

Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.

Definition at line 175 of file LocalRepo.php.

References wfGetDB().

Referenced by cleanupDeletedBatch().

LocalRepo::getSharedCacheKey (  ) 

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 FileRepo.

Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.

Definition at line 184 of file LocalRepo.php.

Referenced by checkRedirect(), and invalidateImageRedirect().

LocalRepo::getSlaveDB (  ) 

Get a connection to the slave DB.

Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.

Definition at line 168 of file LocalRepo.php.

References wfGetDB().

Referenced by checkRedirect(), findBySha1(), and getArticleID().

LocalRepo::invalidateImageRedirect ( title  ) 

Invalidates image redirect cache related to that image.

Parameters:
Title $title Title of image

Reimplemented from FileRepo.

Definition at line 194 of file LocalRepo.php.

References $title, $wgMemc, and getSharedCacheKey().

LocalRepo::newFileFromRow ( row  ) 

Definition at line 13 of file LocalRepo.php.

Referenced by findBySha1().

LocalRepo::newFromArchiveName ( title,
archiveName 
)

Definition at line 23 of file LocalRepo.php.

References $title.


Member Data Documentation

LocalRepo::$fileFactory = array( 'LocalFile', 'newFromTitle' )

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

Reimplemented from FSRepo.

Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.

Definition at line 8 of file LocalRepo.php.

LocalRepo::$fileFromRowFactory = array( 'LocalFile', 'newFromRow' )

Reimplemented in ForeignDBRepo, and ForeignDBViaLBRepo.

Definition at line 10 of file LocalRepo.php.

LocalRepo::$oldFileFactory = array( 'OldLocalFile', 'newFromTitle' )

Reimplemented from FSRepo.

Definition at line 9 of file LocalRepo.php.

LocalRepo::$oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' )

Definition at line 11 of file LocalRepo.php.


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

Generated on Sat Apr 30 22:57:42 2011 for MediaWiki by  doxygen 1.5.9