本文整理汇总了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;
}
示例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;
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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'];
}
}