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


PHP WikiFactory::getWikiByDB方法代码示例

本文整理汇总了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__);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:16,代码来源:SpecialMultipleLookup_body.php

示例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);
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:23,代码来源:fixFounderBadges.php

示例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;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:25,代码来源:EditHubModel.class.php

示例4: nameToTitle

 private function nameToTitle($dbName)
 {
     $wikiData = WikiFactory::getWikiByDB($dbName);
     if (empty($wikiData)) {
         return '';
     } else {
         return $wikiData->city_title;
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:9,代码来源:FilePageController.class.php

示例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;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:13,代码来源:FilePageHooks.class.php


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