[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/api/ -> ApiQuery.php (summary)

Created on Sep 7, 2006 Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"

File Size: 646 lines (21 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ApiQuery:: (22 methods):
  __construct()
  getModuleManager()
  getNamedDB()
  getPageSet()
  getModules()
  getGenerators()
  getModuleType()
  getCustomPrinter()
  execute()
  mergeCacheMode()
  instantiateModules()
  outputGeneralPageInfo()
  setGeneratorContinue()
  doExport()
  getAllowedParams()
  makeHelpMsg()
  makeHelpMsgHelper()
  shouldCheckMaxlag()
  getParamDescription()
  getDescription()
  getExamples()
  getHelpUrls()


Class: ApiQuery  - X-Ref

This is the main query class. It behaves similar to ApiMain: based on the
parameters given, it will create a list of titles to work on (an ApiPageSet
object), instantiate and execute various property/list/meta modules, and
assemble all resulting data into a single ApiResult object.

In generator mode, a generator will be executed first to populate a second
ApiPageSet object, and that object will be used for all subsequent modules.

__construct( ApiMain $main, $action )   X-Ref

param: ApiMain $main
param: string $action

getModuleManager()   X-Ref
Overrides to return this instance's module manager.

return: ApiModuleManager

getNamedDB( $name, $db, $groups )   X-Ref
Get the query database connection with the given name.
If no such connection has been requested before, it will be created.
Subsequent calls with the same $name will return the same connection
as the first, regardless of the values of $db and $groups

param: string $name Name to assign to the database connection
param: int $db One of the DB_* constants
param: array $groups Query groups
return: DatabaseBase

getPageSet()   X-Ref
Gets the set of pages the user has requested (or generated)

return: ApiPageSet

getModules()   X-Ref
Get the array mapping module names to class names

return: array Array(modulename => classname)

getGenerators()   X-Ref
Get the generators array mapping module names to class names

return: array Array(modulename => classname)

getModuleType( $moduleName )   X-Ref
Get whether the specified module is a prop, list or a meta query module

param: string $moduleName Name of the module to find type for
return: string|null

getCustomPrinter()   X-Ref

return: ApiFormatRaw|null

execute()   X-Ref
Query execution happens in the following steps:
#1 Create a PageSet object with any pages requested by the user
#2 If using a generator, execute it to get a new ApiPageSet object
#3 Instantiate all requested modules.
This way the PageSet object will know what shared data is required,
and minimize DB calls.
#4 Output all normalization and redirect resolution information
#5 Execute all requested modules


mergeCacheMode( $cacheMode, $modCacheMode )   X-Ref
Update a cache mode string, applying the cache mode of a new module to it.
The cache mode may increase in the level of privacy, but public modules
added to private data do not decrease the level of privacy.

param: string $cacheMode
param: string $modCacheMode
return: string

instantiateModules( &$modules, $param )   X-Ref
Create instances of all modules requested by the client

param: array $modules To append instantiated modules to
param: string $param Parameter name to read modules from

outputGeneralPageInfo()   X-Ref
Appends an element for each page in the current pageSet with the
most general information (id, title), plus any title normalizations
and missing or invalid title/pageids/revids.


setGeneratorContinue( $module, $paramName, $paramValue )   X-Ref
This method is called by the generator base when generator in the smart-continue
mode tries to set 'query-continue' value. ApiQuery stores those values separately
until the post-processing when it is known if the generation should continue or repeat.

param: ApiQueryGeneratorBase $module Generator module
param: string $paramName
param: mixed $paramValue
return: bool True if processed, false if this is a legacy continue

doExport( $pageSet, $result )   X-Ref

param: ApiPageSet $pageSet Pages to be exported
param: ApiResult $result Result to output to

getAllowedParams( $flags = 0 )   X-Ref
No description

makeHelpMsg()   X-Ref
Override the parent to generate help messages for all available query modules.

return: string

makeHelpMsgHelper( $group )   X-Ref
For all modules of a given group, generate help messages and join them together

param: string $group Module group
return: string

shouldCheckMaxlag()   X-Ref


getParamDescription()   X-Ref
No description

getDescription()   X-Ref
No description

getExamples()   X-Ref
No description

getHelpUrls()   X-Ref
No description



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1