MediaWiki master
|
This class contains a list of pages that the client has requested. More...
Inherits MediaWiki\Api\ApiBase.
Public Member Functions | |
__construct (ApiBase $dbSource, $flags=0, $defaultNamespace=NS_MAIN) | |
execute () | |
Populate the PageSet from the request parameters. | |
executeDryRun () | |
In case execute() is not called, call this method to mark all relevant parameters as used This prevents unused parameters from being reported as warnings. | |
getAllowedParams ( $flags=0) | |
getAllTitlesByNamespace () | |
Returns an array [ns][dbkey] => page_id for all requested titles. | |
getCacheMode ( $params=null) | |
Get the cache mode for the data generated by this module. | |
getConvertedTitles () | |
Get a list of title conversions - maps a title to its converted version. | |
getConvertedTitlesAsResult ( $result=null) | |
Get a list of title conversions - maps a title to its converted version as a result array. | |
getCustomField ( $fieldName) | |
Get the values of one of the previously requested page table fields. | |
getDataSource () | |
Return the parameter name that is the source of data for this PageSet. | |
getDeletedRevisionIDs () | |
Get the list of revision IDs that were associated with deleted titles. | |
getGoodAndMissingPages () | |
Pages for good and missing titles. | |
getGoodAndMissingTitles () | |
Title objects for good and missing titles. | |
getGoodAndMissingTitlesByNamespace () | |
Returns an array [ns][dbkey] => page_id for all good and missing titles. | |
getGoodPages () | |
Pages that were found in the database, including redirects. | |
getGoodTitleCount () | |
Returns the number of found unique pages (not revisions) in the set. | |
getGoodTitles () | |
Title objects that were found in the database, including redirects. | |
getGoodTitlesByNamespace () | |
Returns an array [ns][dbkey] => page_id for all good titles. | |
getInterwikiTitles () | |
Get a list of interwiki titles - maps a title to its interwiki prefix. | |
getInterwikiTitlesAsResult ( $result=null, $iwUrl=false) | |
Get a list of interwiki titles - maps a title to its interwiki prefix as result. | |
getInvalidTitlesAndReasons () | |
Titles that were deemed invalid by Title::newFromText() The array's index will be unique and negative for each item. | |
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) | |
getMissingPageIDs () | |
Page IDs that were not found in the database. | |
getMissingPages () | |
Pages that were NOT found in the database. | |
getMissingRevisionIDs () | |
Revision IDs that were not found in the database. | |
getMissingRevisionIDsAsResult ( $result=null) | |
Revision IDs that were not found in the database as result array. | |
getMissingTitles () | |
Title objects that were NOT found in the database. | |
getMissingTitlesByNamespace () | |
Returns an array [ns][dbkey] => fake_page_id for all missing titles. | |
getNormalizedTitles () | |
Get a list of title normalizations - maps a title to its normalized version. | |
getNormalizedTitlesAsResult ( $result=null) | |
Get a list of title normalizations - maps a title to its normalized version in the form of result array. | |
getPages () | |
All existing and missing pages including redirects. | |
getPageTableFields () | |
Get the fields that have to be queried from the page table: the ones requested through requestField() and a few basic ones we always need. | |
getRedirectTargets () | |
Get a list of redirect resolutions - maps a title to its redirect target. | |
getRedirectTitles () | |
Get a list of redirect resolutions - maps a title to its redirect target. | |
getRedirectTitlesAsResult ( $result=null) | |
Get a list of redirect resolutions - maps a title to its redirect target. | |
getRevisionCount () | |
Returns the number of revisions (requested with revids= parameter). | |
getRevisionIDs () | |
Get the list of valid revision IDs (requested with the revids= parameter) | |
getSpecialPages () | |
Get the list of pages with negative namespace. | |
getSpecialTitles () | |
Get the list of titles with negative namespace. | |
getTitleCount () | |
Returns the number of unique pages (not revisions) in the set. | |
getTitles () | |
All existing and missing pages including redirects. | |
handleParamNormalization ( $paramName, $value, $rawValue) | |
Handle when a parameter was Unicode-normalized. | |
isResolvingRedirects () | |
Check whether this PageSet is resolving redirects. | |
populateFromPageIDs ( $pageIDs) | |
Populate this PageSet from a list of page IDs. | |
populateFromQueryResult ( $db, $queryResult) | |
Populate this PageSet from a rowset returned from the database. | |
populateFromRevisionIDs ( $revIDs) | |
Populate this PageSet from a list of revision IDs. | |
populateFromTitles ( $titles) | |
Populate this PageSet. | |
populateGeneratorData (&$result, array $path=[]) | |
Populate the generator data for all titles in the result. | |
processDbRow ( $row) | |
Extract all requested fields from the row received from the database. | |
requestField ( $fieldName) | |
Request an additional field from the page table. | |
setGeneratorData ( $title, array $data) | |
Set data for a title. | |
setRedirectMergePolicy ( $callable) | |
Controls how generator data about a redirect source is merged into the generator data for the redirect target. | |
Public Member Functions inherited from MediaWiki\Api\ApiBase | |
__construct (ApiMain $mainModule, string $moduleName, string $modulePrefix='') | |
getModuleManager () | |
Get the module manager, or null if this module has no submodules. | |
getCustomPrinter () | |
If the module may only be used with a certain format module, it should override this method to return an instance of that formatter. | |
getHelpUrls () | |
Return links to more detailed help pages about the module. | |
shouldCheckMaxlag () | |
Indicates if this module needs maxlag to be checked. | |
isReadMode () | |
Indicates whether this module requires read rights. | |
isWriteMode () | |
Indicates whether this module requires write access to the wiki. | |
mustBePosted () | |
Indicates whether this module must be called with a POST request. | |
isDeprecated () | |
Indicates whether this module is deprecated. | |
isInternal () | |
Indicates whether this module is considered to be "internal". | |
needsToken () | |
Returns the token type this module requires in order to execute. | |
getConditionalRequestData ( $condition) | |
Returns data for HTTP conditional request mechanisms. | |
getModuleName () | |
Get the name of the module being executed by this instance. | |
getModulePrefix () | |
Get parameter prefix (usually two letters or an empty string). | |
getMain () | |
Get the main module. | |
isMain () | |
Returns true if this module is the main module ($this === $this->mMainModule), false otherwise. | |
getParent () | |
Get the parent of this module. | |
lacksSameOriginSecurity () | |
Returns true if the current request breaks the same-origin policy. | |
getModulePath () | |
Get the path to this module. | |
getModuleFromPath ( $path) | |
Get a module from its module path. | |
getResult () | |
Get the result object. | |
getErrorFormatter () | |
getContinuationManager () | |
setContinuationManager (?ApiContinuationManager $manager=null) | |
dynamicParameterDocumentation () | |
Indicate if the module supports dynamically-determined parameters that cannot be included in self::getAllowedParams(). | |
encodeParamName ( $paramName) | |
This method mangles parameter name based on the prefix supplied to the constructor. | |
extractRequestParams ( $options=[]) | |
Using getAllowedParams(), this function makes an array of the values provided by the user, with the key being the name of the variable, and value - validated value from user or default. | |
requireOnlyOneParameter ( $params,... $required) | |
Die if 0 or more than one of a certain set of parameters is set and not false. | |
requireMaxOneParameter ( $params,... $required) | |
Dies if more than one parameter from a certain set of parameters are set and not false. | |
requireAtLeastOneParameter ( $params,... $required) | |
Die if 0 of a certain set of parameters is set and not false. | |
requireNoConflictingParameters ( $params, $trigger, $conflicts) | |
Die with an "invalid param mix" error if the parameters contain the trigger parameter and any of the conflicting parameters. | |
requirePostedParameters ( $params, $prefix='prefix') | |
Die if any of the specified parameters were found in the query part of the URL rather than the HTTP post body contents. | |
getTitleOrPageId ( $params, $load=false) | |
Attempts to load a WikiPage object from a title or pageid parameter, if possible. | |
getTitleFromTitleOrPageId ( $params) | |
Get a Title object from a title or pageid param, if it is possible. | |
validateToken ( $token, array $params) | |
Validate the supplied token. | |
getWatchlistUser ( $params) | |
Gets the user for whom to get the watchlist. | |
addBlockInfoToStatus (StatusValue $status, ?Authority $user=null) | |
Add block info to block messages in a Status. | |
addWarning ( $msg, $code=null, $data=null) | |
Add a warning for this module. | |
addDeprecation ( $msg, $feature, $data=[]) | |
Add a deprecation warning for this module. | |
addError ( $msg, $code=null, $data=null) | |
Add an error for this module without aborting. | |
addMessagesFromStatus (StatusValue $status, $types=[ 'warning', 'error'], array $filter=[]) | |
Add warnings and/or errors from a Status. | |
dieWithError ( $msg, $code=null, $data=null, $httpCode=0) | |
Abort execution with an error. | |
dieWithException (Throwable $exception, array $options=[]) | |
Abort execution with an error derived from a throwable. | |
dieBlocked (Block $block) | |
Throw an ApiUsageException, which will (if uncaught) call the main module's error handler and die with an error message including block info. | |
dieStatus (StatusValue $status) | |
Throw an ApiUsageException based on the Status object. | |
dieReadOnly () | |
Helper function for readonly errors. | |
checkUserRightsAny ( $rights) | |
Helper function for permission-denied errors. | |
checkTitleUserPermissions (PageIdentity $pageIdentity, $actions, array $options=[]) | |
Helper function for permission-denied errors. | |
dieWithErrorOrDebug ( $msg, $code=null, $data=null, $httpCode=null) | |
Will only set a warning instead of failing if the global $wgDebugAPI is set to true. | |
logFeatureUsage ( $feature) | |
Write logging information for API features to a debug log, for usage analysis. | |
getFinalSummary () | |
Get the final module summary. | |
getFinalDescription () | |
Get the final module description, after hooks have had a chance to tweak it as needed. | |
getFinalParams ( $flags=0) | |
Get the final list of parameters, after hooks have had a chance to tweak it as needed. | |
getFinalParamDescription () | |
Get final parameter descriptions, after hooks have had a chance to tweak it as needed. | |
modifyHelp (array &$help, array $options, array &$tocData) | |
Called from ApiHelp before the pieces are joined together and returned. | |
Public Member Functions inherited from MediaWiki\Context\ContextSource | |
canUseWikiPage () | |
Check whether a WikiPage object can be get with getWikiPage(). | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. | |
getActionName () | |
Get the action name for the current web request. | |
getAuthority () | |
getConfig () | |
getContext () | |
Get the base IContextSource object. | |
getCsrfTokenSet () | |
Get a repository to obtain and match CSRF tokens. | |
getLanguage () | |
getLanguageCode () | |
getOutput () | |
getRequest () | |
getSkin () | |
getTiming () | |
getTitle () | |
getUser () | |
getWikiPage () | |
Get the WikiPage object. | |
msg ( $key,... $params) | |
Get a Message object with context set Parameters are the same as wfMessage() | |
setContext (IContextSource $context) | |
Protected Member Functions | |
getDB () | |
Get the database connection (read-only) | |
Protected Member Functions inherited from MediaWiki\Api\ApiBase | |
getExamplesMessages () | |
Returns usage examples for this module. | |
getAllowedParams () | |
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed. | |
getWebUITokenSalt (array $params) | |
Fetch the salt used in the Web UI corresponding to this module. | |
getPermissionManager () | |
Obtain a PermissionManager instance that subclasses may use in their authorization checks. | |
getHookContainer () | |
Get a HookContainer, for running extension hooks or for hook metadata. | |
getHookRunner () | |
Get an ApiHookRunner for running core API hooks. | |
getParameter ( $paramName, $parseLimit=true) | |
Get a value for the given parameter. | |
getParameterFromSettings ( $name, $settings, $parseLimit) | |
Using the settings, determine the value for the given parameter. | |
useTransactionalTimeLimit () | |
Call wfTransactionalTimeLimit() if this request was POSTed. | |
filterIDs ( $fields, array $ids) | |
Filter out-of-range values from a list of positive integer IDs. | |
parseContinueParamOrDie (string $continue, array $types) | |
Parse the 'continue' parameter in the usual format and validate the types of each part, or die with the 'badcontinue' error if the format, types, or the number of parts is wrong. | |
dieContinueUsageIf ( $condition) | |
Die with the 'badcontinue' error. | |
getSummaryMessage () | |
Return the summary message. | |
getExtendedDescription () | |
Return the extended help text message. | |
getHelpFlags () | |
Generates the list of flags for the help screen and for action=paraminfo. | |
getModuleSourceInfo () | |
Returns information about the source of this module, if known. | |
Additional Inherited Members | |
Static Public Member Functions inherited from MediaWiki\Api\ApiBase | |
static | makeMessage ( $msg, IContextSource $context, ?array $params=null) |
Create a Message from a string or array. | |
static | clearCacheForTest () |
Reset static caches of database state. | |
Public Attributes inherited from MediaWiki\Api\ApiBase | |
const | PARAM_RANGE_ENFORCE = 'api-param-range-enforce' |
(boolean) Inverse of IntegerDef::PARAM_IGNORE_RANGE | |
const | PARAM_DFLT = ParamValidator::PARAM_DEFAULT |
const | PARAM_ISMULTI = ParamValidator::PARAM_ISMULTI |
const | PARAM_TYPE = ParamValidator::PARAM_TYPE |
const | PARAM_MAX = IntegerDef::PARAM_MAX |
const | PARAM_MAX2 = IntegerDef::PARAM_MAX2 |
const | PARAM_MIN = IntegerDef::PARAM_MIN |
const | PARAM_ALLOW_DUPLICATES = ParamValidator::PARAM_ALLOW_DUPLICATES |
const | PARAM_DEPRECATED = ParamValidator::PARAM_DEPRECATED |
const | PARAM_REQUIRED = ParamValidator::PARAM_REQUIRED |
const | PARAM_SUBMODULE_MAP = SubmoduleDef::PARAM_SUBMODULE_MAP |
const | PARAM_SUBMODULE_PARAM_PREFIX = SubmoduleDef::PARAM_SUBMODULE_PARAM_PREFIX |
const | PARAM_ALL = ParamValidator::PARAM_ALL |
const | PARAM_EXTRA_NAMESPACES = NamespaceDef::PARAM_EXTRA_NAMESPACES |
const | PARAM_SENSITIVE = ParamValidator::PARAM_SENSITIVE |
const | PARAM_DEPRECATED_VALUES = EnumDef::PARAM_DEPRECATED_VALUES |
const | PARAM_ISMULTI_LIMIT1 = ParamValidator::PARAM_ISMULTI_LIMIT1 |
const | PARAM_ISMULTI_LIMIT2 = ParamValidator::PARAM_ISMULTI_LIMIT2 |
const | PARAM_MAX_BYTES = StringDef::PARAM_MAX_BYTES |
const | PARAM_MAX_CHARS = StringDef::PARAM_MAX_CHARS |
const | PARAM_HELP_MSG = 'api-param-help-msg' |
(string|array|Message) Specify an alternative i18n documentation message for this parameter. | |
const | PARAM_HELP_MSG_APPEND = 'api-param-help-msg-append' |
((string|array|Message)[]) Specify additional i18n messages to append to the normal message for this parameter. | |
const | PARAM_HELP_MSG_INFO = 'api-param-help-msg-info' |
(array) Specify additional information tags for the parameter. | |
const | PARAM_VALUE_LINKS = 'api-param-value-links' |
Deprecated and unused. | |
const | PARAM_HELP_MSG_PER_VALUE = 'api-param-help-msg-per-value' |
((string|array|Message)[]) When PARAM_TYPE is an array, or 'string' with PARAM_ISMULTI, this is an array mapping parameter values to help messages. | |
const | PARAM_TEMPLATE_VARS = 'param-template-vars' |
(array) Indicate that this is a templated parameter, and specify replacements. | |
const | ALL_DEFAULT_STRING = '*' |
(string|array|Message) Specify an alternative i18n documentation message for this parameter. | |
const | LIMIT_BIG1 = 500 |
Fast query, standard limit. | |
const | LIMIT_BIG2 = 5000 |
Fast query, apihighlimits limit. | |
const | LIMIT_SML1 = 50 |
Slow query, standard limit. | |
const | LIMIT_SML2 = 500 |
Slow query, apihighlimits limit. | |
const | GET_VALUES_FOR_HELP = 1 |
getAllowedParams() flag: When this is set, the result could take longer to generate, but should be more thorough. | |
Static Protected Member Functions inherited from MediaWiki\Api\ApiBase | |
static | dieDebug ( $method, $message) |
Internal code errors should be reported with this method. | |
This class contains a list of pages that the client has requested.
Initially, when the client passes in titles=, pageids=, or revisions= parameter, an instance of the ApiPageSet class will normalize titles, determine if the pages/revisions exist, and prefetch any additional page data requested.
When a generator is used, the result of the generator will become the input for the second instance of this class, and all subsequent actions will use the second instance for all their work.
Definition at line 66 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::__construct | ( | ApiBase | $dbSource, |
$flags = 0, | |||
$defaultNamespace = NS_MAIN ) |
ApiBase | $dbSource | Module implementing getDB(). Allows PageSet to reuse existing db connection from the shared state like ApiQuery. |
int | $flags | Zero or more flags like DISABLE_GENERATORS |
int | $defaultNamespace | The namespace to use if none is specified by a prefix. |
Definition at line 215 of file ApiPageSet.php.
References MediaWiki\Api\ApiBase\extractRequestParams(), MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Api\ApiBase\getMain(), and MediaWiki\Api\ApiBase\getModuleName().
MediaWiki\Api\ApiPageSet::execute | ( | ) |
Populate the PageSet from the request parameters.
Reimplemented from MediaWiki\Api\ApiBase.
Definition at line 249 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::executeDryRun | ( | ) |
In case execute() is not called, call this method to mark all relevant parameters as used This prevents unused parameters from being reported as warnings.
Definition at line 242 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getAllowedParams | ( | $flags = 0 | ) |
Definition at line 1629 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getAllTitlesByNamespace | ( | ) |
Returns an array [ns][dbkey] => page_id for all requested titles.
page_id is a unique negative number in case title was not found. Invalid titles will also have negative page IDs and will be in namespace 0
Definition at line 451 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getCacheMode | ( | $params = null | ) |
Get the cache mode for the data generated by this module.
All PageSet users should take into account whether this returns a more-restrictive cache mode than the using module itself. For possible return values and other details about cache modes, see ApiMain::setCacheMode()
Public caching will only be allowed if all the modules that supply data for a given request return a cache mode of public.
array | null | $params |
Definition at line 1328 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getConvertedTitles | ( | ) |
Get a list of title conversions - maps a title to its converted version.
Definition at line 698 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getConvertedTitlesAsResult | ( | $result = null | ) |
Get a list of title conversions - maps a title to its converted version as a result array.
ApiResult | null | $result |
Definition at line 709 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getCustomField | ( | $fieldName | ) |
Get the values of one of the previously requested page table fields.
Can only be used after execute() and only for fields previously requested through requestField().
string | $fieldName | A page table field, e.g. "page_touched" |
Definition at line 407 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getDataSource | ( | ) |
Return the parameter name that is the source of data for this PageSet.
If multiple source parameters are specified (e.g. titles and pageids), one will be named arbitrarily.
Definition at line 375 of file ApiPageSet.php.
|
protected |
Get the database connection (read-only)
Reimplemented from MediaWiki\Api\ApiBase.
Definition at line 1625 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getDeletedRevisionIDs | ( | ) |
Get the list of revision IDs that were associated with deleted titles.
Definition at line 841 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getGoodAndMissingPages | ( | ) |
Pages for good and missing titles.
Definition at line 580 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getGoodAndMissingTitles | ( | ) |
Title objects for good and missing titles.
Definition at line 570 of file ApiPageSet.php.
References wfDeprecated().
MediaWiki\Api\ApiPageSet::getGoodAndMissingTitlesByNamespace | ( | ) |
Returns an array [ns][dbkey] => page_id for all good and missing titles.
Definition at line 561 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getGoodPages | ( | ) |
Pages that were found in the database, including redirects.
If redirects are resolved, this will include existing redirect targets.
Definition at line 513 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getGoodTitleCount | ( | ) |
Returns the number of found unique pages (not revisions) in the set.
Definition at line 521 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getGoodTitles | ( | ) |
Title objects that were found in the database, including redirects.
If redirects are resolved, this will include existing redirect targets.
Definition at line 502 of file ApiPageSet.php.
References wfDeprecated().
MediaWiki\Api\ApiPageSet::getGoodTitlesByNamespace | ( | ) |
Returns an array [ns][dbkey] => page_id for all good titles.
Definition at line 492 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getInterwikiTitles | ( | ) |
Get a list of interwiki titles - maps a title to its interwiki prefix.
Definition at line 729 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getInterwikiTitlesAsResult | ( | $result = null, | |
$iwUrl = false ) |
Get a list of interwiki titles - maps a title to its interwiki prefix as result.
ApiResult | null | $result | |
bool | $iwUrl |
Definition at line 741 of file ApiPageSet.php.
References PROTO_CURRENT.
MediaWiki\Api\ApiPageSet::getInvalidTitlesAndReasons | ( | ) |
Titles that were deemed invalid by Title::newFromText() The array's index will be unique and negative for each item.
Definition at line 589 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getInvalidTitlesAndRevisions | ( | $invalidChecks = [ 'invalidTitles', 'special', 'missingIds', 'missingRevIds', 'missingTitles', 'interwikiTitles' ] | ) |
Get an array of invalid/special/missing titles.
string[] | $invalidChecks | List of types of invalid titles to include. Recognized values are:
|
Definition at line 775 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getLiveRevisionIDs | ( | ) |
Get the list of non-deleted revision IDs (requested with the revids= parameter)
Definition at line 833 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getMissingPageIDs | ( | ) |
Page IDs that were not found in the database.
Definition at line 597 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getMissingPages | ( | ) |
Pages that were NOT found in the database.
The array's index will be negative for each item. If redirects are resolved, this will include missing redirect targets.
Definition at line 553 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getMissingRevisionIDs | ( | ) |
Revision IDs that were not found in the database.
Definition at line 849 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getMissingRevisionIDsAsResult | ( | $result = null | ) |
Revision IDs that were not found in the database as result array.
ApiResult | null | $result |
Definition at line 859 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getMissingTitles | ( | ) |
Title objects that were NOT found in the database.
The array's index will be negative for each item. If redirects are resolved, this will include missing redirect targets.
Definition at line 541 of file ApiPageSet.php.
References wfDeprecated().
MediaWiki\Api\ApiPageSet::getMissingTitlesByNamespace | ( | ) |
Returns an array [ns][dbkey] => fake_page_id for all missing titles.
fake_page_id is a unique negative number.
Definition at line 530 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getNormalizedTitles | ( | ) |
Get a list of title normalizations - maps a title to its normalized version.
Definition at line 665 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getNormalizedTitlesAsResult | ( | $result = null | ) |
Get a list of title normalizations - maps a title to its normalized version in the form of result array.
ApiResult | null | $result |
Definition at line 676 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getPages | ( | ) |
All existing and missing pages including redirects.
Does not include special pages, interwiki links, and invalid titles. If redirects are resolved, both the redirect and the target will be included here.
Definition at line 476 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getPageTableFields | ( | ) |
Get the fields that have to be queried from the page table: the ones requested through requestField() and a few basic ones we always need.
Definition at line 417 of file ApiPageSet.php.
References MediaWiki\Context\ContextSource\getConfig(), and MediaWiki\MainConfigNames\PageLanguageUseDB.
MediaWiki\Api\ApiPageSet::getRedirectTargets | ( | ) |
Get a list of redirect resolutions - maps a title to its redirect target.
Definition at line 618 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getRedirectTitles | ( | ) |
Get a list of redirect resolutions - maps a title to its redirect target.
Definition at line 607 of file ApiPageSet.php.
References wfDeprecated().
MediaWiki\Api\ApiPageSet::getRedirectTitlesAsResult | ( | $result = null | ) |
Get a list of redirect resolutions - maps a title to its redirect target.
Includes generator data for redirect source when available.
ApiResult | null | $result |
Definition at line 629 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getRevisionCount | ( | ) |
Returns the number of revisions (requested with revids= parameter).
Definition at line 897 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getRevisionIDs | ( | ) |
Get the list of valid revision IDs (requested with the revids= parameter)
Definition at line 825 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getSpecialPages | ( | ) |
Get the list of pages with negative namespace.
Definition at line 889 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getSpecialTitles | ( | ) |
Get the list of titles with negative namespace.
Definition at line 879 of file ApiPageSet.php.
References wfDeprecated().
MediaWiki\Api\ApiPageSet::getTitleCount | ( | ) |
Returns the number of unique pages (not revisions) in the set.
Definition at line 484 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::getTitles | ( | ) |
All existing and missing pages including redirects.
Does not include special pages, interwiki links, and invalid titles. If redirects are resolved, both the redirect and the target will be included here.
Definition at line 463 of file ApiPageSet.php.
References wfDeprecated().
MediaWiki\Api\ApiPageSet::handleParamNormalization | ( | $paramName, | |
$value, | |||
$rawValue ) |
Handle when a parameter was Unicode-normalized.
string | $paramName | Prefixed parameter name |
string | $value | Input that will be used. |
string | $rawValue | Input before normalization. |
Reimplemented from MediaWiki\Api\ApiBase.
Definition at line 1675 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::isResolvingRedirects | ( | ) |
Check whether this PageSet is resolving redirects.
Definition at line 363 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::populateFromPageIDs | ( | $pageIDs | ) |
Populate this PageSet from a list of page IDs.
int[] | $pageIDs |
Definition at line 913 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::populateFromQueryResult | ( | $db, | |
$queryResult ) |
Populate this PageSet from a rowset returned from the database.
Note that the query result must include the columns returned by $this->getPageTableFields().
IReadableDatabase | $db | Unused since 2011 |
IResultWrapper | $queryResult |
Definition at line 926 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::populateFromRevisionIDs | ( | $revIDs | ) |
Populate this PageSet from a list of revision IDs.
int[] | $revIDs | Array of revision IDs |
Definition at line 934 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::populateFromTitles | ( | $titles | ) |
Populate this PageSet.
string[] | LinkTarget[] | PageReference[] | $titles |
Definition at line 905 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::populateGeneratorData | ( | & | $result, |
array | $path = [] ) |
Populate the generator data for all titles in the result.
The page data may be inserted into an ApiResult object or into an associative array. The $path parameter specifies the path within the ApiResult or array to find the "pages" node.
The "pages" node itself must be an associative array mapping the page ID or fake page ID values returned by this pageset (see self::getAllTitlesByNamespace() and self::getSpecialTitles()) to associative arrays of page data. Each of those subarrays will have the data from self::setGeneratorData() merged in.
Data that was set by self::setGeneratorData() for pages not in the "pages" node will be ignored.
ApiResult | array | &$result | |
array | $path |
Definition at line 1538 of file ApiPageSet.php.
References $path, MediaWiki\Api\ApiResult\addValue(), and NS_SPECIAL.
MediaWiki\Api\ApiPageSet::processDbRow | ( | $row | ) |
Extract all requested fields from the row received from the database.
stdClass | $row | Result row |
Definition at line 942 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::requestField | ( | $fieldName | ) |
Request an additional field from the page table.
Must be called before execute()
string | $fieldName | A page table field, e.g. "page_touched" |
Definition at line 397 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::setGeneratorData | ( | $title, | |
array | $data ) |
Set data for a title.
This data may be extracted into an ApiResult using self::populateGeneratorData. This should generally be limited to data that is likely to be particularly useful to end users rather than just being a dump of everything returned in non-generator mode.
Redirects here will not be followed, even if 'redirects' was specified, since in the case of multiple redirects we can't know which source's data to use on the target.
PageReference | LinkTarget | $title | |
array | $data |
Definition at line 1465 of file ApiPageSet.php.
MediaWiki\Api\ApiPageSet::setRedirectMergePolicy | ( | $callable | ) |
Controls how generator data about a redirect source is merged into the generator data for the redirect target.
When not set no data is merged. Note that if multiple titles redirect to the same target the order of operations is undefined.
Example to include generated data from redirect in target, prefering the data generated for the destination when there is a collision:
callable | null | $callable | Recieves two array arguments, first the generator data for the redirect target and second the generator data for the redirect source. Returns the resulting generator data to use for the redirect target. |
Definition at line 1490 of file ApiPageSet.php.