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