当前位置: 首页>>代码示例>>PHP>>正文


PHP ApiBase::getMain方法代码示例

本文整理汇总了PHP中ApiBase::getMain方法的典型用法代码示例。如果您正苦于以下问题:PHP ApiBase::getMain方法的具体用法?PHP ApiBase::getMain怎么用?PHP ApiBase::getMain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ApiBase的用法示例。


在下文中一共展示了ApiBase::getMain方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct(ApiBase $query, $moduleName, $paramPrefix = '')
 {
     parent::__construct($query->getMain(), $moduleName, $paramPrefix);
     $this->mQueryModule = $query;
     $this->mDb = null;
     $this->resetQueryParams();
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:7,代码来源:ApiQueryBase.php

示例2: __construct

	/**
	 * Constructor
	 * @param $dbSource ApiBase 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
	 * @param int $defaultNamespace the namespace to use if none is specified by a prefix.
	 * @since 1.21 accepts $flags instead of two boolean values
	 */
	public function __construct( ApiBase $dbSource, $flags = 0, $defaultNamespace = NS_MAIN ) {
		parent::__construct( $dbSource->getMain(), $dbSource->getModuleName() );
		$this->mDbSource = $dbSource;
		$this->mAllowGenerator = ( $flags & ApiPageSet::DISABLE_GENERATORS ) == 0;
		$this->mDefaultNamespace = $defaultNamespace;

		$this->profileIn();
		$this->mParams = $this->extractRequestParams();
		$this->mResolveRedirects = $this->mParams['redirects'];
		$this->mConvertTitles = $this->mParams['converttitles'];
		$this->profileOut();
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:20,代码来源:ApiPageSet.php

示例3:

 /**
  * @param $query ApiBase
  * @param $moduleName
  * @return GenericMetricBase
  *
  */
 function __construct(ApiBase $query, $moduleName)
 {
     parent::__construct($query->getMain(), $moduleName);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:10,代码来源:GenericMetricBase.php

示例4: addNewAccountApiForm

 /**
  * Pass API parameter on to the login form when using
  * API account creation.
  *
  * @param ApiBase $apiModule
  * @param LoginForm $loginForm
  * @return hook return value
  */
 public static function addNewAccountApiForm($apiModule, $loginForm)
 {
     global $wgRequest;
     $main = $apiModule->getMain();
     if ($main->getVal('ignoreantispoof') !== null) {
         $wgRequest->setVal('wpIgnoreAntiSpoof', '1');
         // Suppress "unrecognized parameter" warning:
         $main->getVal('wpIgnoreAntiSpoof');
     }
     return true;
 }
开发者ID:jasonthebomb,项目名称:mediawiki-extensions-AntiSpoof,代码行数:19,代码来源:AntiSpoofHooks.php

示例5: onApiCheckCanExecute

 /**
  * Validate "centralauthtoken", and disable certain modules that make no
  * sense with "centralauthtoken".
  * @param ApiBase $module API module
  * @param User $user User
  * @param array &$message Error message key and params
  * @return bool
  */
 static function onApiCheckCanExecute($module, $user, &$message)
 {
     global $wgCentralAuthCookies;
     if (!$wgCentralAuthCookies) {
         return true;
     }
     if (self::hasApiToken()) {
         $module->getMain()->getVal('centralauthtoken');
         # Mark used
         $apiCentralUser = self::getApiCentralUser(true);
         $centralUser = CentralAuthUser::getInstance($user);
         if (!$apiCentralUser || !$centralUser || $apiCentralUser->getId() !== $centralUser->getId()) {
             // Bad design, API.
             ApiBase::$messageMap['centralauth-api-badtoken'] = array('code' => 'badtoken', 'info' => 'The centralauthtoken is not valid');
             $message = array('centralauth-api-badtoken');
             return false;
         }
         if ($module instanceof ApiLogin || $module instanceof ApiLogout) {
             // Bad design, API.
             ApiBase::$messageMap['centralauth-api-blacklistedmodule'] = array('code' => 'badparams', 'info' => 'The module "$1" may not be used with centralauthtoken');
             $message = array('centralauth-api-blacklistedmodule', $module->getModuleName());
             return false;
         }
     }
     return true;
 }
开发者ID:NDKilla,项目名称:mediawiki-extensions-CentralAuth,代码行数:34,代码来源:CentralAuthHooks.php

示例6: __construct

 public function __construct(ApiBase $query, $moduleName)
 {
     parent::__construct($query->getMain(), $moduleName);
     $this->numberOfActiveEditors = 100;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:5,代码来源:DumpActiveEditors100Metric.php

示例7: __construct

 public function __construct(ApiBase $query, $moduleName)
 {
     parent::__construct($query->getMain(), $moduleName);
     $this->normaliseQueryParameters();
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:5,代码来源:SquidPageViewsMetric.php


注:本文中的ApiBase::getMain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。