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


PHP F::App方法代码示例

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


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

示例1: __construct

 function __construct(User $user)
 {
     $app = F::App();
     $this->user = $user;
     $this->memc = $app->wg->Memc;
     $this->namespaces = wfGetNamespaces();
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:7,代码来源:RecentChangesFiltersStorage.class.php

示例2: getContent

 public function getContent()
 {
     wfProfileIn(__METHOD__);
     $processingTimeStart = null;
     if ($this->mForceProfile) {
         $processingTimeStart = microtime(true);
     }
     $hash = wfAssetManagerGetSASShash($this->mOid);
     $paramsHash = md5(urldecode(http_build_query($this->mParams, '', ' ')));
     $cacheId = "/Sass-{$paramsHash}-{$hash}-" . self::CACHE_VERSION;
     $memc = F::App()->wg->Memc;
     $cachedContent = $memc->get($cacheId);
     if ($cachedContent) {
         $this->mContent = $cachedContent;
     } else {
         $this->processContent();
         // This is the final pass on contents which, among other things, performs minification
         parent::getContent($processingTimeStart);
         // Prevent cache poisoning if we are serving sass from preview server
         if (getHostPrefix() == null && !$this->mForceProfile) {
             $memc->set($cacheId, $this->mContent);
         }
     }
     wfProfileOut(__METHOD__);
     return $this->mContent;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:26,代码来源:AssetsManagerSassBuilder.class.php

示例3: onAfterEditPermissionErrors

 /** @brief Allows to edit or not archived talk pages and its subpages
  *
  * @author Andrzej 'nAndy' Łukaszewski
  *
  * @param $pernErrors
  * @param Title $title
  *
  * @return boolean true -- because it's a hook
  */
 public function onAfterEditPermissionErrors($permErrors, $title, $removeArray)
 {
     $app = F::App();
     if (empty($app->wg->EnableWallExt) && ($title->getNamespace() == NS_USER_WALL || $title->getNamespace() == NS_USER_WALL_MESSAGE || $title->getNamespace() == NS_USER_WALL_MESSAGE_GREETING)) {
         $permErrors[] = array(0 => 'protectedpagetext', 1 => 'archived');
     }
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:17,代码来源:WallDisabledHooksHelper.class.php

示例4: executeIndex

 public function executeIndex()
 {
     $app = F::App();
     $app->wf->ProfileIn(__METHOD__);
     $this->response->addAsset('extensions/wikia/Wall/css/WallHistoryRail.scss');
     $this->usersInvolved = array_merge($this->getUsersData(self::$usersData), $this->getUsersData(self::$anonsData));
     $app->wf->ProfileOut(__METHOD__);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:8,代码来源:WallRailController.class.php

示例5: getProgram

 /**
  * Get the current program object or load it if it hasn't been loaded yet
  * @return VideoPageToolProgram
  */
 public function getProgram()
 {
     if (!$this->program) {
         $lang = F::App()->wg->LanguageCode;
         $this->program = VideoPageToolProgram::loadProgramNearestDate($lang);
     }
     return $this->program;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:12,代码来源:VideoHomePageController.class.php

示例6: executeIndex

 public function executeIndex()
 {
     $app = F::App();
     $app->wf->ProfileIn(__METHOD__);
     #var_dump($rvc->videos);
     #$this->realResponse->addAsset('extensions/wikia/Wall/css/WallHistoryRail.scss');
     $app->wf->ProfileOut(__METHOD__);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:8,代码来源:RelatedVideosRailController.class.php

示例7: onAccountNavigationModuleAfterDropdownItems

 /**
  * Add a link to create user page automagically to the account navigation dropdown
  * and add the create user page JS module
  *
  * @author grunny
  * @param $possibleItems Array Allowed items that appear in the Oasis account navigation
  * @param $personalUrls Array An array of items to go in the menu
  * @return true
  */
 public static function onAccountNavigationModuleAfterDropdownItems(&$possibleItems, &$personalUrls)
 {
     $app = F::App();
     if ($app->wg->User->isAllowed('quicktools')) {
         $possibleItems[] = 'createuserpage';
         $personalUrls['createuserpage'] = array('href' => '#', 'text' => wfMessage('quicktools-createuserpage-link')->escaped());
         $app->wg->Out->addModules('ext.createUserPage');
     }
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:19,代码来源:QuickToolsHooksHelper.class.php

示例8: getLastChildCommentId

function getLastChildCommentId($articleComment)
{
    $db = F::App()->wf->GetDB(DB_MASTER);
    $row = $db->selectRow(array('page', 'page_wikia_props'), array('max(page.page_id) last_comment_id'), array('page_wikia_props.page_id is NULL', 'page.page_namespace' => $articleComment->getTitle()->getNamespace(), 'page.page_title ' . $db->buildLike(sprintf("%s/%s", $articleComment->getTitle()->getDBkey(), ARTICLECOMMENT_PREFIX), $db->anyString())), __METHOD__, array(), array('page_wikia_props' => array('LEFT JOIN', array('page.page_id' => 'page_wikia_props.page_id', 'page_wikia_props.propname in (' . WPP_WALL_ARCHIVE . ',' . WPP_WALL_REMOVE . ',' . WPP_WALL_ADMINDELETE . ')', 'page_wikia_props.props' => serialize(1)))));
    $lastCommentId = 0;
    if ($row) {
        $lastCommentId = $row->last_comment_id;
    }
    return $lastCommentId;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:10,代码来源:helper.php

示例9: canDisplay

 public static function canDisplay()
 {
     $app = F::App();
     // Get the current page's namespace
     $curNS = $app->wg->Title->getNamespace();
     // Set the default location to the file page
     $tsLocation = $app->wg->TouchStormLocation;
     // Make sure the TouchStorm location matches the current location
     return $curNS == NS_FILE && preg_match('/file/', $tsLocation) || $curNS == NS_MAIN && preg_match('/article/', $tsLocation);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:10,代码来源:TouchStormHooks.class.php

示例10: __construct

 public function __construct(Title $title = null)
 {
     $this->app = F::App();
     if ($title) {
         $this->query = $this->prepareCode($title->getText());
     }
     $this->censusDataArr = $this->getCacheCensusDataArr($this->app->wg->LanguageCode, true);
     if ($this->app->wg->LanguageCode != 'en') {
         $this->censusDataArrDefault = $this->getCacheCensusDataArr('en', true);
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:11,代码来源:CensusDataRetrieval.class.php

示例11: executeIndex

 public function executeIndex()
 {
     $app = F::App();
     wfProfileIn(__METHOD__);
     $this->response->addAsset('extensions/wikia/Wall/css/WallHistoryRail.scss');
     $this->usersInvolved = array_merge($this->getUsersData(self::$usersData), $this->getUsersData(self::$anonsData));
     if ($this->wg->EnableWallExt) {
         $this->showTalkPage = false;
     } else {
         $this->showTalkPage = true;
     }
     wfProfileOut(__METHOD__);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:13,代码来源:WallRailController.class.php

示例12: getContent

 public function getContent($processingTimeStart = null)
 {
     global $IP, $wgEnableSASSSourceMaps;
     wfProfileIn(__METHOD__);
     $processingTimeStart = null;
     if ($this->mForceProfile) {
         $processingTimeStart = microtime(true);
     }
     $memc = F::App()->wg->Memc;
     $this->mContent = null;
     $content = null;
     $sassService = null;
     $hasErrors = false;
     try {
         $sassService = SassService::newFromFile("{$IP}/{$this->mOid}");
         $sassService->setSassVariables($this->mParams);
         $sassService->enableSourceMaps(!empty($wgEnableSASSSourceMaps));
         $sassService->setFilters(SassService::FILTER_IMPORT_CSS | SassService::FILTER_CDN_REWRITE | SassService::FILTER_BASE64 | SassService::FILTER_JANUS);
         $cacheId = __CLASS__ . "-minified-" . $sassService->getCacheKey();
         $content = $memc->get($cacheId);
     } catch (Exception $e) {
         $content = "/* {$e->getMessage()} */";
         $hasErrors = true;
     }
     if ($content) {
         $this->mContent = $content;
     } else {
         // todo: add extra logging of AM request in case of any error
         try {
             $this->mContent = $sassService->getCss(false);
         } catch (Exception $e) {
             $this->mContent = $this->makeComment($e->getMessage());
             $hasErrors = true;
         }
         // This is the final pass on contents which, among other things, performs minification
         parent::getContent($processingTimeStart);
         // Prevent cache poisoning if we are serving sass from preview server
         if (!empty($cacheId) && getHostPrefix() == null && !$this->mForceProfile && !$hasErrors) {
             $memc->set($cacheId, $this->mContent, WikiaResponse::CACHE_STANDARD);
         }
     }
     if ($hasErrors) {
         wfProfileOut(__METHOD__);
         throw new Exception($this->mContent);
     }
     wfProfileOut(__METHOD__);
     return $this->mContent;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:48,代码来源:AssetsManagerSassBuilder.class.php

示例13: onGetRailModuleList

 /**
  * Insert the VideosModule on to the right rail
  * @param array $modules
  * @return bool
  */
 public static function onGetRailModuleList(&$modules)
 {
     wfProfileIn(__METHOD__);
     // Check if we're on a page where we want to show the Videos Module.
     // If we're not, stop right here.
     if (!self::canShowVideosModule()) {
         wfProfileOut(__METHOD__);
         return true;
     }
     // Use a different position depending on whether the user is logged in
     $app = F::App();
     $pos = $app->wg->User->isAnon() ? 1305 : 1285;
     $modules[$pos] = array('VideosModule', 'index', null);
     wfProfileOut(__METHOD__);
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:21,代码来源:VideosModuleHooks.class.php

示例14: __construct

 public function __construct($wikiId, $userIdRemoving, $userIdWallOwner, $title, $url, $messageId, $parentId, $isReply, $reason)
 {
     $app = F::App();
     $this->data = null;
     $this->data->type = 'OWNER';
     $this->data->wiki_id = $wikiId;
     $this->data->timestamp = $app->wf->TimestampNow();
     $this->data->url = $url;
     $this->data->title = $title;
     $this->data->user_removing_id = $userIdRemoving;
     $this->data->user_wallowner_id = $userIdWallOwner;
     $this->data->message_id = $messageId;
     $this->data->is_reply = $isReply;
     $this->data->hide_for_userid = array($userIdRemoving, $userIdWallOwner);
     $this->data->parent_id = $parentId;
     $this->data->reason = $reason;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:17,代码来源:WallNotificationOwnerEntity.class.php

示例15: onPersonalUrls

 /**
  * @brief Add notification dropdown to right corner for monobook
  *
  * @return true
  *
  * @author Tomasz Odrobny
  * @author Piotrek Bablok
  */
 public function onPersonalUrls(&$personalUrls, &$title)
 {
     $app = F::App();
     $user = $app->wg->User;
     if ($user instanceof User && $user->isLoggedIn()) {
         if ($app->wg->User->getSkin()->getSkinName() == 'monobook') {
             $personalUrls['wall-notifications'] = array('text' => $app->wf->Msg('wall-notifications'), 'href' => '#', 'class' => 'wall-notifications-monobook ', 'active' => false);
             /** 
              * none of the Wall "base" extension is enable so we are pre hide the notification drop down 
              * and we show it in java script when there are new notification 
              */
             if (empty($app->wg->EnableWallExt) && empty($app->wg->EnableForumExt)) {
                 $personalUrls['wall-notifications']['class'] .= 'prehide';
             }
             $app->wg->Out->addStyle("{$app->wg->ExtensionsPath}/wikia/Wall/css/WallNotificationsMonobook.css");
         }
     }
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:27,代码来源:WallNotificationsHooksHelper.class.php


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