/**
* Populate the PageSet from the request parameters.
- * @param bool $isDryRun If true, instantiates generator, but only to mark relevant parameters as used
+ * @param bool $isDryRun If true, instantiates generator, but only to mark
+ * relevant parameters as used
*/
private function executeInternal( $isDryRun ) {
$this->profileIn();
break;
case 'revids':
if ( $this->mResolveRedirects ) {
- $this->setWarning( 'Redirect resolution cannot be used together with the revids= parameter. ' .
- 'Any redirects the revids= point to have not been resolved.' );
+ $this->setWarning( 'Redirect resolution cannot be used ' .
+ 'together with the revids= parameter. Any redirects ' .
+ 'the revids= point to have not been resolved.' );
}
$this->mResolveRedirects = false;
$this->initFromRevIDs( $this->mParams['revids'] );
foreach ( $res as $row ) {
$rdfrom = intval( $row->rd_from );
$from = $this->mPendingRedirectIDs[$rdfrom]->getPrefixedText();
- $to = Title::makeTitle( $row->rd_namespace, $row->rd_title, $row->rd_fragment, $row->rd_interwiki );
+ $to = Title::makeTitle(
+ $row->rd_namespace,
+ $row->rd_title,
+ $row->rd_fragment,
+ $row->rd_interwiki
+ );
unset( $this->mPendingRedirectIDs[$rdfrom] );
if ( !$to->isExternal() && !isset( $this->mAllPages[$row->rd_namespace][$row->rd_title] ) ) {
$lb->add( $row->rd_namespace, $row->rd_title );
'titles' => 'A list of titles to work on',
'pageids' => 'A list of page IDs to work on',
'revids' => 'A list of revision IDs to work on',
- 'generator' => array( 'Get the list of pages to work on by executing the specified query module.',
- 'NOTE: generator parameter names must be prefixed with a \'g\', see examples' ),
+ 'generator' => array(
+ 'Get the list of pages to work on by executing the specified query module.',
+ 'NOTE: generator parameter names must be prefixed with a \'g\', see examples'
+ ),
'redirects' => 'Automatically resolve redirects',
- 'converttitles' => array( 'Convert titles to other variants if necessary. Only works if the wiki\'s content language supports variant conversion.',
- 'Languages that support variant conversion include ' . implode( ', ', LanguageConverter::$languagesWithVariants ) ),
+ 'converttitles' => array(
+ 'Convert titles to other variants if necessary. Only works if ' .
+ 'the wiki\'s content language supports variant conversion.',
+ 'Languages that support variant conversion include ' .
+ implode( ', ', LanguageConverter::$languagesWithVariants )
+ ),
);
}
public function getPossibleErrors() {
return array_merge( parent::getPossibleErrors(), array(
- array( 'code' => 'multisource', 'info' => "Cannot use 'pageids' at the same time as 'dataSource'" ),
- array( 'code' => 'multisource', 'info' => "Cannot use 'revids' at the same time as 'dataSource'" ),
- array( 'code' => 'badgenerator', 'info' => 'Module $generatorName cannot be used as a generator' ),
+ array(
+ 'code' => 'multisource',
+ 'info' => "Cannot use 'pageids' at the same time as 'dataSource'"
+ ),
+ array(
+ 'code' => 'multisource',
+ 'info' => "Cannot use 'revids' at the same time as 'dataSource'"
+ ),
+ array(
+ 'code' => 'badgenerator',
+ 'info' => 'Module $generatorName cannot be used as a generator'
+ ),
) );
}
}
if ( isset( $p[ApiBase::PARAM_TYPE] ) ) {
$a['type'] = $p[ApiBase::PARAM_TYPE];
if ( is_array( $a['type'] ) ) {
- $a['type'] = array_values( $a['type'] ); // to prevent sparse arrays from being serialized to JSON as objects
+ // To prevent sparse arrays from being serialized to JSON as objects
+ $a['type'] = array_values( $a['type'] );
$result->setIndexedTagName( $a['type'], 't' );
}
}
'modules' => 'List of module names (value of the action= parameter)',
'querymodules' => 'List of query module names (value of prop=, meta= or list= parameter)',
'mainmodule' => 'Get information about the main (top-level) module as well',
- 'pagesetmodule' => 'Get information about the pageset module (providing titles= and friends) as well',
+ 'pagesetmodule' => 'Get information about the pageset module ' .
+ '(providing titles= and friends) as well',
'formatmodules' => 'List of format module names (value of format= parameter)',
);
}
$format = $params['contentformat'];
if ( !is_null( $page ) && ( !is_null( $text ) || $titleProvided ) ) {
- $this->dieUsage( 'The page parameter cannot be used together with the text and title parameters', 'params' );
+ $this->dieUsage(
+ 'The page parameter cannot be used together with the text and title parameters',
+ 'params'
+ );
}
$prop = array_flip( $params['prop'] );
// TODO: Does this still need $wgTitle?
global $wgParser, $wgTitle;
- // Currently unnecessary, code to act as a safeguard against any change in current behavior of uselang
+ // Currently unnecessary, code to act as a safeguard against any change
+ // in current behavior of uselang
$oldLang = null;
- if ( isset( $params['uselang'] ) && $params['uselang'] != $this->getContext()->getLanguage()->getCode() ) {
+ if ( isset( $params['uselang'] )
+ && $params['uselang'] != $this->getContext()->getLanguage()->getCode()
+ ) {
$oldLang = $this->getContext()->getLanguage(); // Backup language
$this->getContext()->setLanguage( Language::factory( $params['uselang'] ) );
}
if ( !is_null( $params['summary'] ) ) {
$result_array['parsedsummary'] = array();
- ApiResult::setContent( $result_array['parsedsummary'], Linker::formatComment( $params['summary'], $titleObj ) );
+ ApiResult::setContent(
+ $result_array['parsedsummary'],
+ Linker::formatComment( $params['summary'], $titleObj )
+ );
}
if ( isset( $prop['langlinks'] ) || isset( $prop['languageshtml'] ) ) {
if ( isset( $prop['headhtml'] ) ) {
$result_array['headhtml'] = array();
- ApiResult::setContent( $result_array['headhtml'], $context->getOutput()->headElement( $context->getSkin() ) );
+ ApiResult::setContent(
+ $result_array['headhtml'],
+ $context->getOutput()->headElement( $context->getSkin() )
+ );
}
}
}
/**
- * @deprecated since 1.18 No modern skin generates language links this way, please use language links
+ * @deprecated since 1.18 No modern skin generates language links this way,
+ * please use language links
* data to generate your own HTML.
* @param $languages array
* @return string
return '';
}
- $s = htmlspecialchars( wfMessage( 'otherlanguages' )->text() . wfMessage( 'colon-separator' )->text() );
+ $s = htmlspecialchars( wfMessage( 'otherlanguages' )->text() .
+ wfMessage( 'colon-separator' )->text() );
$langs = array();
foreach ( $languages as $l ) {
ApiBase::PARAM_TYPE => 'integer',
),
'prop' => array(
- ApiBase::PARAM_DFLT => 'text|langlinks|categories|links|templates|images|externallinks|sections|revid|displaytitle|iwlinks|properties',
+ ApiBase::PARAM_DFLT => 'text|langlinks|categories|links|templates|' .
+ 'images|externallinks|sections|revid|displaytitle|iwlinks|properties',
ApiBase::PARAM_ISMULTI => true,
ApiBase::PARAM_TYPE => array(
'text',
return array(
'Parses content and returns parser output',
- 'See the various prop-Modules of action=query to get information from the current version of a page',
+ 'See the various prop-Modules of action=query to get information from the current' .
+ 'version of a page',
'There are several ways to specify the text to parse:',
"1) Specify a page or revision, using {$p}page, {$p}pageid, or {$p}oldid.",
"2) Specify content explicitly, using {$p}text, {$p}title, and {$p}contentmodel.",
public function getPossibleErrors() {
return array_merge( parent::getPossibleErrors(), array(
- array( 'code' => 'params', 'info' => 'The page parameter cannot be used together with the text and title parameters' ),
+ array(
+ 'code' => 'params',
+ 'info' => 'The page parameter cannot be used together with the text and title parameters'
+ ),
array( 'code' => 'missingrev', 'info' => 'There is no revision ID oldid' ),
- array( 'code' => 'permissiondenied', 'info' => 'You don\'t have permission to view deleted revisions' ),
+ array(
+ 'code' => 'permissiondenied',
+ 'info' => 'You don\'t have permission to view deleted revisions'
+ ),
array( 'code' => 'missingtitle', 'info' => 'The page you specified doesn\'t exist' ),
array( 'code' => 'nosuchsection', 'info' => 'There is no section sectionnumber in page' ),
array( 'nosuchpageid' ),
array( 'invalidtitle', 'title' ),
array( 'code' => 'parseerror', 'info' => 'Failed to parse the given text.' ),
- array( 'code' => 'notwikitext', 'info' => 'The requested operation is only supported on wikitext content.' ),
+ array(
+ 'code' => 'notwikitext',
+ 'info' => 'The requested operation is only supported on wikitext content.'
+ ),
array( 'code' => 'pagecannotexist', 'info' => "Namespace doesn't allow actual pages" ),
) );
}
return array(
'api.php?action=parse&page=Project:Sandbox' => 'Parse a page',
'api.php?action=parse&text={{Project:Sandbox}}' => 'Parse wikitext',
- 'api.php?action=parse&text={{PAGENAME}}&title=Test' => 'Parse wikitext, specifying the page title',
+ 'api.php?action=parse&text={{PAGENAME}}&title=Test'
+ => 'Parse wikitext, specifying the page title',
'api.php?action=parse&summary=Some+[[link]]&prop=' => 'Parse a summary',
);
}
* @ingroup API
*/
class ApiProtect extends ApiBase {
-
public function execute() {
global $wgRestrictionLevels;
$params = $this->extractRequestParams();
if ( count( $expiry ) == 1 ) {
$expiry = array_fill( 0, count( $params['protections'] ), $expiry[0] );
} else {
- $this->dieUsageMsg( array( 'toofewexpiries', count( $expiry ), count( $params['protections'] ) ) );
+ $this->dieUsageMsg( array(
+ 'toofewexpiries',
+ count( $expiry ),
+ count( $params['protections'] )
+ ) );
}
}
$watch = $params['watch'] ? 'watch' : $params['watchlist'];
$this->setWatch( $watch, $titleObj, 'watchdefault' );
- $status = $pageObj->doUpdateRestrictions( $protections, $expiryarray, $cascade, $params['reason'], $this->getUser() );
+ $status = $pageObj->doUpdateRestrictions(
+ $protections,
+ $expiryarray,
+ $cascade,
+ $params['reason'],
+ $this->getUser()
+ );
if ( !$status->isOK() ) {
$this->dieStatus( $status );
'pageid' => "ID of the page you want to (un)protect. Cannot be used together with {$p}title",
'token' => 'A protect token previously retrieved through prop=info',
'protections' => 'List of protection levels, formatted action=group (e.g. edit=sysop)',
- 'expiry' => array( 'Expiry timestamps. If only one timestamp is set, it\'ll be used for all protections.',
- 'Use \'infinite\', \'indefinite\' or \'never\', for a never-expiring protection.' ),
+ 'expiry' => array(
+ 'Expiry timestamps. If only one timestamp is ' .
+ 'set, it\'ll be used for all protections.',
+ 'Use \'infinite\', \'indefinite\' or \'never\', for a never-expiring protection.'
+ ),
'reason' => 'Reason for (un)protecting',
- 'cascade' => array( 'Enable cascading protection (i.e. protect pages included in this page)',
- 'Ignored if not all protection levels are \'sysop\' or \'protect\'' ),
+ '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',
- 'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch',
+ 'watchlist' => 'Unconditionally add or remove the page from your ' .
+ 'watchlist, use preferences or do not change watch',
);
}
public function getExamples() {
return array(
- 'api.php?action=protect&title=Main%20Page&token=123ABC&protections=edit=sysop|move=sysop&cascade=&expiry=20070901163000|never',
- 'api.php?action=protect&title=Main%20Page&token=123ABC&protections=edit=all|move=all&reason=Lifting%20restrictions'
+ 'api.php?action=protect&title=Main%20Page&token=123ABC&' .
+ 'protections=edit=sysop|move=sysop&cascade=&expiry=20070901163000|never',
+ 'api.php?action=protect&title=Main%20Page&token=123ABC&' .
+ 'protections=edit=all|move=all&reason=Lifting%20restrictions'
);
}
* @ingroup API
*/
class ApiPurge extends ApiBase {
-
private $mPageSet;
/**
# Parse content; note that HTML generation is only needed if we want to cache the result.
$content = $page->getContent( Revision::RAW );
- $p_result = $content->getParserOutput( $title, $page->getLatest(), $popts, $wgEnableParserCache );
+ $p_result = $content->getParserOutput(
+ $title,
+ $page->getLatest(),
+ $popts,
+ $wgEnableParserCache
+ );
# Update the links tables
$updates = $content->getSecondaryDataUpdates(
public function getParamDescription() {
return $this->getPageSet()->getFinalParamDescription() + array(
- 'prop' => 'Which properties to get for the titles/revisions/pageids. Module help is available below',
+ 'prop' => 'Which properties to get for the titles/revisions/pageids. ' .
+ 'Module help is available below',
'list' => 'Which lists to get. Module help is available below',
'meta' => 'Which metadata to get about the site. Module help is available below',
'indexpageids' => 'Include an additional pageids section listing all returned page IDs',
'export' => 'Export the current revisions of all given or generated pages',
- 'exportnowrap' => 'Return the export XML without wrapping it in an XML result (same format as Special:Export). Can only be used with export',
+ 'exportnowrap' => 'Return the export XML without wrapping it in an '.
+ 'XML result (same format as Special:Export). Can only be used with export',
'iwurl' => 'Whether to get the full URL if the title is an interwiki link',
'continue' => array(
- 'When present, formats query-continue as key-value pairs that should simply be merged into the original request.',
+ 'When present, formats query-continue as key-value pairs that ' .
+ 'should simply be merged into the original request.',
'This parameter must be set to an empty string in the initial query.',
- 'This parameter is recommended for all new development, and will be made default in the next API version.' ),
+ 'This parameter is recommended for all new development, and ' .
+ 'will be made default in the next API version.'
+ ),
);
}
public function getDescription() {
return array(
- 'Query API module allows applications to get needed pieces of data from the MediaWiki databases,',
+ 'Query API module allows applications to get needed pieces of data ' .
+ 'from the MediaWiki databases,',
'and is loosely based on the old query.php interface.',
- 'All data modifications will first have to use query to acquire a token to prevent abuse from malicious sites'
+ 'All data modifications will first have to use query to acquire a ' .
+ 'token to prevent abuse from malicious sites'
);
}
public function getExamples() {
return array(
- 'api.php?action=query&prop=revisions&meta=siteinfo&titles=Main%20Page&rvprop=user|comment&continue=',
+ 'api.php?action=query&prop=revisions&meta=siteinfo&' .
+ 'titles=Main%20Page&rvprop=user|comment&continue=',
'api.php?action=query&generator=allpages&gapprefix=API/&prop=revisions&continue=',
);
}
}
if ( isset( $params['prefix'] ) ) {
- $this->addWhere( 'cat_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
+ $this->addWhere( 'cat_title' .
+ $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
}
$this->addOption( 'LIMIT', $params['limit'] + 1 );
$count = 0;
foreach ( $res as $row ) {
if ( ++$count > $params['limit'] ) {
- // We've reached the one extra which shows that there are additional cats to be had. Stop here...
+ // We've reached the one extra which shows that there are
+ // additional cats to be had. Stop here...
$this->setContinueEnumParameter( 'continue', $row->cat_title );
break;
}
* @ingroup API
*/
class ApiQueryAllImages extends ApiQueryGeneratorBase {
-
protected $mRepo;
public function __construct( $query, $moduleName ) {
*/
public function executeGenerator( $resultPageSet ) {
if ( $resultPageSet->isResolvingRedirects() ) {
- $this->dieUsage( 'Use "gaifilterredir=nonredirects" option instead of "redirects" when using allimages as a generator', 'params' );
+ $this->dieUsage(
+ 'Use "gaifilterredir=nonredirects" option instead of "redirects" ' .
+ 'when using allimages as a generator',
+ 'params'
+ );
}
$this->run( $resultPageSet );
private function run( $resultPageSet = null ) {
$repo = $this->mRepo;
if ( !$repo instanceof LocalRepo ) {
- $this->dieUsage( 'Local file repository does not support querying all images', 'unsupportedrepo' );
+ $this->dieUsage(
+ 'Local file repository does not support querying all images',
+ 'unsupportedrepo'
+ );
}
$prefix = $this->getModulePrefix();
$disallowed = array( 'start', 'end', 'user' );
foreach ( $disallowed as $pname ) {
if ( isset( $params[$pname] ) ) {
- $this->dieUsage( "Parameter '{$prefix}{$pname}' can only be used with {$prefix}sort=timestamp", 'badparams' );
+ $this->dieUsage(
+ "Parameter '{$prefix}{$pname}' can only be used with {$prefix}sort=timestamp",
+ 'badparams'
+ );
}
}
if ( $params['filterbots'] != 'all' ) {
- $this->dieUsage( "Parameter '{$prefix}filterbots' can only be used with {$prefix}sort=timestamp", 'badparams' );
+ $this->dieUsage(
+ "Parameter '{$prefix}filterbots' can only be used with {$prefix}sort=timestamp",
+ 'badparams'
+ );
}
// Pagination
$this->addWhereRange( 'img_name', ( $ascendingOrder ? 'newer' : 'older' ), $from, $to );
if ( isset( $params['prefix'] ) ) {
- $this->addWhere( 'img_name' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
+ $this->addWhere( 'img_name' .
+ $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
}
} else {
// Check mutually exclusive params
$disallowed = array( 'from', 'to', 'prefix' );
foreach ( $disallowed as $pname ) {
if ( isset( $params[$pname] ) ) {
- $this->dieUsage( "Parameter '{$prefix}{$pname}' can only be used with {$prefix}sort=name", 'badparams' );
+ $this->dieUsage(
+ "Parameter '{$prefix}{$pname}' can only be used with {$prefix}sort=name",
+ 'badparams'
+ );
}
}
if ( !is_null( $params['user'] ) && $params['filterbots'] != 'all' ) {
- // Since filterbots checks if each user has the bot right, it doesn't make sense to use it with user
- $this->dieUsage( "Parameters '{$prefix}user' and '{$prefix}filterbots' cannot be used together", 'badparams' );
+ // Since filterbots checks if each user has the bot right, it
+ // doesn't make sense to use it with user
+ $this->dieUsage(
+ "Parameters '{$prefix}user' and '{$prefix}filterbots' cannot be used together",
+ 'badparams'
+ );
}
// Pagination
- $this->addTimestampWhereRange( 'img_timestamp', ( $ascendingOrder ? 'newer' : 'older' ), $params['start'], $params['end'] );
+ $this->addTimestampWhereRange(
+ 'img_timestamp',
+ $ascendingOrder ? 'newer' : 'older',
+ $params['start'],
+ $params['end']
+ );
// Image filters
if ( !is_null( $params['user'] ) ) {
$result = $this->getResult();
foreach ( $res as $row ) {
if ( ++$count > $limit ) {
- // We've reached the one extra which shows that there are additional pages to be had. Stop here...
+ // We've reached the one extra which shows that there are
+ // additional pages to be had. Stop here...
if ( $params['sort'] == 'name' ) {
$this->setContinueEnumParameter( 'continue', $row->img_name );
} else {
'start' => "The timestamp to start enumerating from. Can only be used with {$p}sort=timestamp",
'end' => "The timestamp to end enumerating. Can only be used with {$p}sort=timestamp",
'prop' => ApiQueryImageInfo::getPropertyDescriptions( $this->propertyFilter ),
- 'prefix' => "Search for all image titles that begin with this value. Can only be used with {$p}sort=name",
+ 'prefix' => "Search for all image titles that begin with this " .
+ "value. Can only be used with {$p}sort=name",
'minsize' => 'Limit to images with at least this many bytes',
'maxsize' => 'Limit to images with at most this many bytes',
'sha1' => "SHA1 hash of image. Overrides {$p}sha1base36",
'sha1base36' => 'SHA1 hash of image in base 36 (used in MediaWiki)',
- 'user' => "Only return files uploaded by this user. Can only be used with {$p}sort=timestamp. Cannot be used together with {$p}filterbots",
- 'filterbots' => "How to filter files uploaded by bots. Can only be used with {$p}sort=timestamp. Cannot be used together with {$p}user",
+ 'user' => "Only return files uploaded by this user. Can only be used " .
+ "with {$p}sort=timestamp. Cannot be used together with {$p}filterbots",
+ 'filterbots' => "How to filter files uploaded by bots. Can only be " .
+ "used with {$p}sort=timestamp. Cannot be used together with {$p}user",
'mime' => 'What MIME type to search for. e.g. image/jpeg. Disabled in Miser Mode',
'limit' => 'How many images in total to return',
);
$p = $this->getModulePrefix();
return array_merge( parent::getPossibleErrors(), array(
- array( 'code' => 'params', 'info' => 'Use "gaifilterredir=nonredirects" option instead of "redirects" when using allimages as a generator' ),
- array( 'code' => 'badparams', 'info' => "Parameter'{$p}start' can only be used with {$p}sort=timestamp" ),
- array( 'code' => 'badparams', 'info' => "Parameter'{$p}end' can only be used with {$p}sort=timestamp" ),
- array( 'code' => 'badparams', 'info' => "Parameter'{$p}user' can only be used with {$p}sort=timestamp" ),
- array( 'code' => 'badparams', 'info' => "Parameter'{$p}filterbots' can only be used with {$p}sort=timestamp" ),
- array( 'code' => 'badparams', 'info' => "Parameter'{$p}from' can only be used with {$p}sort=name" ),
- array( 'code' => 'badparams', 'info' => "Parameter'{$p}to' can only be used with {$p}sort=name" ),
- array( 'code' => 'badparams', 'info' => "Parameter'{$p}prefix' can only be used with {$p}sort=name" ),
- array( 'code' => 'badparams', 'info' => "Parameters '{$p}user' and '{$p}filterbots' cannot be used together" ),
- array( 'code' => 'unsupportedrepo', 'info' => 'Local file repository does not support querying all images' ),
+ array(
+ 'code' => 'params',
+ 'info' => 'Use "gaifilterredir=nonredirects" option instead ' .
+ 'of "redirects" when using allimages as a generator'
+ ),
+ array(
+ 'code' => 'badparams',
+ 'info' => "Parameter'{$p}start' can only be used with {$p}sort=timestamp"
+ ),
+ array(
+ 'code' => 'badparams',
+ 'info' => "Parameter'{$p}end' can only be used with {$p}sort=timestamp"
+ ),
+ array(
+ 'code' => 'badparams',
+ 'info' => "Parameter'{$p}user' can only be used with {$p}sort=timestamp"
+ ),
+ array(
+ 'code' => 'badparams',
+ 'info' => "Parameter'{$p}filterbots' can only be used with {$p}sort=timestamp"
+ ),
+ array(
+ 'code' => 'badparams',
+ 'info' => "Parameter'{$p}from' can only be used with {$p}sort=name"
+ ),
+ array(
+ 'code' => 'badparams',
+ 'info' => "Parameter'{$p}to' can only be used with {$p}sort=name"
+ ),
+ array(
+ 'code' => 'badparams',
+ 'info' => "Parameter'{$p}prefix' can only be used with {$p}sort=name"
+ ),
+ array(
+ 'code' => 'badparams',
+ 'info' => "Parameters '{$p}user' and '{$p}filterbots' cannot be used together"
+ ),
+ array(
+ 'code' => 'unsupportedrepo',
+ 'info' => 'Local file repository does not support querying all images' ),
array( 'code' => 'mimesearchdisabled', 'info' => 'MIME search disabled in Miser Mode' ),
array( 'code' => 'invalidsha1hash', 'info' => 'The SHA1 hash provided is not valid' ),
- array( 'code' => 'invalidsha1base36hash', 'info' => 'The SHA1Base36 hash provided is not valid' ),
+ array(
+ 'code' => 'invalidsha1base36hash',
+ 'info' => 'The SHA1Base36 hash provided is not valid'
+ ),
) );
}
'Simple Use',
'Show a list of files starting at the letter "B"',
),
- 'api.php?action=query&list=allimages&aiprop=user|timestamp|url&aisort=timestamp&aidir=older' => array(
+ 'api.php?action=query&list=allimages&aiprop=user|timestamp|url&' .
+ 'aisort=timestamp&aidir=older' => array(
'Simple Use',
'Show a list of recently uploaded files similar to Special:NewFiles',
),
- 'api.php?action=query&generator=allimages&gailimit=4&gaifrom=T&prop=imageinfo' => array(
+ 'api.php?action=query&generator=allimages&gailimit=4&' .
+ 'gaifrom=T&prop=imageinfo' => array(
'Using as Generator',
'Show info about 4 files starting at the letter "T"',
),
$this->dfltNamespace = NS_TEMPLATE;
$this->hasNamespace = true;
$this->indexTag = 't';
- $this->description = 'List all transclusions (pages embedded using {{x}}), including non-existing';
+ $this->description =
+ 'List all transclusions (pages embedded using {{x}}), including non-existing';
$this->descriptionWhat = 'transclusion';
$this->descriptionTargets = 'transcluded titles';
$this->descriptionLinking = 'transcluding';
if ( $params['unique'] ) {
if ( $fld_ids ) {
$this->dieUsage(
- "{$this->getModuleName()} cannot return corresponding page ids in unique {$this->descriptionWhat}s mode",
- 'params' );
+ "{$this->getModuleName()} cannot return corresponding page " .
+ "ids in unique {$this->descriptionWhat}s mode",
+ 'params'
+ );
}
$this->addOption( 'DISTINCT' );
}
}
// 'continue' always overrides 'from'
- $from = ( $continue || is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) );
+ $from = $continue || is_null( $params['from'] )
+ ? null
+ : $this->titlePartToKey( $params['from'] );
$to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) );
$this->addWhereRange( $pfx . $fieldTitle, 'newer', $from, $to );
if ( isset( $params['prefix'] ) ) {
- $this->addWhere( $pfx . $fieldTitle . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
+ $this->addWhere( $pfx . $fieldTitle .
+ $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
}
$this->addFields( array( 'pl_title' => $pfx . $fieldTitle ) );
$result = $this->getResult();
foreach ( $res as $row ) {
if ( ++$count > $limit ) {
- // We've reached the one extra which shows that there are additional pages to be had. Stop here...
+ // We've reached the one extra which shows that there are
+ // additional pages to be had. Stop here...
if ( $params['unique'] ) {
$this->setContinueEnumParameter( 'continue', $row->pl_title );
} else {
$what = $this->descriptionWhat;
return array_merge( parent::getPossibleErrors(), array(
- array( 'code' => 'params', 'info' => "{$m} cannot return corresponding page ids in unique {$what}s mode" ),
+ array(
+ 'code' => 'params',
+ 'info' => "{$m} cannot return corresponding page ids in unique {$what}s mode"
+ ),
) );
}
*/
public function executeGenerator( $resultPageSet ) {
if ( $resultPageSet->isResolvingRedirects() ) {
- $this->dieUsage( 'Use "gapfilterredir=nonredirects" option instead of "redirects" when using allpages as a generator', 'params' );
+ $this->dieUsage(
+ 'Use "gapfilterredir=nonredirects" option instead of "redirects" ' .
+ 'when using allpages as a generator',
+ 'params'
+ );
}
$this->run( $resultPageSet );
$this->addWhereRange( 'page_title', $dir, $from, $to );
if ( isset( $params['prefix'] ) ) {
- $this->addWhere( 'page_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
+ $this->addWhere( 'page_title' .
+ $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
}
if ( is_null( $resultPageSet ) ) {
$result = $this->getResult();
foreach ( $res as $row ) {
if ( ++$count > $limit ) {
- // We've reached the one extra which shows that there are additional pages to be had. Stop here...
+ // We've reached the one extra which shows that there are
+ // additional pages to be had. Stop here...
$this->setContinueEnumParameter( 'continue', $row->page_title );
break;
}
'maxsize' => 'Limit to pages with at most this many bytes',
'prtype' => 'Limit to protected pages only',
'prlevel' => "The protection level (must be used with {$p}prtype= parameter)",
- 'prfiltercascade' => "Filter protections based on cascadingness (ignored when {$p}prtype isn't set)",
+ 'prfiltercascade'
+ => "Filter protections based on cascadingness (ignored when {$p}prtype isn't set)",
'filterlanglinks' => array(
'Filter based on whether a page has langlinks',
'Note that this may not consider langlinks added by extensions.',
public function getPossibleErrors() {
return array_merge( parent::getPossibleErrors(), array(
- array( 'code' => 'params', 'info' => 'Use "gapfilterredir=nonredirects" option instead of "redirects" when using allpages as a generator' ),
+ array(
+ 'code' => 'params',
+ 'info' => 'Use "gapfilterredir=nonredirects" option instead of ' .
+ '"redirects" when using allpages as a generator'
+ ),
array( 'code' => 'params', 'info' => 'prlevel may not be used without prtype' ),
) );
}
'Using as Generator',
'Show info about 4 pages starting at the letter "T"',
),
- 'api.php?action=query&generator=allpages&gaplimit=2&gapfilterredir=nonredirects&gapfrom=Re&prop=revisions&rvprop=content' => array(
- 'Show content of first 2 non-redirect pages beginning at "Re"',
- )
+ 'api.php?action=query&generator=allpages&gaplimit=2&' .
+ 'gapfilterredir=nonredirects&gapfrom=Re&prop=revisions&rvprop=content'
+ => array( 'Show content of first 2 non-redirect pages beginning at "Re"' )
);
}