]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - includes/filerepo/ForeignDBFile.php
MediaWiki 1.14.0
[autoinstallsdev/mediawiki.git] / includes / filerepo / ForeignDBFile.php
1 <?php
2
3 /**
4  * @ingroup FileRepo
5  */
6 class ForeignDBFile extends LocalFile {
7         static function newFromTitle( $title, $repo, $unused = null ) {
8                 return new self( $title, $repo );
9         }
10
11         /**
12          * Create a ForeignDBFile from a title
13          * Do not call this except from inside a repo class.
14          */
15         static function newFromRow( $row, $repo ) {
16                 $title = Title::makeTitle( NS_FILE, $row->img_name );
17                 $file = new self( $title, $repo );
18                 $file->loadFromRow( $row );
19                 return $file;
20         }
21
22         function getCacheKey() {
23                 if ( $this->repo->hasSharedCache ) {
24                         $hashedName = md5($this->name);
25                         return wfForeignMemcKey( $this->repo->dbName, $this->repo->tablePrefix,
26                                 'file', $hashedName );
27                 } else {
28                         return false;
29                 }
30         }
31
32         function publish( $srcPath, $flags = 0 ) {
33                 $this->readOnlyError();
34         }
35
36         function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '',
37                 $watch = false, $timestamp = false ) {
38                 $this->readOnlyError();
39         }
40         function restore( $versions = array(), $unsuppress = false ) {
41                 $this->readOnlyError();
42         }
43         function delete( $reason, $suppress = false ) {
44                 $this->readOnlyError();
45         }
46         function move( $target ) {
47                 $this->readOnlyError();
48         }
49         
50         function getDescriptionUrl() {
51                 // Restore remote behaviour
52                 return File::getDescriptionUrl();
53         }
54
55         function getDescriptionText() {
56                 // Restore remote behaviour
57                 return File::getDescriptionText();
58         }
59 }