2007-05-30 21:02:32 +00:00
|
|
|
<?php
|
2010-09-04 18:13:18 +00:00
|
|
|
/**
|
2012-05-07 07:11:33 +00:00
|
|
|
* Foreign file with an accessible MediaWiki database.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
2010-09-04 18:13:18 +00:00
|
|
|
*
|
|
|
|
|
* @file
|
2012-02-08 15:51:16 +00:00
|
|
|
* @ingroup FileAbstraction
|
2010-09-04 18:13:18 +00:00
|
|
|
*/
|
2007-05-30 21:02:32 +00:00
|
|
|
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
/**
|
2010-09-04 18:13:18 +00:00
|
|
|
* Foreign file with an accessible MediaWiki database
|
|
|
|
|
*
|
2012-02-08 15:51:16 +00:00
|
|
|
* @ingroup FileAbstraction
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
*/
|
2007-05-30 21:02:32 +00:00
|
|
|
class ForeignDBFile extends LocalFile {
|
2011-05-28 17:51:33 +00:00
|
|
|
/**
|
2013-12-04 16:18:05 +00:00
|
|
|
* @param Title $title
|
|
|
|
|
* @param FileRepo $repo
|
|
|
|
|
* @param null $unused
|
2011-05-28 17:51:33 +00:00
|
|
|
* @return ForeignDBFile
|
|
|
|
|
*/
|
2008-05-10 17:41:17 +00:00
|
|
|
static function newFromTitle( $title, $repo, $unused = null ) {
|
2007-05-30 21:02:32 +00:00
|
|
|
return new self( $title, $repo );
|
|
|
|
|
}
|
|
|
|
|
|
2008-05-14 17:29:38 +00:00
|
|
|
/**
|
|
|
|
|
* Create a ForeignDBFile from a title
|
|
|
|
|
* Do not call this except from inside a repo class.
|
2011-05-28 17:51:33 +00:00
|
|
|
*
|
2013-12-04 16:18:05 +00:00
|
|
|
* @param stdClass $row
|
|
|
|
|
* @param FileRepo $repo
|
2011-05-28 17:51:33 +00:00
|
|
|
* @return ForeignDBFile
|
2008-05-14 17:29:38 +00:00
|
|
|
*/
|
|
|
|
|
static function newFromRow( $row, $repo ) {
|
2008-12-01 17:14:30 +00:00
|
|
|
$title = Title::makeTitle( NS_FILE, $row->img_name );
|
2008-05-14 17:29:38 +00:00
|
|
|
$file = new self( $title, $repo );
|
|
|
|
|
$file->loadFromRow( $row );
|
2013-11-23 20:00:11 +00:00
|
|
|
|
2008-05-14 17:29:38 +00:00
|
|
|
return $file;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-18 02:58:15 +00:00
|
|
|
/**
|
2013-12-04 16:18:05 +00:00
|
|
|
* @param string $srcPath
|
|
|
|
|
* @param int $flags
|
|
|
|
|
* @param array $options
|
|
|
|
|
* @return FileRepoStatus
|
2012-05-18 02:58:15 +00:00
|
|
|
* @throws MWException
|
|
|
|
|
*/
|
2012-11-24 14:15:32 +00:00
|
|
|
function publish( $srcPath, $flags = 0, array $options = array() ) {
|
2007-05-30 21:02:32 +00:00
|
|
|
$this->readOnlyError();
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-18 02:58:15 +00:00
|
|
|
/**
|
2014-04-19 15:19:17 +00:00
|
|
|
* @param string $oldver
|
|
|
|
|
* @param string $desc
|
|
|
|
|
* @param string $license
|
|
|
|
|
* @param string $copyStatus
|
|
|
|
|
* @param string $source
|
|
|
|
|
* @param bool $watch
|
|
|
|
|
* @param bool|string $timestamp
|
|
|
|
|
* @param User $user User object or null to use $wgUser
|
2012-12-09 03:12:12 +00:00
|
|
|
* @return bool
|
2012-05-18 02:58:15 +00:00
|
|
|
* @throws MWException
|
|
|
|
|
*/
|
2008-05-10 17:41:17 +00:00
|
|
|
function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '',
|
2013-02-18 18:55:08 +00:00
|
|
|
$watch = false, $timestamp = false, User $user = null ) {
|
2007-05-30 21:02:32 +00:00
|
|
|
$this->readOnlyError();
|
|
|
|
|
}
|
2011-05-28 17:51:33 +00:00
|
|
|
|
2012-05-18 02:58:15 +00:00
|
|
|
/**
|
2013-12-04 16:18:05 +00:00
|
|
|
* @param array $versions
|
|
|
|
|
* @param bool $unsuppress
|
|
|
|
|
* @return FileRepoStatus
|
2012-05-18 02:58:15 +00:00
|
|
|
* @throws MWException
|
|
|
|
|
*/
|
2008-05-10 17:41:17 +00:00
|
|
|
function restore( $versions = array(), $unsuppress = false ) {
|
2007-05-30 21:02:32 +00:00
|
|
|
$this->readOnlyError();
|
|
|
|
|
}
|
2011-05-28 17:51:33 +00:00
|
|
|
|
2012-05-18 02:58:15 +00:00
|
|
|
/**
|
2013-12-04 16:18:05 +00:00
|
|
|
* @param string $reason
|
|
|
|
|
* @param bool $suppress
|
2014-05-07 17:42:35 +00:00
|
|
|
* @param User|null $user
|
2013-12-04 16:18:05 +00:00
|
|
|
* @return FileRepoStatus
|
2012-05-18 02:58:15 +00:00
|
|
|
* @throws MWException
|
|
|
|
|
*/
|
2014-05-07 17:42:35 +00:00
|
|
|
function delete( $reason, $suppress = false, $user = null ) {
|
2007-06-04 21:03:36 +00:00
|
|
|
$this->readOnlyError();
|
|
|
|
|
}
|
2011-05-28 17:51:33 +00:00
|
|
|
|
2012-05-18 02:58:15 +00:00
|
|
|
/**
|
2013-12-04 16:18:05 +00:00
|
|
|
* @param Title $target
|
|
|
|
|
* @return FileRepoStatus
|
2012-05-18 02:58:15 +00:00
|
|
|
* @throws MWException
|
|
|
|
|
*/
|
2008-05-10 17:41:17 +00:00
|
|
|
function move( $target ) {
|
2008-05-03 13:49:53 +00:00
|
|
|
$this->readOnlyError();
|
|
|
|
|
}
|
2011-05-28 17:51:33 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2011-03-02 21:06:54 +00:00
|
|
|
function getDescriptionUrl() {
|
2013-03-04 08:44:38 +00:00
|
|
|
// Restore remote behavior
|
2011-03-02 21:06:54 +00:00
|
|
|
return File::getDescriptionUrl();
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-28 17:51:33 +00:00
|
|
|
/**
|
2013-12-04 16:18:05 +00:00
|
|
|
* @param bool|Language $lang Optional language to fetch description in.
|
2011-05-28 17:51:33 +00:00
|
|
|
* @return string
|
|
|
|
|
*/
|
2013-08-31 05:45:43 +00:00
|
|
|
function getDescriptionText( $lang = false ) {
|
2013-03-04 08:44:38 +00:00
|
|
|
// Restore remote behavior
|
2013-08-31 05:45:43 +00:00
|
|
|
return File::getDescriptionText( $lang );
|
2011-03-02 21:06:54 +00:00
|
|
|
}
|
2007-05-30 21:02:32 +00:00
|
|
|
}
|