Revert my api changes to pre r64815
This commit is contained in:
parent
ce87de665c
commit
a0999b5835
6 changed files with 4 additions and 68 deletions
|
|
@ -52,10 +52,6 @@ class ApiDelete extends ApiBase {
|
|||
$params = $this->extractRequestParams();
|
||||
|
||||
$this->requireOnlyOneParameter( $params, 'title', 'pageid' );
|
||||
|
||||
if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
|
||||
$this->dieUsageMsg( array( 'show' ) );
|
||||
}
|
||||
|
||||
if ( isset( $params['title'] ) ) {
|
||||
$titleObj = Title::newFromText( $params['title'] );
|
||||
|
|
@ -231,7 +227,6 @@ class ApiDelete extends ApiBase {
|
|||
array( 'nosuchpageid', 'pageid' ),
|
||||
array( 'notanarticle' ),
|
||||
array( 'hookaborted', 'error' ),
|
||||
array( 'show' ),
|
||||
) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,11 +39,6 @@ class ApiMove extends ApiBase {
|
|||
public function execute() {
|
||||
global $wgUser;
|
||||
$params = $this->extractRequestParams();
|
||||
|
||||
if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
|
||||
$this->dieUsageMsg( array( 'show' ) );
|
||||
}
|
||||
|
||||
if ( is_null( $params['reason'] ) ) {
|
||||
$params['reason'] = '';
|
||||
}
|
||||
|
|
@ -216,7 +211,6 @@ class ApiMove extends ApiBase {
|
|||
array( 'notanarticle' ),
|
||||
array( 'invalidtitle', 'to' ),
|
||||
array( 'sharedfile-exists' ),
|
||||
array( 'show' ),
|
||||
) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,10 +39,6 @@ class ApiProtect extends ApiBase {
|
|||
public function execute() {
|
||||
global $wgUser, $wgRestrictionTypes, $wgRestrictionLevels;
|
||||
$params = $this->extractRequestParams();
|
||||
|
||||
if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
|
||||
$this->dieUsageMsg( array( 'show' ) );
|
||||
}
|
||||
|
||||
$titleObj = null;
|
||||
if ( !isset( $params['title'] ) ) {
|
||||
|
|
@ -119,10 +115,7 @@ class ApiProtect extends ApiBase {
|
|||
$articleObj = new Article( $titleObj );
|
||||
if ( $params['watch'] ) {
|
||||
$articleObj->doWatch();
|
||||
} elseif ( $params['unwatch'] ) {
|
||||
$articleObj->doUnwatch();
|
||||
}
|
||||
|
||||
if ( $titleObj->exists() ) {
|
||||
$ok = $articleObj->updateRestrictions( $protections, $params['reason'], $cascade, $expiryarray );
|
||||
} else {
|
||||
|
|
@ -168,7 +161,6 @@ class ApiProtect extends ApiBase {
|
|||
'reason' => '',
|
||||
'cascade' => false,
|
||||
'watch' => false,
|
||||
'unwatch' => false,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +175,6 @@ class ApiProtect extends ApiBase {
|
|||
'cascade' => array( 'Enable cascading protection (i.e. protect pages included in this page)',
|
||||
'Ignored if not all protection levels are \'sysop\' or \'protect\'' ),
|
||||
'watch' => 'If set, add the page being (un)protected to your watchlist',
|
||||
'unwatch' => 'Remove the page being (un)protected from your watchlist',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -205,7 +196,6 @@ class ApiProtect extends ApiBase {
|
|||
array( 'protect-invalidlevel', 'level' ),
|
||||
array( 'invalidexpiry', 'expiry' ),
|
||||
array( 'pastexpiry', 'expiry' ),
|
||||
array( 'show' ),
|
||||
) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,10 +38,6 @@ class ApiRollback extends ApiBase {
|
|||
|
||||
public function execute() {
|
||||
$params = $this->extractRequestParams();
|
||||
|
||||
if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
|
||||
$this->dieUsageMsg( array( 'show' ) );
|
||||
}
|
||||
|
||||
$titleObj = null;
|
||||
if ( !isset( $params['title'] ) ) {
|
||||
|
|
@ -76,12 +72,6 @@ class ApiRollback extends ApiBase {
|
|||
// We don't care about multiple errors, just report one of them
|
||||
$this->dieUsageMsg( reset( $retval ) );
|
||||
}
|
||||
|
||||
if ( $params['watch'] || $wgUser->getOption( 'watchdeletion' ) ) {
|
||||
$articleObj->doWatch();
|
||||
} elseif ( $params['unwatch'] ) {
|
||||
$articleObj->doUnwatch();
|
||||
}
|
||||
|
||||
$info = array(
|
||||
'title' => $titleObj->getPrefixedText(),
|
||||
|
|
@ -109,9 +99,7 @@ class ApiRollback extends ApiBase {
|
|||
'user' => null,
|
||||
'token' => null,
|
||||
'summary' => null,
|
||||
'markbot' => false,
|
||||
'watch' => false,
|
||||
'unwatch' => false,
|
||||
'markbot' => false
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -121,9 +109,7 @@ class ApiRollback extends ApiBase {
|
|||
'user' => 'Name of the user whose edits are to be rolled back. If set incorrectly, you\'ll get a badtoken error.',
|
||||
'token' => 'A rollback token previously retrieved through prop=revisions',
|
||||
'summary' => 'Custom edit summary. If not set, default summary will be used.',
|
||||
'markbot' => 'Mark the reverted edits and the revert as bot edits',
|
||||
'watch' => 'Add the page to your watchlist',
|
||||
'unwatch' => 'Remove the page from your watchlist',
|
||||
'markbot' => 'Mark the reverted edits and the revert as bot edits'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -141,7 +127,6 @@ class ApiRollback extends ApiBase {
|
|||
array( 'invalidtitle', 'title' ),
|
||||
array( 'notanarticle' ),
|
||||
array( 'invaliduser', 'user' ),
|
||||
array( 'show' ),
|
||||
) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,10 +39,6 @@ class ApiUndelete extends ApiBase {
|
|||
public function execute() {
|
||||
global $wgUser;
|
||||
$params = $this->extractRequestParams();
|
||||
|
||||
if ( isset( $params['watch'] ) && isset( $params['unwatch'] ) ) {
|
||||
$this->dieUsageMsg( array( 'show' ) );
|
||||
}
|
||||
|
||||
$titleObj = null;
|
||||
if ( !isset( $params['title'] ) ) {
|
||||
|
|
@ -81,14 +77,6 @@ class ApiUndelete extends ApiBase {
|
|||
$this->dieUsageMsg( array( 'cannotundelete' ) );
|
||||
}
|
||||
|
||||
if ( $params['watch'] ) {
|
||||
$articleObj = new Article( $titleObj );
|
||||
$articleObj->doWatch();
|
||||
} elseif ( $params['unwatch'] ) {
|
||||
$articleObj = new Article( $titleObj );
|
||||
$articleObj->doUnwatch();
|
||||
}
|
||||
|
||||
if ( $retval[1] ) {
|
||||
wfRunHooks( 'FileUndeleteComplete',
|
||||
array( $titleObj, array(), $wgUser, $params['reason'] ) );
|
||||
|
|
@ -116,9 +104,7 @@ class ApiUndelete extends ApiBase {
|
|||
'reason' => '',
|
||||
'timestamps' => array(
|
||||
ApiBase::PARAM_ISMULTI => true
|
||||
),
|
||||
'watch' => false,
|
||||
'unwatch' => false,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -127,9 +113,7 @@ class ApiUndelete extends ApiBase {
|
|||
'title' => 'Title of the page you want to restore.',
|
||||
'token' => 'An undelete token previously retrieved through list=deletedrevs',
|
||||
'reason' => 'Reason for restoring (optional)',
|
||||
'timestamps' => 'Timestamps of the revisions to restore. If not set, all revisions will be restored.',
|
||||
'watch' => 'Add the page to your watchlist',
|
||||
'unwatch' => 'Remove the page from your watchlist',
|
||||
'timestamps' => 'Timestamps of the revisions to restore. If not set, all revisions will be restored.'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -147,7 +131,6 @@ class ApiUndelete extends ApiBase {
|
|||
array( 'blockedtext' ),
|
||||
array( 'invalidtitle', 'title' ),
|
||||
array( 'cannotundelete' ),
|
||||
array( 'show' ),
|
||||
) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,10 +47,6 @@ class ApiUpload extends ApiBase {
|
|||
|
||||
$this->mParams = $this->extractRequestParams();
|
||||
$request = $this->getMain()->getRequest();
|
||||
|
||||
if ( isset( $this->mParams['watch'] ) && isset( $this->mParams['unwatch'] ) ) {
|
||||
$this->dieUsageMsg( array( 'show' ) );
|
||||
}
|
||||
|
||||
// Add the uploaded file to the params array
|
||||
$this->mParams['file'] = $request->getFileName( 'file' );
|
||||
|
|
@ -226,10 +222,6 @@ class ApiUpload extends ApiBase {
|
|||
// No errors, no warnings: do the upload
|
||||
$status = $this->mUpload->performUpload( $this->mParams['comment'],
|
||||
$this->mParams['text'], $this->mParams['watch'], $wgUser );
|
||||
|
||||
if ( $this->mParams['unwatch'] ) {
|
||||
$wgUser->removeWatch( $file->getTitle() );
|
||||
}
|
||||
|
||||
if ( !$status->isGood() ) {
|
||||
$error = $status->getErrorsArray();
|
||||
|
|
@ -263,7 +255,6 @@ class ApiUpload extends ApiBase {
|
|||
'text' => null,
|
||||
'token' => null,
|
||||
'watch' => false,
|
||||
'unwatch' => false,
|
||||
'ignorewarnings' => false,
|
||||
'file' => null,
|
||||
'url' => null,
|
||||
|
|
@ -279,7 +270,6 @@ class ApiUpload extends ApiBase {
|
|||
'comment' => 'Upload comment. Also used as the initial page text for new files if "text" is not specified',
|
||||
'text' => 'Initial page text for new files',
|
||||
'watch' => 'Watch the page',
|
||||
'watch' => 'Unwatch the page',
|
||||
'ignorewarnings' => 'Ignore any warnings',
|
||||
'file' => 'File contents',
|
||||
'url' => 'Url to fetch the file from',
|
||||
|
|
@ -312,7 +302,6 @@ class ApiUpload extends ApiBase {
|
|||
array( 'mustbeloggedin', 'upload' ),
|
||||
array( 'badaccess-groups' ),
|
||||
array( 'badaccess-groups' ),
|
||||
array( 'show' ),
|
||||
array( 'code' => 'fetchfileerror', 'info' => '' ),
|
||||
array( 'code' => 'nomodule', 'info' => 'No upload module set' ),
|
||||
array( 'code' => 'empty-file', 'info' => 'The file you submitted was empty' ),
|
||||
|
|
|
|||
Loading…
Reference in a new issue