Merge branch 'master' into Wikidata
[lhc/web/wiklou.git] / includes / filerepo / file / ForeignDBFile.php
1 <?php
2 /**
3 * Foreign file with an accessible MediaWiki database
4 *
5 * @file
6 * @ingroup FileAbstraction
7 */
8
9 /**
10 * Foreign file with an accessible MediaWiki database
11 *
12 * @ingroup FileAbstraction
13 */
14 class ForeignDBFile extends LocalFile {
15
16 /**
17 * @param $title
18 * @param $repo
19 * @param $unused
20 * @return ForeignDBFile
21 */
22 static function newFromTitle( $title, $repo, $unused = null ) {
23 return new self( $title, $repo );
24 }
25
26 /**
27 * Create a ForeignDBFile from a title
28 * Do not call this except from inside a repo class.
29 *
30 * @param $row
31 * @param $repo
32 *
33 * @return ForeignDBFile
34 */
35 static function newFromRow( $row, $repo ) {
36 $title = Title::makeTitle( NS_FILE, $row->img_name );
37 $file = new self( $title, $repo );
38 $file->loadFromRow( $row );
39 return $file;
40 }
41
42 function publish( $srcPath, $flags = 0 ) {
43 $this->readOnlyError();
44 }
45
46 function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '',
47 $watch = false, $timestamp = false ) {
48 $this->readOnlyError();
49 }
50
51 function restore( $versions = array(), $unsuppress = false ) {
52 $this->readOnlyError();
53 }
54
55 function delete( $reason, $suppress = false ) {
56 $this->readOnlyError();
57 }
58
59 function move( $target ) {
60 $this->readOnlyError();
61 }
62
63 /**
64 * @return string
65 */
66 function getDescriptionUrl() {
67 // Restore remote behaviour
68 return File::getDescriptionUrl();
69 }
70
71 /**
72 * @return string
73 */
74 function getDescriptionText() {
75 // Restore remote behaviour
76 return File::getDescriptionText();
77 }
78 }