當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ApiQueryGeneratorBase類代碼示例

本文整理匯總了PHP中ApiQueryGeneratorBase的典型用法代碼示例。如果您正苦於以下問題:PHP ApiQueryGeneratorBase類的具體用法?PHP ApiQueryGeneratorBase怎麽用?PHP ApiQueryGeneratorBase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ApiQueryGeneratorBase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __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

示例2: __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

示例3: __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

示例4: __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

示例5: __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

示例6: __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

示例7: __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

示例8: __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

示例9: 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

示例10: __construct

 public function __construct(ApiQuery $query, $moduleName)
 {
     parent::__construct($query, $moduleName, self::$settings[$moduleName]['code']);
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:4,代碼來源:ApiQueryBacklinksprop.php

示例11: 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

示例12: 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

示例13: getPossibleErrors

 public function getPossibleErrors()
 {
     return array_merge(parent::getPossibleErrors(), array(array('missingparam', 'lang')));
 }
開發者ID:Grprashanthkumar,項目名稱:ColfusionWeb,代碼行數:4,代碼來源:ApiQueryLangBacklinks.php

示例14: 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

示例15: 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


注:本文中的ApiQueryGeneratorBase類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。