thumb_handler.php doesn't seem to extract path_info correctly
[mediawiki.git] / includes / filerepo / file / ForeignDBFile.php
blobee5883c487f9e1395544bedc6944218c93d3e0fe
1 <?php
2 /**
3 * Foreign file with an accessible MediaWiki database.
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.
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.
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
20 * @file
21 * @ingroup FileAbstraction
24 /**
25 * Foreign file with an accessible MediaWiki database
27 * @ingroup FileAbstraction
29 class ForeignDBFile extends LocalFile {
31 /**
32 * @param $title
33 * @param $repo
34 * @param $unused
35 * @return ForeignDBFile
37 static function newFromTitle( $title, $repo, $unused = null ) {
38 return new self( $title, $repo );
41 /**
42 * Create a ForeignDBFile from a title
43 * Do not call this except from inside a repo class.
45 * @param $row
46 * @param $repo
48 * @return ForeignDBFile
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;
57 /**
58 * @param $srcPath String
59 * @param $flags int
60 * @param $options Array
61 * @return \FileRepoStatus
62 * @throws MWException
64 function publish( $srcPath, $flags = 0, array $options = array() ) {
65 $this->readOnlyError();
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 * @param $user User object or null to use $wgUser
77 * @return bool
78 * @throws MWException
80 function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '',
81 $watch = false, $timestamp = false, User $user = null ) {
82 $this->readOnlyError();
85 /**
86 * @param $versions array
87 * @param $unsuppress bool
88 * @return \FileRepoStatus
89 * @throws MWException
91 function restore( $versions = array(), $unsuppress = false ) {
92 $this->readOnlyError();
95 /**
96 * @param $reason string
97 * @param $suppress bool
98 * @return \FileRepoStatus
99 * @throws MWException
101 function delete( $reason, $suppress = false ) {
102 $this->readOnlyError();
106 * @param $target Title
107 * @return \FileRepoStatus
108 * @throws MWException
110 function move( $target ) {
111 $this->readOnlyError();
115 * @return string
117 function getDescriptionUrl() {
118 // Restore remote behavior
119 return File::getDescriptionUrl();
123 * @return string
125 function getDescriptionText() {
126 // Restore remote behavior
127 return File::getDescriptionText();