97 private static function addValues( array &$result, $values,
$flags = [], $name =
null ) {
98 foreach ( $values as $val ) {
99 if ( $val instanceof
Title ) {
102 } elseif ( $name !==
null ) {
103 $v = [ $name => $val ];
107 foreach (
$flags as $flag ) {
122 parent::__construct( $dbSource->getMain(), $dbSource->getModuleName() );
123 $this->mDbSource = $dbSource;
125 $this->mDefaultNamespace = $defaultNamespace;
128 $this->mResolveRedirects = $this->mParams[
'redirects'];
129 $this->mConvertTitles = $this->mParams[
'converttitles'];
153 $generatorName = $this->mAllowGenerator ? $this->mParams[
'generator'] :
null;
154 if ( isset( $generatorName ) ) {
156 if ( !$dbSource instanceof
ApiQuery ) {
158 $dbSource = $this->
getMain()->getModuleManager()->getModule(
'query' );
160 $generator = $dbSource->getModuleManager()->getModule( $generatorName,
null,
true );
162 $this->
dieWithError( [
'apierror-badgenerator-unknown', $generatorName ],
'badgenerator' );
165 $this->
dieWithError( [
'apierror-badgenerator-notgenerator', $generatorName ],
'badgenerator' );
169 $tmpPageSet =
new ApiPageSet( $dbSource, self::DISABLE_GENERATORS );
176 $tmpPageSet->executeInternal( $isDryRun );
184 Hooks::run(
'APIQueryGeneratorAfterExecute', [ &
$generator, &$apiModule ] );
188 foreach (
$generator->extractRequestParams() as $paramName => $param ) {
189 $main->markParamsUsed(
$generator->encodeParamName( $paramName ) );
199 if ( isset( $this->mParams[
'titles'] ) ) {
200 $dataSource =
'titles';
202 if ( isset( $this->mParams[
'pageids'] ) ) {
203 if ( isset( $dataSource ) ) {
206 'apierror-invalidparammix-cannotusewith',
213 $dataSource =
'pageids';
215 if ( isset( $this->mParams[
'revids'] ) ) {
216 if ( isset( $dataSource ) ) {
219 'apierror-invalidparammix-cannotusewith',
226 $dataSource =
'revids';
231 switch ( $dataSource ) {
239 if ( $this->mResolveRedirects ) {
240 $this->
addWarning(
'apiwarn-redirectsandrevids' );
242 $this->mResolveRedirects =
false;
270 if ( $this->mAllowGenerator && isset( $this->mParams[
'generator'] ) ) {
273 if ( isset( $this->mParams[
'titles'] ) ) {
276 if ( isset( $this->mParams[
'pageids'] ) ) {
279 if ( isset( $this->mParams[
'revids'] ) ) {
292 $this->mRequestedPageFields[$fieldName] =
null;
302 return $this->mRequestedPageFields[$fieldName];
315 'page_namespace' =>
null,
316 'page_title' =>
null,
320 if ( $this->mResolveRedirects ) {
321 $pageFlds[
'page_is_redirect'] =
null;
324 if ( $this->
getConfig()->
get(
'ContentHandlerUseDB' ) ) {
325 $pageFlds[
'page_content_model'] =
null;
328 if ( $this->
getConfig()->
get(
'PageLanguageUseDB' ) ) {
329 $pageFlds[
'page_lang'] =
null;
332 foreach ( LinkCache::getSelectFields() as $field ) {
333 $pageFlds[$field] =
null;
336 $pageFlds = array_merge( $pageFlds, $this->mRequestedPageFields );
338 return array_keys( $pageFlds );
364 return count( $this->mTitles );
388 return count( $this->mGoodTitles );
433 return array_map(
function (
$t ) {
475 'from' => strval( $titleStrFrom ),
476 'to' => $titleTo->getPrefixedText(),
478 if ( $titleTo->hasFragment() ) {
479 $r[
'tofragment'] = $titleTo->getFragment();
481 if ( $titleTo->isExternal() ) {
482 $r[
'tointerwiki'] = $titleTo->getInterwiki();
484 if ( isset( $this->mResolvedRedirectTitles[$titleStrFrom] ) ) {
485 $titleFrom = $this->mResolvedRedirectTitles[$titleStrFrom];
486 $ns = $titleFrom->getNamespace();
487 $dbkey = $titleFrom->getDBkey();
488 if ( isset( $this->mGeneratorData[$ns][$dbkey] ) ) {
489 $r = array_merge( $this->mGeneratorData[$ns][$dbkey], $r );
495 if ( !empty( $values ) && $result ) {
523 $encode = (
$wgContLang->normalize( $rawTitleStr ) !== $rawTitleStr );
525 'fromencoded' => $encode,
526 'from' => $encode ? rawurlencode( $rawTitleStr ) : $rawTitleStr,
530 if ( !empty( $values ) && $result ) {
557 'from' => $rawTitleStr,
561 if ( !empty( $values ) && $result ) {
589 'title' => $rawTitleStr,
590 'iw' => $interwikiStr,
593 $title = Title::newFromText( $rawTitleStr );
594 $item[
'url'] = $title->getFullURL(
'',
false,
PROTO_CURRENT );
598 if ( !empty( $values ) && $result ) {
620 'special',
'missingIds',
'missingRevIds',
'missingTitles',
'interwikiTitles' ]
623 if ( in_array(
'invalidTitles', $invalidChecks ) ) {
626 if ( in_array(
'special', $invalidChecks ) ) {
630 if ( $title->isKnown() ) {
639 if ( in_array(
'missingIds', $invalidChecks ) ) {
642 if ( in_array(
'missingRevIds', $invalidChecks ) ) {
645 if ( in_array(
'missingTitles', $invalidChecks ) ) {
649 if ( $title->isKnown() ) {
658 if ( in_array(
'interwikiTitles', $invalidChecks ) ) {
710 if ( !empty( $values ) && $result ) {
776 $title = Title::newFromRow( $row );
778 LinkCache::singleton()->addGoodLinkObjFromRow( $title, $row );
780 $pageId = intval( $row->page_id );
781 $this->mAllPages[$row->page_namespace][$row->page_title] = $pageId;
782 $this->mTitles[] =
$title;
784 if ( $this->mResolveRedirects && $row->page_is_redirect ==
'1' ) {
785 $this->mPendingRedirectIDs[$pageId] =
$title;
787 $this->mGoodPages[$row->page_namespace][$row->page_title] = $pageId;
788 $this->mGoodAndMissingPages[$row->page_namespace][$row->page_title] = $pageId;
789 $this->mGoodTitles[$pageId] =
$title;
792 foreach ( $this->mRequestedPageFields as $fieldName => &$fieldValues ) {
793 $fieldValues[$pageId] = $row->$fieldName;
816 if ( $linkBatch->isEmpty() ) {
822 $db = $this->
getDB();
823 $set = $linkBatch->constructSet(
'page', $db );
845 $pageids = array_map(
'intval', $pageids );
846 $remaining = array_flip( $pageids );
851 if ( !empty( $pageids ) ) {
853 'page_id' => $pageids
855 $db = $this->
getDB();
879 if ( !is_null( $remaining ) && is_null( $processTitles ) ) {
880 ApiBase::dieDebug( __METHOD__,
'Missing $processTitles parameter when $remaining is provided' );
885 foreach (
$res as $row ) {
886 $pageId = intval( $row->page_id );
889 if ( isset( $remaining ) ) {
890 if ( $processTitles ) {
891 unset( $remaining[$row->page_namespace][$row->page_title] );
893 unset( $remaining[$pageId] );
901 if ( MWNamespace::hasGenderDistinction( $row->page_namespace ) ) {
902 $usernames[] = $row->page_title;
907 if ( isset( $remaining ) ) {
909 if ( $processTitles ) {
911 $linkCache = LinkCache::singleton();
912 foreach ( $remaining as $ns => $dbkeys ) {
913 foreach ( array_keys( $dbkeys ) as $dbkey ) {
914 $title = Title::makeTitle( $ns, $dbkey );
915 $linkCache->addBadLinkObj( $title );
920 $this->mFakePageId--;
921 $this->mTitles[] =
$title;
924 if ( MWNamespace::hasGenderDistinction( $ns ) ) {
925 $usernames[] = $dbkey;
931 if ( !$this->mMissingPageIDs ) {
932 $this->mMissingPageIDs = array_keys( $remaining );
934 $this->mMissingPageIDs = array_merge( $this->mMissingPageIDs, array_keys( $remaining ) );
940 $genderCache = MediaWikiServices::getInstance()->getGenderCache();
941 $genderCache->doQuery( $usernames, __METHOD__ );
954 $revids = array_map(
'intval', $revids );
955 $db = $this->
getDB();
957 $remaining = array_flip( $revids );
961 if ( !empty( $revids ) ) {
962 $tables = [
'revision',
'page' ];
963 $fields = [
'rev_id',
'rev_page' ];
964 $where = [
'rev_id' => $revids,
'rev_page = page_id' ];
967 $res = $db->select(
$tables, $fields, $where, __METHOD__ );
968 foreach (
$res as $row ) {
969 $revid = intval( $row->rev_id );
970 $pageid = intval( $row->rev_page );
971 $this->mGoodRevIDs[$revid] = $pageid;
972 $this->mLiveRevIDs[$revid] = $pageid;
973 $pageids[$pageid] =
'';
974 unset( $remaining[$revid] );
978 $this->mMissingRevIDs = array_keys( $remaining );
986 if ( !empty( $this->mMissingRevIDs ) && $this->
getUser()->isAllowed(
'deletedhistory' ) ) {
987 $remaining = array_flip( $this->mMissingRevIDs );
989 $fields = [
'ar_rev_id',
'ar_namespace',
'ar_title' ];
992 $res = $db->select(
$tables, $fields, $where, __METHOD__ );
994 foreach (
$res as $row ) {
995 $revid = intval( $row->ar_rev_id );
996 $titles[$revid] = Title::makeTitle( $row->ar_namespace, $row->ar_title );
997 unset( $remaining[$revid] );
1002 foreach (
$titles as $revid => $title ) {
1003 $ns = $title->getNamespace();
1004 $dbkey = $title->getDBkey();
1007 if ( !isset( $this->mAllPages[$ns][$dbkey] ) &&
1008 isset( $this->mConvertedTitles[$title->getPrefixedText()] )
1010 $title = Title::newFromText( $this->mConvertedTitles[$title->getPrefixedText()] );
1011 $ns = $title->getNamespace();
1012 $dbkey = $title->getDBkey();
1015 if ( isset( $this->mAllPages[$ns][$dbkey] ) ) {
1016 $this->mGoodRevIDs[$revid] = $this->mAllPages[$ns][$dbkey];
1017 $this->mDeletedRevIDs[$revid] = $this->mAllPages[$ns][$dbkey];
1019 $remaining[$revid] =
true;
1023 $this->mMissingRevIDs = array_keys( $remaining );
1033 if ( $this->mResolveRedirects ) {
1034 $db = $this->
getDB();
1039 while ( $this->mPendingRedirectIDs || $this->mPendingRedirectSpecialPages ) {
1044 if ( $linkBatch->isEmpty() ) {
1048 $set = $linkBatch->constructSet(
'page', $db );
1049 if ( $set ===
false ) {
1054 $res = $db->select(
'page', $pageFlds, $set, __METHOD__ );
1070 $titlesToResolve = [];
1071 $db = $this->
getDB();
1073 if ( $this->mPendingRedirectIDs ) {
1082 ], [
'rd_from' => array_keys( $this->mPendingRedirectIDs ) ],
1085 foreach (
$res as $row ) {
1086 $rdfrom = intval( $row->rd_from );
1087 $from = $this->mPendingRedirectIDs[$rdfrom]->getPrefixedText();
1088 $to = Title::makeTitle(
1094 $this->mResolvedRedirectTitles[$from] = $this->mPendingRedirectIDs[$rdfrom];
1095 unset( $this->mPendingRedirectIDs[$rdfrom] );
1096 if ( $to->isExternal() ) {
1097 $this->mInterwikiTitles[$to->getPrefixedText()] = $to->getInterwiki();
1098 } elseif ( !isset( $this->mAllPages[$to->getNamespace()][$to->getDBkey()] ) ) {
1099 $titlesToResolve[] = $to;
1101 $this->mRedirectTitles[$from] = $to;
1104 if ( $this->mPendingRedirectIDs ) {
1107 foreach ( $this->mPendingRedirectIDs as $id => $title ) {
1109 $rt = $page->insertRedirect();
1114 if ( $rt->isExternal() ) {
1115 $this->mInterwikiTitles[$rt->getPrefixedText()] = $rt->getInterwiki();
1116 } elseif ( !isset( $this->mAllPages[$rt->getNamespace()][$rt->getDBkey()] ) ) {
1117 $titlesToResolve[] = $rt;
1119 $from = $title->getPrefixedText();
1120 $this->mResolvedRedirectTitles[$from] =
$title;
1121 $this->mRedirectTitles[$from] = $rt;
1122 unset( $this->mPendingRedirectIDs[$id] );
1127 if ( $this->mPendingRedirectSpecialPages ) {
1128 foreach ( $this->mPendingRedirectSpecialPages as $key =>
list( $from, $to ) ) {
1129 $fromKey = $from->getPrefixedText();
1130 $this->mResolvedRedirectTitles[$fromKey] = $from;
1131 $this->mRedirectTitles[$fromKey] = $to;
1132 if ( $to->isExternal() ) {
1133 $this->mInterwikiTitles[$to->getPrefixedText()] = $to->getInterwiki();
1134 } elseif ( !isset( $this->mAllPages[$to->getNamespace()][$to->getDBkey()] ) ) {
1135 $titlesToResolve[] = $to;
1138 $this->mPendingRedirectSpecialPages = [];
1142 $this->mCacheMode =
'private';
1178 foreach (
$titles as $title ) {
1179 if ( is_string( $title ) ) {
1181 $titleObj = Title::newFromTextThrow( $title, $this->mDefaultNamespace );
1184 if ( !isset( $this->mAllPages[0][$title] ) ) {
1188 'invalidreason' => $this->
getErrorFormatter()->formatException( $ex, [
'bc' =>
true ] ),
1190 $this->mFakePageId--;
1197 $unconvertedTitle = $titleObj->getPrefixedText();
1198 $titleWasConverted =
false;
1199 if ( $titleObj->isExternal() ) {
1201 $this->mInterwikiTitles[$unconvertedTitle] = $titleObj->getInterwiki();
1205 if ( $this->mConvertTitles &&
1207 !$titleObj->exists()
1211 $titleText = is_string( $title ) ?
$title : $titleObj->getPrefixedText();
1212 $wgContLang->findVariantLink( $titleText, $titleObj );
1213 $titleWasConverted = $unconvertedTitle !== $titleObj->getPrefixedText();
1216 if ( $titleObj->getNamespace() < 0 ) {
1218 $titleObj = $titleObj->fixSpecialName();
1219 $ns = $titleObj->getNamespace();
1220 $dbkey = $titleObj->getDBkey();
1221 if ( !isset( $this->mAllSpecials[$ns][$dbkey] ) ) {
1224 if ( $ns ===
NS_SPECIAL && $this->mResolveRedirects ) {
1234 $target = $special->getRedirect( $subpage );
1238 $this->mPendingRedirectSpecialPages[$dbkey] = [ $titleObj, $target ];
1241 $this->mFakePageId--;
1246 $linkBatch->addObj( $titleObj );
1255 if ( $titleWasConverted ) {
1256 $this->mConvertedTitles[$unconvertedTitle] = $titleObj->getPrefixedText();
1258 if ( is_string( $title ) && $title !== $unconvertedTitle ) {
1259 $this->mNormalizedTitles[
$title] = $unconvertedTitle;
1261 } elseif ( is_string( $title ) && $title !== $titleObj->getPrefixedText() ) {
1262 $this->mNormalizedTitles[
$title] = $titleObj->getPrefixedText();
1266 if ( MWNamespace::hasGenderDistinction( $titleObj->getNamespace() ) ) {
1267 $usernames[] = $titleObj->getText();
1271 $genderCache = MediaWikiServices::getInstance()->getGenderCache();
1272 $genderCache->doQuery( $usernames, __METHOD__ );
1293 $ns = $title->getNamespace();
1294 $dbkey = $title->getDBkey();
1295 $this->mGeneratorData[$ns][$dbkey] = $data;
1318 $this->mRedirectMergePolicy = $callable;
1343 $data = $result->getResultData( $path );
1344 if ( $data ===
null ) {
1349 foreach ( $path as $key ) {
1350 if ( !isset( $data[$key] ) ) {
1355 $data = &$data[$key];
1358 foreach ( $this->mGeneratorData as $ns => $dbkeys ) {
1361 foreach ( $this->mSpecialTitles as $id => $title ) {
1362 $pages[$title->getDBkey()] = $id;
1365 if ( !isset( $this->mAllPages[$ns] ) ) {
1369 $pages = $this->mAllPages[$ns];
1371 foreach ( $dbkeys as $dbkey => $genData ) {
1372 if ( !isset( $pages[$dbkey] ) ) {
1376 $pageId = $pages[$dbkey];
1377 if ( !isset( $data[$pageId] ) ) {
1383 $path2 = array_merge( $path, [ $pageId ] );
1384 foreach ( $genData as $key =>
$value ) {
1385 if ( !$result->addValue( $path2, $key,
$value ) ) {
1390 $data[$pageId] = array_merge( $data[$pageId], $genData );
1396 if ( $this->mRedirectMergePolicy ) {
1397 foreach ( $this->mResolvedRedirectTitles as $titleFrom ) {
1399 while ( isset( $this->mRedirectTitles[$dest->getPrefixedText()] ) ) {
1400 $dest = $this->mRedirectTitles[$dest->getPrefixedText()];
1402 $fromNs = $titleFrom->getNamespace();
1403 $fromDBkey = $titleFrom->getDBkey();
1404 $toPageId = $dest->getArticleID();
1405 if ( isset( $data[$toPageId] ) &&
1406 isset( $this->mGeneratorData[$fromNs][$fromDBkey] )
1410 $data[$toPageId] = call_user_func(
1411 $this->mRedirectMergePolicy,
1413 $this->mGeneratorData[$fromNs][$fromDBkey]
1432 return $this->mDbSource->getDB();
1445 foreach ( $array as $i => $int ) {
1447 unset( $array[$i] );
1478 ?
'api-pageset-param-redirects-generator'
1479 :
'api-pageset-param-redirects-nogenerator',
1481 'converttitles' => [
1484 'api-pageset-param-converttitles',
1490 if ( !$this->mAllowGenerator ) {
1491 unset( $result[
'generator'] );
1501 parent::handleParamNormalization( $paramName,
$value, $rawValue );
1503 if ( $paramName ===
'titles' ) {
1509 for ( $i = 0; $i < $l; $i++ ) {
1510 if (
$value[$i] !== $rawValue[$i] ) {
1511 $this->mNormalizedTitles[$rawValue[$i]] =
$value[$i];
1524 if ( self::$generators ===
null ) {
1529 $query = $this->
getMain()->getModuleManager()->getModule(
'query' );
1532 $prefix =
$query->getModulePath() .
'+';
1533 $mgr =
$query->getModuleManager();
1534 foreach ( $mgr->getNamesWithClasses() as $name => $class ) {
1535 if ( is_subclass_of( $class,
'ApiQueryGeneratorBase' ) ) {
1540 self::$generators = $gens;
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
This abstract class implements many basic API functions, and is the base of all API classes.
const PARAM_SUBMODULE_MAP
(string[]) When PARAM_TYPE is 'submodule', map parameter values to submodule paths.
encodeParamName( $paramName)
This method mangles parameter name based on the prefix supplied to the constructor.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
getMain()
Get the main module.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
getErrorFormatter()
Get the error formatter.
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
const PARAM_SUBMODULE_PARAM_PREFIX
(string) When PARAM_TYPE is 'submodule', used to indicate the 'g' prefix added by ApiQueryGeneratorBa...
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
const GET_VALUES_FOR_HELP
getAllowedParams() flag: When set, the result could take longer to generate, but should be more thoro...
explodeMultiValue( $value, $limit)
Split a multi-valued parameter string, like explode()
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
This class contains a list of pages that the client has requested.
getGoodAndMissingTitlesByNamespace()
Returns an array [ns][dbkey] => page_id for all good and missing titles.
initFromPageIds( $pageids)
Does the same as initFromTitles(), but is based on page IDs instead.
populateFromRevisionIDs( $revIDs)
Populate this PageSet from a list of revision IDs.
getInterwikiTitlesAsResult( $result=null, $iwUrl=false)
Get a list of interwiki titles - maps a title to its interwiki prefix as result.
getCustomField( $fieldName)
Get the value of a custom field previously requested through requestField()
getNormalizedTitles()
Get a list of title normalizations - maps a title to its normalized version.
getGenerators()
Get an array of all available generators.
__construct(ApiBase $dbSource, $flags=0, $defaultNamespace=NS_MAIN)
getGoodTitlesByNamespace()
Returns an array [ns][dbkey] => page_id for all good titles.
getAllowedParams( $flags=0)
getRevisionIDs()
Get the list of valid revision IDs (requested with the revids= parameter)
getGoodAndMissingTitles()
Title objects for good and missing titles.
populateFromPageIDs( $pageIDs)
Populate this PageSet from a list of page IDs.
getRedirectTargets()
Get the targets of the pending redirects from the database.
getMissingTitlesByNamespace()
Returns an array [ns][dbkey] => fake_page_id for all missing titles.
static getPositiveIntegers( $array)
Returns the input array of integers with all values < 0 removed.
getMissingTitles()
Title objects that were NOT found in the database.
getDB()
Get the database connection (read-only)
initFromRevIDs( $revids)
Does the same as initFromTitles(), but is based on revision IDs instead.
executeDryRun()
In case execute() is not called, call this method to mark all relevant parameters as used This preven...
getRedirectTitlesAsResult( $result=null)
Get a list of redirect resolutions - maps a title to its redirect target.
getPageTableFields()
Get the fields that have to be queried from the page table: the ones requested through requestField()...
getGoodTitleCount()
Returns the number of found unique pages (not revisions) in the set.
getRevisionCount()
Returns the number of revisions (requested with revids= parameter).
getAllTitlesByNamespace()
Returns an array [ns][dbkey] => page_id for all requested titles.
processDbRow( $row)
Extract all requested fields from the row received from the database.
processTitlesArray( $titles)
Given an array of title strings, convert them into Title objects.
static addValues(array &$result, $values, $flags=[], $name=null)
Add all items from $values into the result.
setRedirectMergePolicy( $callable)
Controls how generator data about a redirect source is merged into the generator data for the redirec...
handleParamNormalization( $paramName, $value, $rawValue)
Handle when a parameter was Unicode-normalized.
getNormalizedTitlesAsResult( $result=null)
Get a list of title normalizations - maps a title to its normalized version in the form of result arr...
getTitleCount()
Returns the number of unique pages (not revisions) in the set.
initFromTitles( $titles)
This method populates internal variables with page information based on the given array of title stri...
getInvalidTitlesAndReasons()
Titles that were deemed invalid by Title::newFromText() The array's index will be unique and negative...
array $mInvalidTitles
[fake_page_id] => [ 'title' => $title, 'invalidreason' => $reason ]
getSpecialTitles()
Get the list of titles with negative namespace.
Title[] $mPendingRedirectIDs
getTitles()
All Title objects provided.
executeInternal( $isDryRun)
Populate the PageSet from the request parameters.
resolvePendingRedirects()
Resolve any redirects in the result if redirect resolution was requested.
populateFromQueryResult( $db, $queryResult)
Populate this PageSet from a rowset returned from the database.
getMissingPageIDs()
Page IDs that were not found in the database.
requestField( $fieldName)
Request an additional field from the page table.
getInterwikiTitles()
Get a list of interwiki titles - maps a title to its interwiki prefix.
populateFromTitles( $titles)
Populate this PageSet from a list of Titles.
getMissingRevisionIDs()
Revision IDs that were not found in the database.
execute()
Populate the PageSet from the request parameters.
populateGeneratorData(&$result, array $path=[])
Populate the generator data for all titles in the result.
$mPendingRedirectSpecialPages
getConvertedTitlesAsResult( $result=null)
Get a list of title conversions - maps a title to its converted version as a result array.
getConvertedTitles()
Get a list of title conversions - maps a title to its converted version.
getInvalidTitles()
Titles that were deemed invalid by Title::newFromText() The array's index will be unique and negative...
getDataSource()
Return the parameter name that is the source of data for this PageSet.
getInvalidTitlesAndRevisions( $invalidChecks=[ 'invalidTitles', 'special', 'missingIds', 'missingRevIds', 'missingTitles', 'interwikiTitles'])
Get an array of invalid/special/missing titles.
getLiveRevisionIDs()
Get the list of non-deleted revision IDs (requested with the revids= parameter)
getCacheMode( $params=null)
Get the cache mode for the data generated by this module.
getGoodTitles()
Title objects that were found in the database.
callable null $mRedirectMergePolicy
isResolvingRedirects()
Check whether this PageSet is resolving redirects.
getRedirectTitles()
Get a list of redirect resolutions - maps a title to its redirect target, as an array of output-ready...
setGeneratorData(Title $title, array $data)
Set data for a title.
const DISABLE_GENERATORS
Constructor flag: The new instance of ApiPageSet will ignore the 'generator=' parameter.
initFromQueryResult( $res, &$remaining=null, $processTitles=null)
Iterate through the result of the query on 'page' table, and for each row create and store title obje...
getMissingRevisionIDsAsResult( $result=null)
Revision IDs that were not found in the database as result array.
getDeletedRevisionIDs()
Get the list of revision IDs that were associated with deleted titles.
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
This is the main query class.
This class represents the result of the API operations.
const OVERRIDE
Override existing value in addValue(), setValue(), and similar functions.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
getUser()
Get the User object.
getConfig()
Get the Config object.
An IContextSource implementation which will inherit context from another source but allow individual ...
WebRequest clone which takes values from a provided array.
static array $languagesWithVariants
languages supporting variants
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Superclass for any RedirectSpecialPage which redirects the user to a particular article (as opposed t...
static getPage( $name)
Find the object with a given name and return it (or NULL)
static resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
Represents a title within MediaWiki.
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
namespace being checked & $result
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
namespace and then decline to actually register it file or subcat img or subcat $title
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Allows to change the fields on the form that will be generated $name
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles