private $mBufferResult = false, $mBuffer, $mDisabled = false;
/**
- * Constructor
* If $format ends with 'fm', pretty-print the output in HTML.
* @param ApiMain $main
* @param string $format Format name
*/
- public function __construct( $main, $format ) {
+ public function __construct( ApiMain $main, $format ) {
parent::__construct( $main, $format );
$this->mIsHtml = ( substr( $format, -2, 2 ) === 'fm' ); // ends with 'fm'
*/
class ApiFormatFeedWrapper extends ApiFormatBase {
- public function __construct( $main ) {
+ public function __construct( ApiMain $main ) {
parent::__construct( $main, 'feed' );
}
private $mIsRaw;
- public function __construct( $main, $format ) {
+ public function __construct( ApiMain $main, $format ) {
parent::__construct( $main, $format );
$this->mIsRaw = ( $format === 'rawfm' );
}
class ApiFormatRaw extends ApiFormatBase {
/**
- * Constructor
* @param ApiMain $main
- * @param ApiFormatBase $errorFallback ApiFormatBase object to fall back on for errors
+ * @param ApiFormatBase $errorFallback Object to fall back on for errors
*/
- public function __construct( $main, $errorFallback ) {
+ public function __construct( ApiMain $main, ApiFormatBase $errorFallback ) {
parent::__construct( $main, 'raw' );
$this->mErrorFallback = $errorFallback;
}
*/
class ApiLogin extends ApiBase {
- public function __construct( $main, $action ) {
+ public function __construct( ApiMain $main, $action ) {
parent::__construct( $main, $action, 'lg' );
}
*/
class ApiModuleManager extends ContextSource {
+ /**
+ * @var ApiBase
+ */
private $mParent;
+ /**
+ * @var ApiBase[]
+ */
private $mInstances = array();
+ /**
+ * @var null[]
+ */
private $mGroups = array();
+ /**
+ * @var array[]
+ */
private $mModules = array();
/**
}
/**
- * Constructor
* @param ApiBase $dbSource Module implementing getDB().
* Allows PageSet to reuse existing db connection from the shared state like ApiQuery.
* @param int $flags Zero or more flags like DISABLE_GENERATORS
*/
protected $queryObj;
- public function __construct( $main, $action ) {
+ public function __construct( ApiMain $main, $action ) {
parent::__construct( $main, $action );
$this->queryObj = new ApiQuery( $this->getMain(), 'query' );
}
* @param ApiMain $main
* @param string $action
*/
- public function __construct( $main, $action ) {
+ public function __construct( ApiMain $main, $action ) {
parent::__construct( $main, $action );
$this->mModuleMgr = new ApiModuleManager( $this );
*/
class ApiQueryAllCategories extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'ac' );
}
class ApiQueryAllImages extends ApiQueryGeneratorBase {
protected $mRepo;
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'ai' );
$this->mRepo = RepoGroup::singleton()->getLocalRepo();
}
private $useIndex = null;
private $props = array(), $propHelp = array();
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
switch ( $moduleName ) {
case 'alllinks':
$prefix = 'al';
*/
class ApiQueryAllMessages extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'am' );
}
*/
class ApiQueryAllPages extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'ap' );
}
* @ingroup API
*/
class ApiQueryAllUsers extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'au' );
}
)
);
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
$settings = $this->backlinksSettings[$moduleName];
$prefix = $settings['prefix'];
$code = $settings['code'];
private $mQueryModule, $mDb, $tables, $where, $fields, $options, $join_conds;
/**
- * @param ApiBase $query
+ * @param ApiQuery $queryModule
* @param string $moduleName
* @param string $paramPrefix
*/
- public function __construct( ApiBase $query, $moduleName, $paramPrefix = '' ) {
- parent::__construct( $query->getMain(), $moduleName, $paramPrefix );
- $this->mQueryModule = $query;
+ public function __construct( ApiQuery $queryModule, $moduleName, $paramPrefix = '' ) {
+ parent::__construct( $queryModule->getMain(), $moduleName, $paramPrefix );
+ $this->mQueryModule = $queryModule;
$this->mDb = null;
$this->resetQueryParams();
}
*/
protected $usernames;
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'bk' );
}
*/
class ApiQueryCategories extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'cl' );
}
*/
class ApiQueryCategoryInfo extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'ci' );
}
*/
class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'cm' );
}
*/
const MAX_PAGES = 100;
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
// "pc" is short for "page contributors", "co" was already taken by the
// GeoData extension's prop=coordinates.
parent::__construct( $query, $moduleName, 'pc' );
*/
class ApiQueryDeletedrevs extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'dr' );
}
*/
class ApiQueryDuplicateFiles extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'df' );
}
*/
class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'eu' );
}
*/
class ApiQueryExternalLinks extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'el' );
}
*/
class ApiQueryFileRepoInfo extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'fri' );
}
*/
class ApiQueryFilearchive extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'fa' );
}
*/
class ApiQueryIWBacklinks extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'iwbl' );
}
*/
class ApiQueryIWLinks extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'iw' );
}
const TRANSFORM_LIMIT = 50;
private static $transformCount = 0;
- public function __construct( $query, $moduleName, $prefix = 'ii' ) {
+ public function __construct( ApiQuery $query, $moduleName, $prefix = 'ii' ) {
// We allow a subclass to override the prefix, to create a related API
// module. Some other parts of MediaWiki construct this with a null
// $prefix, which used to be ignored when this only took two arguments
*/
class ApiQueryImages extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'im' );
}
private $tokenFunctions;
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'in' );
}
*/
class ApiQueryLangBacklinks extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'lbl' );
}
*/
class ApiQueryLangLinks extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'll' );
}
private $table, $prefix, $description, $helpUrl;
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
switch ( $moduleName ) {
case self::LINKS:
$this->table = 'pagelinks';
*/
class ApiQueryLogEvents extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'le' );
}
*/
class ApiQueryPagePropNames extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'ppn' );
}
private $params;
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'pp' );
}
*/
class ApiQueryPagesWithProp extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'pwp' );
}
*/
class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'pt' );
}
class ApiQueryQueryPage extends ApiQueryGeneratorBase {
private $qpMap;
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'qp' );
// Build mapping from special page names to QueryPage classes
global $wgAPIUselessQueryPages;
class ApiQueryRandom extends ApiQueryGeneratorBase {
private $pageIDs;
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'rn' );
}
*/
class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'rc' );
}
*/
class ApiQueryRedirects extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'rd' );
}
private $diffto, $difftotext, $expandTemplates, $generateXML, $section,
$token, $parseContent, $contentFormat;
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'rv' );
}
*/
const BACKEND_NULL_PARAM = 'database-backed';
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'sr' );
}
*/
class ApiQuerySiteinfo extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'si' );
}
*/
class ApiQueryStashImageInfo extends ApiQueryImageInfo {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'sii' );
}
private $fld_displayname = false, $fld_description = false,
$fld_hitcount = false;
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'tg' );
}
*/
class ApiQueryContributions extends ApiQueryBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'uc' );
}
private $prop = array();
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'ui' );
}
'gender',
);
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'us' );
}
*/
class ApiQueryWatchlist extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'wl' );
}
*/
class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'wr' );
}
private $mData, $mIsRawMode, $mSize, $mCheckingSize;
/**
- * Constructor
* @param ApiMain $main
*/
- public function __construct( $main ) {
+ public function __construct( ApiMain $main ) {
parent::__construct( $main, 'result' );
$this->mIsRawMode = false;
$this->mCheckingSize = true;
}
class ApiFormatXmlRsd extends ApiFormatXml {
- public function __construct( $main, $format ) {
+ public function __construct( ApiMain $main, $format ) {
parent::__construct( $main, $format );
$this->setRootElement( 'rsd' );
}
$prefixes = array();
foreach ( $modules as $name => $class ) {
- /** @var ApiMain $module */
- $module = new $class( $main, $name );
+ /** @var ApiQueryBase $module */
+ $module = new $class( $query, $name );
$prefix = $module->getModulePrefix();
if ( isset( $prefixes[$prefix] ) ) {
$this->fail( "Module prefix '{$prefix}' is shared between {$class} and {$prefixes[$prefix]}" );