More documentation

Remove trailing whitespace
This commit is contained in:
Sam Reed 2011-03-07 14:59:41 +00:00
parent 0e38c2cdce
commit 89656cc42c
3 changed files with 18 additions and 8 deletions

View file

@ -39,7 +39,7 @@ class ApiFileRevert extends ApiBase {
*/
protected $file;
protected $archiveName;
protected $params;
public function __construct( $main, $action ) {
@ -54,11 +54,11 @@ class ApiFileRevert extends ApiBase {
$this->params = $this->extractRequestParams();
$this->validateParameters();
$sourceUrl = $this->file->getArchiveVirtualUrl( $this->archiveName );
$status = $this->file->upload( $sourceUrl, $this->params['comment'], $this->params['comment'] );
if ( $status->isGood() ) {
$result = array( 'result' => 'Success' );
} else {
@ -67,7 +67,7 @@ class ApiFileRevert extends ApiBase {
'errors' => $this->getResult()->convertStatusToArray( $status ),
);
}
$this->getResult()->addValue( null, $this->getModuleName(), $result );
}
@ -88,7 +88,7 @@ class ApiFileRevert extends ApiBase {
}
}
}
/**
* Validate the user parameters and set $this->archiveName and $this->file.
* Throws an error if validation fails
@ -104,7 +104,7 @@ class ApiFileRevert extends ApiBase {
if ( !$this->file->exists() ) {
$this->dieUsageMsg( array( 'notanarticle' ) );
}
// Check if the archivename is valid for this file
$this->archiveName = $this->params['archivename'];
$oldFile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $this->archiveName );
@ -112,8 +112,6 @@ class ApiFileRevert extends ApiBase {
$this->dieUsageMsg( array( 'filerevert-badversion' ) );
}
}
public function mustBePosted() {
return true;

View file

@ -135,6 +135,13 @@ class ApiMove extends ApiBase {
$this->getResult()->addValue( null, $this->getModuleName(), $r );
}
/**
* @param Title $fromTitle
* @param Title $toTitle
* @param $reason
* @param $noredirect
* @return array
*/
public function moveSubpages( $fromTitle, $toTitle, $reason, $noredirect ) {
$retval = array();
$success = $fromTitle->moveSubpages( $toTitle, true, $reason, !$noredirect );

View file

@ -18,6 +18,11 @@ class LocalRepo extends FSRepo {
var $fileFromRowFactory = array( 'LocalFile', 'newFromRow' );
var $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' );
/**
* @throws MWException
* @param $row
* @return File
*/
function newFileFromRow( $row ) {
if ( isset( $row->img_name ) ) {
return call_user_func( $this->fileFromRowFactory, $row, $this );