本文整理汇总了PHP中WikiFactory::getWikiByDB方法的典型用法代码示例。如果您正苦于以下问题:PHP WikiFactory::getWikiByDB方法的具体用法?PHP WikiFactory::getWikiByDB怎么用?PHP WikiFactory::getWikiByDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WikiFactory
的用法示例。
在下文中一共展示了WikiFactory::getWikiByDB方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showWikiForm
function showWikiForm($error = "")
{
global $wgOut, $wgLang;
wfProfileIn(__METHOD__);
/* no list when no user */
if (empty($this->mUsername)) {
wfProfileOut(__METHOD__);
return false;
}
$action = htmlspecialchars($this->mTitle->getLocalURL());
$oWiki = WikiFactory::getWikiByDB($this->mWiki);
$oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
$oTmpl->set_vars(array("title" => $this->mTitle, "error" => $error, "action" => $action, "username" => $this->mUsername, "wiki" => $this->mWiki));
$wgOut->addHTML($oTmpl->render("wiki-form"));
wfProfileOut(__METHOD__);
}
示例2: AchAwardingService
<?php
/*
* written to retroactively award founders with BADGE_CREATOR
*
* @author tor
*/
include '/usr/wikia/source/trunk/maintenance/commandLine.inc';
if (class_exists(AchAwardingService)) {
$wiki = WikiFactory::getWikiByDB($wgDBname);
if (empty($wiki)) {
exit;
}
$founderId = $wiki->city_founding_user;
if (empty($founderId)) {
exit;
}
$founder = User::newFromId($founderId);
$founder->load();
// get achievement to chek if it's there already
$achService = new AchAwardingService();
$achService->awardCustomNotInTrackBadge($founder, BADGE_CREATOR);
}
示例3: getFileCityId
/**
* @desc Return city_id for a given file
* This is needed as File here is returned from wfFindFile
* that can fallback to some other wikis
*
* @param File $file
* @return int|null|string
*/
private function getFileCityId(File $file)
{
global $wgCityId;
$repo = $file->getRepo();
/**
* Only fetch city_id if the file is coming from
* WikiaForeignDBViaLBRepo
*/
if ($repo instanceof WikiaForeignDBViaLBRepo) {
$dbName = $repo->getDBName();
$wiki = WikiFactory::getWikiByDB($dbName);
if (!empty($wiki)) {
return $wiki->city_id;
}
}
return $wgCityId;
}
示例4: nameToTitle
private function nameToTitle($dbName)
{
$wikiData = WikiFactory::getWikiByDB($dbName);
if (empty($wikiData)) {
return '';
} else {
return $wikiData->city_title;
}
}
示例5: onGlobalUsageImagePageWikiLink
/**
* Hook: get wiki link for GlobalUsage
* @param string $wikiName
* @return bool true
*/
public static function onGlobalUsageImagePageWikiLink(&$wikiName)
{
$wiki = WikiFactory::getWikiByDB($wikiName);
if ($wiki) {
$wikiName = '[' . $wiki->city_url . ' ' . $wiki->city_title . ']';
}
return true;
}