X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiPurge.php;h=5c83d34fa459076eb42b8c1f20e3e1401dbc83b2;hb=96b4f302af4b3c074b0a6c9c6054899230fb388a;hp=6bcecc773d9b21b44b1b347cdebd96c3b9278440;hpb=a1e605da42cb4893695df20b92b33d1bc92437a4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index 6bcecc773d..5c83d34fa4 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -1,11 +1,11 @@ extractRequestParams(); - if ( !$wgUser->isAllowed( 'purge' ) ) + if ( !$wgUser->isAllowed( 'purge' ) ) { $this->dieUsageMsg( array( 'cantpurge' ) ); - if ( !isset( $params['titles'] ) ) + } + if ( !isset( $params['titles'] ) ) { $this->dieUsageMsg( array( 'missingparam', 'titles' ) ); + } $result = array(); foreach ( $params['titles'] as $t ) { $r = array(); $title = Title::newFromText( $t ); - if ( !$title instanceof Title ) - { + if ( !$title instanceof Title ) { $r['title'] = $t; $r['invalid'] = ''; $result[] = $r; continue; } ApiQueryBase::addTitleInfo( $r, $title ); - if ( !$title->exists() ) - { + if ( !$title->exists() ) { $r['missing'] = ''; $result[] = $r; continue; @@ -84,30 +84,30 @@ class ApiPurge extends ApiBase { } public function getAllowedParams() { - return array ( + return array( 'titles' => array( - ApiBase :: PARAM_ISMULTI => true + ApiBase::PARAM_ISMULTI => true ) ); } public function getParamDescription() { - return array ( + return array( 'titles' => 'A list of titles', ); } public function getDescription() { - return array ( + return array( 'Purge the cache for the given titles.' ); } - - public function getPossibleErrors() { + + public function getPossibleErrors() { return array_merge( parent::getPossibleErrors(), array( array( 'cantpurge' ), array( 'missingparam', 'titles' ), - ) ); + ) ); } protected function getExamples() {