3 * A repository that stores files in the local filesystem and registers them
4 * in the wiki's own database. This is the most commonly used repository class.
6 class LocalRepo
extends FSRepo
{
7 var $fileFactory = array( 'LocalFile', 'newFromTitle' );
8 var $oldFileFactory = array( 'OldLocalFile', 'newFromTitle' );
10 function getSlaveDB() {
11 return wfGetDB( DB_SLAVE
);
14 function getMasterDB() {
15 return wfGetDB( DB_MASTER
);
18 function newFileFromRow( $row ) {
19 if ( isset( $row->img_name
) ) {
20 return LocalFile
::newFromRow( $row, $this );
21 } elseif ( isset( $row->oi_name
) ) {
22 return OldLocalFile
::newFromRow( $row, $this );
24 throw new MWException( __METHOD__
.': invalid row' );
28 function newFromArchiveName( $title, $archiveName ) {
29 return OldLocalFile
::newFromArchiveName( $title, $this, $archiveName );