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


PHP Wiki::get_extensions方法代码示例

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


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

示例1: load

 /**
  * Loads list of all SiteMatrix wikis
  *
  * @static
  * @access public
  * @param  Wiki &$wikiClass The Wiki class object
  * @return array List of all wikis
  * @throws AssertFailure
  * @throws DependencyError
  * @throws LoggedOut
  * @throws MWAPIError
  */
 public static function load(Wiki &$wikiClass)
 {
     if (!array_key_exists('SiteMatrix', $wikiClass->get_extensions())) {
         throw new DependencyError("SiteMatrix");
     }
     $SMres = $wikiClass->apiQuery(array('action' => 'sitematrix'));
     $wikis = $SMres['sitematrix'];
     //return $wikis;
     $retarray = array('raw' => $wikis, 'urls' => array(), 'langs' => array(), 'names' => array(), 'privates' => array());
     foreach ($wikis as $site) {
         if (is_array($site)) {
             if (isset($site['site'])) {
                 $retarray['langs'][] = $site['code'];
                 $retarray['names'][$site['code']] = $site['name'];
                 foreach ($site['site'] as $site2) {
                     $retarray['urls'][] = $site2['url'];
                     if (isset($site2['private'])) {
                         $retarray['privates'][] = $site2;
                     }
                 }
             } else {
                 foreach ($site as $site2) {
                     $sites2['urls'][] = $site2['url'];
                     if (isset($site2['private'])) {
                         $retarray['privates'][] = $site2;
                     }
                 }
             }
         }
     }
     return $retarray;
 }
开发者ID:emijrp,项目名称:Peachy,代码行数:44,代码来源:SiteMatrix.php

示例2: DependencyError

 /**
  * @param Wiki $wikiClass
  * @throws DependencyError
  */
 function __construct(Wiki &$wikiClass)
 {
     if (!array_key_exists('FlaggedRevs', $wikiClass->get_extensions())) {
         throw new DependencyError("FlaggedRevs", "http://www.mediawiki.org/wiki/Extension:FlaggedRevs");
     }
     $this->wiki = $wikiClass;
 }
开发者ID:emijrp,项目名称:Peachy,代码行数:11,代码来源:FlaggedRevs.php

示例3: __construct

 /**
  * Construction method for the AbuseFilter class
  *
  * @access public
  * @param Wiki &$wikiClass The Wiki class object
  * @throws DependencyError
  */
 public function __construct(Wiki &$wikiClass)
 {
     $this->wiki = $wikiClass;
     if (!array_key_exists('Abuse Filter', $wikiClass->get_extensions())) {
         throw new DependencyError("AbuseFilter", "http://www.mediawiki.org/wiki/Extension:AbuseFilter");
     }
 }
开发者ID:emijrp,项目名称:Peachy,代码行数:14,代码来源:AbuseFilter.php

示例4: __construct

 public function __construct(Wiki &$wikiClass, $repo)
 {
     $this->wiki = $wikiClass;
     $this->repo = $repo;
     if (!array_key_exists('CodeReview', $wikiClass->get_extensions())) {
         throw new DependencyError("CodeReview", "http://www.mediawiki.org/wiki/Extension:CodeReview");
     }
 }
开发者ID:emijrp,项目名称:Peachy,代码行数:8,代码来源:CodeReview.php

示例5: load

 public static function load(Wiki &$wikiClass)
 {
     if (!array_key_exists('GlobalBlocking', $wikiClass->get_extensions())) {
         throw new DependencyError("GlobalBlocking", "http://www.mediawiki.org/wiki/Extension:GlobalBlocking");
     }
 }
开发者ID:emijrp,项目名称:Peachy,代码行数:6,代码来源:GlobalBlocking.php

示例6: DependencyError

 /**
  * Construction method for the GlobalUserInfo class
  *
  * @access public
  * @param Wiki &$wikiClass The Wiki class object
  * @param mixed $pgUsername Username
  * @throws APIError
  * @throws AssertFailure
  * @throws DependencyError
  * @throws LoggedOut
  * @throws MWAPIError
  */
 function __construct(Wiki &$wikiClass, $pgUsername)
 {
     if (!array_key_exists('Central Auth', $wikiClass->get_extensions())) {
         throw new DependencyError("CentralAuth", "http://www.mediawiki.org/wiki/Extension:CentralAuth");
     }
     $this->username = ucfirst($pgUsername);
     $this->wiki = $wikiClass;
     $guiRes = $this->wiki->apiQuery(array('action' => 'query', 'meta' => 'globaluserinfo', 'guiuser' => ucfirst($pgUsername), 'guiprop' => 'groups|merged|unattached'), false, false);
     if (!isset($guiRes['query']['globaluserinfo'])) {
         $this->exists = false;
         if (isset($guiRes['error']) && $guiRes['error']['code'] != 'guinosuchuser') {
             throw new MWAPIError($guiRes['error']);
         } elseif (@$guiRes['error']['code'] != 'guinosuchuser') {
             throw new MWAPIError(array('code' => 'UnknownError', 'info' => 'Unknown API Error'));
         }
     } else {
         $this->groups = $guiRes['query']['globaluserinfo']['groups'];
         $this->merged = $guiRes['query']['globaluserinfo']['merged'];
         $this->merged = $guiRes['query']['globaluserinfo']['unattached'];
         $this->id = $guiRes['query']['globaluserinfo']['id'];
         $this->registration = $guiRes['query']['globaluserinfo']['registration'];
     }
 }
开发者ID:emijrp,项目名称:Peachy,代码行数:35,代码来源:GlobalUserInfo.php


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