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
21 * @ingroup FileAbstraction
25 * Foreign file with an accessible MediaWiki database
27 * @ingroup FileAbstraction
29 class ForeignDBFile
extends LocalFile
{
35 * @return ForeignDBFile
37 static function newFromTitle( $title, $repo, $unused = null ) {
38 return new self( $title, $repo );
42 * Create a ForeignDBFile from a title
43 * Do not call this except from inside a repo class.
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 );
57 function publish( $srcPath, $flags = 0 ) {
58 $this->readOnlyError();
61 function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '',
62 $watch = false, $timestamp = false ) {
63 $this->readOnlyError();
66 function restore( $versions = array(), $unsuppress = false ) {
67 $this->readOnlyError();
70 function delete( $reason, $suppress = false ) {
71 $this->readOnlyError();
74 function move( $target ) {
75 $this->readOnlyError();
81 function getDescriptionUrl() {
82 // Restore remote behaviour
83 return File
::getDescriptionUrl();
89 function getDescriptionText() {
90 // Restore remote behaviour
91 return File
::getDescriptionText();