Merge "phpcs: Normalize methods declarations to "[final abstract] [visibility]"."
[lhc/web/wiklou.git] / includes / filerepo / file / ForeignDBFile.php
1 <?php
2 /**
3 * Foreign file with an accessible MediaWiki database.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 * @file
21 * @ingroup FileAbstraction
22 */
23
24 /**
25 * Foreign file with an accessible MediaWiki database
26 *
27 * @ingroup FileAbstraction
28 */
29 class ForeignDBFile extends LocalFile {
30
31 /**
32 * @param $title
33 * @param $repo
34 * @param $unused
35 * @return ForeignDBFile
36 */
37 static function newFromTitle( $title, $repo, $unused = null ) {
38 return new self( $title, $repo );
39 }
40
41 /**
42 * Create a ForeignDBFile from a title
43 * Do not call this except from inside a repo class.
44 *
45 * @param $row
46 * @param $repo
47 *
48 * @return ForeignDBFile
49 */
50 static function newFromRow( $row, $repo ) {
51 $title = Title::makeTitle( NS_FILE, $row->img_name );
52 $file = new self( $title, $repo );
53 $file->loadFromRow( $row );
54 return $file;
55 }
56
57 /**
58 * @param $srcPath String
59 * @param $flags int
60 * @param $options Array
61 * @return \FileRepoStatus
62 * @throws MWException
63 */
64 function publish( $srcPath, $flags = 0, array $options = array() ) {
65 $this->readOnlyError();
66 }
67
68 /**
69 * @param $oldver
70 * @param $desc string
71 * @param $license string
72 * @param $copyStatus string
73 * @param $source string
74 * @param $watch bool
75 * @param $timestamp bool|string
76 * @return bool
77 * @throws MWException
78 */
79 function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '',
80 $watch = false, $timestamp = false ) {
81 $this->readOnlyError();
82 }
83
84 /**
85 * @param $versions array
86 * @param $unsuppress bool
87 * @return \FileRepoStatus
88 * @throws MWException
89 */
90 function restore( $versions = array(), $unsuppress = false ) {
91 $this->readOnlyError();
92 }
93
94 /**
95 * @param $reason string
96 * @param $suppress bool
97 * @return \FileRepoStatus
98 * @throws MWException
99 */
100 function delete( $reason, $suppress = false ) {
101 $this->readOnlyError();
102 }
103
104 /**
105 * @param $target Title
106 * @return \FileRepoStatus
107 * @throws MWException
108 */
109 function move( $target ) {
110 $this->readOnlyError();
111 }
112
113 /**
114 * @return string
115 */
116 function getDescriptionUrl() {
117 // Restore remote behaviour
118 return File::getDescriptionUrl();
119 }
120
121 /**
122 * @return string
123 */
124 function getDescriptionText() {
125 // Restore remote behaviour
126 return File::getDescriptionText();
127 }
128 }