• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ApiQueryGeneratorBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setGeneratorContinue

 /**
  * 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
  */
 public function setGeneratorContinue($module, $paramName, $paramValue)
 {
     if ($this->mUseLegacyContinue) {
         return false;
     }
     $paramName = $module->encodeParamName($paramName);
     if ($this->mGeneratorContinue === null) {
         $this->mGeneratorContinue = array();
     }
     $this->mGeneratorContinue[$paramName] = $paramValue;
     return true;
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:21,代码来源:ApiQuery.php


示例2: __construct

 public function __construct(ApiQuery $query, $moduleName)
 {
     parent::__construct($query, $moduleName, 'qp');
     // Build mapping from special page names to QueryPage classes
     $uselessQueryPages = $this->getConfig()->get('APIUselessQueryPages');
     $this->qpMap = array();
     foreach (QueryPage::getPages() as $page) {
         if (!in_array($page[1], $uselessQueryPages)) {
             $this->qpMap[$page[1]] = $page[0];
         }
     }
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:12,代码来源:ApiQueryQueryPage.php


示例3: __construct

 public function __construct($query, $moduleName)
 {
     switch ($moduleName) {
         case self::LINKS:
             $this->table = 'pagelinks';
             $this->prefix = 'pl';
             $this->description = 'link';
             break;
         case self::TEMPLATES:
             $this->table = 'templatelinks';
             $this->prefix = 'tl';
             $this->description = 'template';
             break;
         default:
             ApiBase::dieDebug(__METHOD__, 'Unknown module name');
     }
     parent::__construct($query, $moduleName, $this->prefix);
 }
开发者ID:josephdye,项目名称:wikireader,代码行数:18,代码来源:ApiQueryLinks.php


示例4: __construct

 public function __construct($query, $moduleName)
 {
     extract($this->backlinksSettings[$moduleName]);
     parent::__construct($query, $moduleName, $code);
     $this->bl_ns = $prefix . '_namespace';
     $this->bl_from = $prefix . '_from';
     $this->bl_table = $linktbl;
     $this->bl_code = $code;
     $this->hasNS = $moduleName !== 'imageusage';
     if ($this->hasNS) {
         $this->bl_title = $prefix . '_title';
         $this->bl_sort = "{$this->bl_ns}, {$this->bl_title}, {$this->bl_from}";
         $this->bl_fields = array($this->bl_ns, $this->bl_title);
     } else {
         $this->bl_title = $prefix . '_to';
         $this->bl_sort = "{$this->bl_title}, {$this->bl_from}";
         $this->bl_fields = array($this->bl_title);
     }
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:19,代码来源:ApiQueryBacklinks.php


示例5: __construct

 public function __construct(ApiQuery $query, $moduleName)
 {
     switch ($moduleName) {
         case self::LINKS:
             $this->table = 'pagelinks';
             $this->prefix = 'pl';
             $this->titlesParam = 'titles';
             $this->helpUrl = 'https://www.mediawiki.org/wiki/API:Links';
             break;
         case self::TEMPLATES:
             $this->table = 'templatelinks';
             $this->prefix = 'tl';
             $this->titlesParam = 'templates';
             $this->helpUrl = 'https://www.mediawiki.org/wiki/API:Templates';
             break;
         default:
             ApiBase::dieDebug(__METHOD__, 'Unknown module name');
     }
     parent::__construct($query, $moduleName, $this->prefix);
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:20,代码来源:ApiQueryLinks.php


示例6: __construct

 public function __construct(ApiQuery $query, $moduleName)
 {
     $settings = $this->backlinksSettings[$moduleName];
     $prefix = $settings['prefix'];
     $code = $settings['code'];
     $this->resultArr = array();
     parent::__construct($query, $moduleName, $code);
     $this->bl_ns = $prefix . '_namespace';
     $this->bl_from = $prefix . '_from';
     $this->bl_table = $settings['linktbl'];
     $this->bl_code = $code;
     $this->helpUrl = $settings['helpurl'];
     $this->hasNS = $moduleName !== 'imageusage';
     if ($this->hasNS) {
         $this->bl_title = $prefix . '_title';
         $this->bl_fields = array($this->bl_ns, $this->bl_title);
     } else {
         $this->bl_title = $prefix . '_to';
         $this->bl_fields = array($this->bl_title);
     }
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:21,代码来源:ApiQueryBacklinks.php


示例7: __construct

 public function __construct($query, $moduleName)
 {
     $code = $prefix = $linktbl = null;
     extract($this->backlinksSettings[$moduleName]);
     parent::__construct($query, $moduleName, $code);
     $this->bl_ns = $prefix . '_namespace';
     $this->bl_from = $prefix . '_from';
     $this->bl_tables = array($linktbl, 'page');
     $this->bl_code = $code;
     $this->hasNS = $moduleName !== 'imageusage';
     if ($this->hasNS) {
         $this->bl_title = $prefix . '_title';
         global $wgRequest;
         $this->bl_sort = $wgRequest->getVal('revsort') == 1 ? "tl_from desc" : "{$this->bl_ns}, {$this->bl_title}, {$this->bl_from}";
         $this->bl_fields = array($this->bl_ns, $this->bl_title);
     } else {
         $this->bl_title = $prefix . '_to';
         $this->bl_sort = "{$this->bl_title}, {$this->bl_from}";
         $this->bl_fields = array($this->bl_title);
     }
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:21,代码来源:ApiQueryBacklinks.php


示例8: __construct

 public function __construct(ApiQuery $query, $moduleName)
 {
     switch ($moduleName) {
         case 'alllinks':
             $prefix = 'al';
             $this->table = 'pagelinks';
             $this->tablePrefix = 'pl_';
             $this->useIndex = 'pl_namespace';
             $this->indexTag = 'l';
             break;
         case 'alltransclusions':
             $prefix = 'at';
             $this->table = 'templatelinks';
             $this->tablePrefix = 'tl_';
             $this->dfltNamespace = NS_TEMPLATE;
             $this->useIndex = 'tl_namespace';
             $this->indexTag = 't';
             break;
         case 'allfileusages':
             $prefix = 'af';
             $this->table = 'imagelinks';
             $this->tablePrefix = 'il_';
             $this->fieldTitle = 'to';
             $this->dfltNamespace = NS_FILE;
             $this->hasNamespace = false;
             $this->indexTag = 'f';
             break;
         case 'allredirects':
             $prefix = 'ar';
             $this->table = 'redirect';
             $this->tablePrefix = 'rd_';
             $this->indexTag = 'r';
             $this->props = array('fragment' => 'rd_fragment', 'interwiki' => 'rd_interwiki');
             break;
         default:
             ApiBase::dieDebug(__METHOD__, 'Unknown module name');
     }
     parent::__construct($query, $moduleName, $prefix);
 }
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:39,代码来源:ApiQueryAllLinks.php


示例9: __construct

 public function __construct(ApiQuery $query, $moduleName)
 {
     switch ($moduleName) {
         case self::LINKS:
             $this->table = 'pagelinks';
             $this->prefix = 'pl';
             $this->description = 'link';
             $this->titlesParam = 'titles';
             $this->titlesParamDescription = 'Only list links to these titles. Useful ' . 'for checking whether a certain page links to a certain title.';
             $this->helpUrl = 'https://www.mediawiki.org/wiki/API:Properties#links_.2F_pl';
             break;
         case self::TEMPLATES:
             $this->table = 'templatelinks';
             $this->prefix = 'tl';
             $this->description = 'template';
             $this->titlesParam = 'templates';
             $this->titlesParamDescription = 'Only list these templates. Useful ' . 'for checking whether a certain page uses a certain template.';
             $this->helpUrl = 'https://www.mediawiki.org/wiki/API:Properties#templates_.2F_tl';
             break;
         default:
             ApiBase::dieDebug(__METHOD__, 'Unknown module name');
     }
     parent::__construct($query, $moduleName, $this->prefix);
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:24,代码来源:ApiQueryLinks.php


示例10: getPossibleErrors

 public function getPossibleErrors()
 {
     $p = $this->getModulePrefix();
     return array_merge(parent::getPossibleErrors(), array(array('code' => 'params', 'info' => 'Use "gaifilterredir=nonredirects" option instead ' . 'of "redirects" when using allimages as a generator'), array('code' => 'badparams', 'info' => "Parameter'{$p}start' can only be used with {$p}sort=timestamp"), array('code' => 'badparams', 'info' => "Parameter'{$p}end' can only be used with {$p}sort=timestamp"), array('code' => 'badparams', 'info' => "Parameter'{$p}user' can only be used with {$p}sort=timestamp"), array('code' => 'badparams', 'info' => "Parameter'{$p}filterbots' can only be used with {$p}sort=timestamp"), array('code' => 'badparams', 'info' => "Parameter'{$p}from' can only be used with {$p}sort=name"), array('code' => 'badparams', 'info' => "Parameter'{$p}to' can only be used with {$p}sort=name"), array('code' => 'badparams', 'info' => "Parameter'{$p}prefix' can only be used with {$p}sort=name"), array('code' => 'badparams', 'info' => "Parameters '{$p}user' and '{$p}filterbots' cannot be used together"), array('code' => 'unsupportedrepo', 'info' => 'Local file repository does not support querying all images'), array('code' => 'mimesearchdisabled', 'info' => 'MIME search disabled in Miser Mode'), array('code' => 'invalidsha1hash', 'info' => 'The SHA1 hash provided is not valid'), array('code' => 'invalidsha1base36hash', 'info' => 'The SHA1Base36 hash provided is not valid')));
 }
开发者ID:crippsy14,项目名称:orange-smorange,代码行数:5,代码来源:ApiQueryAllImages.php


示例11: __construct

 public function __construct(ApiQuery $query, $moduleName)
 {
     parent::__construct($query, $moduleName, self::$settings[$moduleName]['code']);
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:4,代码来源:ApiQueryBacklinksprop.php


示例12: getPossibleErrors

 public function getPossibleErrors()
 {
     return array_merge(parent::getPossibleErrors(), array(array('code' => 'search-text-disabled', 'info' => 'text search is disabled'), array('code' => 'search-title-disabled', 'info' => 'title search is disabled'), array('code' => 'search-error', 'info' => 'search error has occurred')));
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:4,代码来源:ApiQuerySearch.php


示例13: getPossibleErrors

 public function getPossibleErrors()
 {
     return array_merge(parent::getPossibleErrors(), array(array('invalidtitle', 'title'), array('code' => 'bad_image_title', 'info' => "The title for {$this->getModuleName()} query must be an image"), array('code' => '_badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query')));
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:4,代码来源:ApiQueryBacklinks.php


示例14: getPossibleErrors

 public function getPossibleErrors()
 {
     return array_merge(parent::getPossibleErrors(), array(array('missingparam', 'lang')));
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:4,代码来源:ApiQueryLangBacklinks.php


示例15: getPossibleErrors

 public function getPossibleErrors()
 {
     return array_merge(parent::getPossibleErrors(), array(array('code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist'), array('show'), array('code' => 'bad_wlowner', 'info' => 'Specified user does not exist'), array('code' => 'bad_wltoken', 'info' => 'Incorrect watchlist token provided -- please set a correct token in Special:Preferences')));
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:4,代码来源:ApiQueryWatchlistRaw.php


示例16: getPossibleErrors

 public function getPossibleErrors()
 {
     return array_merge(parent::getPossibleErrors(), array(array('show'), array('code' => 'permissiondenied', 'info' => 'You need the patrol right to request the patrolled flag'), array('code' => 'user-excludeuser', 'info' => 'user and excludeuser cannot be used together')));
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:4,代码来源:ApiQueryRecentChanges.php


示例17: getPossibleErrors

 public function getPossibleErrors()
 {
     return array_merge(parent::getPossibleErrors(), array(array('code' => 'params', 'info' => 'Use "gapfilterredir=nonredirects" option instead of ' . '"redirects" when using allpages as a generator'), array('code' => 'params', 'info' => 'prlevel may not be used without prtype')));
 }
开发者ID:crippsy14,项目名称:orange-smorange,代码行数:4,代码来源:ApiQueryAllPages.php


示例18: getPossibleErrors

 public function getPossibleErrors()
 {
     return array_merge(parent::getPossibleErrors(), $this->getTitleOrPageIdErrorMessage(), array(array('code' => 'invalidcategory', 'info' => 'The category name you entered is not valid')));
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:4,代码来源:ApiQueryCategoryMembers.php


示例19: getPossibleErrors

 public function getPossibleErrors()
 {
     return array_merge(parent::getPossibleErrors(), array(array('code' => '_badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query')));
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:4,代码来源:ApiQueryAllCategories.php


示例20: getPossibleErrors

 public function getPossibleErrors()
 {
     return array_merge(parent::getPossibleErrors(), array(array('code' => 'params', 'info' => 'Use "gaifilterredir=nonredirects" option instead of "redirects" when using allimages as a generator'), array('code' => 'unsupportedrepo', 'info' => 'Local file repository does not support querying all images'), array('code' => 'mimesearchdisabled', 'info' => 'MIME search disabled in Miser Mode'), array('code' => 'invalidsha1hash', 'info' => 'The SHA1 hash provided is not valid'), array('code' => 'invalidsha1base36hash', 'info' => 'The SHA1Base36 hash provided is not valid'), array('code' => '_badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query')));
 }
开发者ID:h4ck3rm1k3,项目名称:mediawiki,代码行数:4,代码来源:ApiQueryAllImages.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ApiResult类代码示例发布时间:2022-05-23
下一篇:
PHP ApiQueryBase类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap