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


PHP FrontController::getInstance方法代码示例

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


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

示例1: footerUserCountry

    public static function footerUserCountry(&$out)
    {
        $out = '<div>
			<h2>' . Piwik::translate('Provider_WidgetProviders') . '</h2>';
        $out .= FrontController::getInstance()->fetchDispatch('Provider', 'getProvider');
        $out .= '</div>';
    }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:7,代码来源:Provider.php

示例2: execute

 /**
  * Execute command like: ./console core:run-scheduled-tasks
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->forceRunAllTasksIfRequested($input);
     FrontController::getInstance()->init();
     API::getInstance()->runScheduledTasks();
     $this->writeSuccessMessage($output, array('Scheduled Tasks executed'));
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:10,代码来源:RunScheduledTasks.php

示例3: footerVisitsFrequency

    public static function footerVisitsFrequency(&$out)
    {
        $out = '</div>
			<div id="rightcolumn">
			';
        $out .= FrontController::getInstance()->fetchDispatch('VisitorInterest', 'index');
        $out .= '</div>';
    }
开发者ID:brienomatty,项目名称:elmsln,代码行数:8,代码来源:VisitorInterest.php

示例4: noAccess

 /**
  * Redirects to Login form with error message.
  * Listens to User.isNotAuthorized hook.
  */
 public function noAccess(Exception $exception)
 {
     $frontController = FrontController::getInstance();
     if (Common::isXmlHttpRequest()) {
         echo $frontController->dispatch('Login', 'ajaxNoAccess', array($exception->getMessage()));
         return;
     }
     echo $frontController->dispatch('Login', 'login', array($exception->getMessage()));
 }
开发者ID:CaptainSharf,项目名称:SSAD_Project,代码行数:13,代码来源:Login.php

示例5: testWhenRssFormatGetOneDoesNotError

 /**
  * Testing that getOne does not error out when format=rss, #10407
  *
  * @group Plugins
  */
 public function testWhenRssFormatGetOneDoesNotError()
 {
     $_GET = array('method' => 'MultiSites.getOne', 'idSite' => $this->idSiteAccess, 'period' => 'month', 'date' => 'last10', 'format' => 'rss');
     $output = FrontController::getInstance()->fetchDispatch('API');
     $this->assertContains('<item>', $output);
     $this->assertContains('</rss>', $output);
     $this->assertNotContains('error', $output);
     $_GET = array();
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:14,代码来源:MultiSitesTest.php

示例6: getEcommerceLog

 public function getEcommerceLog($fetch = false)
 {
     $saveGET = $_GET;
     $_GET['segment'] = urlencode('visitEcommerceStatus!=none');
     $_GET['widget'] = 1;
     $output = FrontController::getInstance()->dispatch('Live', 'getVisitorLog', array($fetch));
     $_GET = $saveGET;
     return $output;
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:9,代码来源:Controller.php

示例7: requestGetAllWithGroups

 private function requestGetAllWithGroups($params)
 {
     $oldGet = $_GET;
     $params['period'] = 'day';
     $params['date'] = '2013-01-23';
     $_GET = $params;
     $sites = FrontController::getInstance()->dispatch('MultiSites', 'getAllWithGroups');
     $_GET = $oldGet;
     return $sites;
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:10,代码来源:ControllerTest.php

示例8: execute

 /**
  * Execute command like: ./console core:run-scheduled-tasks
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->forceRunAllTasksIfRequested($input);
     FrontController::getInstance()->init();
     $scheduledTasksResults = API::getInstance()->runScheduledTasks();
     foreach ($scheduledTasksResults as $scheduledTasksResult) {
         $output->writeln(sprintf('<comment>%s</comment> - %s', $scheduledTasksResult['task'], $scheduledTasksResult['output']));
     }
     $this->writeSuccessMessage($output, array('Scheduled Tasks executed'));
 }
开发者ID:TensorWrenchOSS,项目名称:piwik,代码行数:13,代码来源:RunScheduledTasks.php

示例9: _getDashboardView

 protected function _getDashboardView($template)
 {
     $view = new View($template);
     $this->setGeneralVariablesView($view);
     $view->availableWidgets = Common::json_encode(WidgetsList::get());
     $view->availableLayouts = $this->getAvailableLayouts();
     $view->dashboardId = Common::getRequestVar('idDashboard', 1, 'int');
     // get the layout via FrontController so controller events are posted
     $view->dashboardLayout = FrontController::getInstance()->dispatch('Dashboard', 'getDashboardLayout', array($checkToken = false));
     return $view;
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:11,代码来源:Controller.php

示例10: showInContext

 public function showInContext()
 {
     $controllerName = Common::getRequestVar('moduleToLoad');
     $actionName = Common::getRequestVar('actionToLoad', 'index');
     if ($actionName == 'showInContext') {
         throw new Exception("Preventing infinite recursion...");
     }
     $view = $this->getDefaultIndexView();
     $view->content = FrontController::getInstance()->fetchDispatch($controllerName, $actionName);
     return $view->render();
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:11,代码来源:Controller.php

示例11: generateSafeModeOutput

 /**
  * @param $lastError
  * @return mixed|void
  * @throws AuthenticationFailedException
  * @throws Exception
  */
 private static function generateSafeModeOutput($lastError)
 {
     Common::sendResponseCode(500);
     $controller = FrontController::getInstance();
     try {
         $controller->init();
         $message = $controller->dispatch('CorePluginsAdmin', 'safemode', array($lastError));
     } catch (Exception $e) {
         // may fail in safe mode (eg. global.ini.php not found)
         $message = sprintf("Piwik encoutered an error: %s (which lead to: %s)", $lastError['message'], $e->getMessage());
     }
     return $message;
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:19,代码来源:FrontController.php

示例12: execute

 /**
  * Execute command like: ./console core:run-scheduled-tasks
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->forceRunAllTasksIfRequested($input);
     FrontController::getInstance()->init();
     // TODO use dependency injection
     /** @var Scheduler $scheduler */
     $scheduler = StaticContainer::get('Piwik\\Scheduler\\Scheduler');
     $task = $input->getArgument('task');
     if ($task) {
         $this->runSingleTask($scheduler, $task, $output);
     } else {
         $scheduler->run();
     }
     $this->writeSuccessMessage($output, array('Scheduled Tasks executed'));
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:18,代码来源:RunScheduledTasks.php

示例13: dispatch

 /**
  * @param \Exception|null $exception
  */
 public function dispatch($exception = null)
 {
     if ($exception) {
         $message = $exception->getMessage();
     } else {
         $message = '';
     }
     $action = Common::getRequestVar('action', 'welcome', 'string');
     if ($this->isAllowedAction($action)) {
         echo FrontController::getInstance()->dispatch('Installation', $action, array($message));
     } else {
         Piwik::exitWithErrorMessage(Piwik::translate('Installation_NoConfigFound'));
     }
     exit;
 }
开发者ID:cemo,项目名称:piwik,代码行数:18,代码来源:Installation.php

示例14: iframe

 public function iframe()
 {
     Request::reloadAuthUsingTokenAuth();
     $this->init();
     $controllerName = Common::getRequestVar('moduleToWidgetize');
     $actionName = Common::getRequestVar('actionToWidgetize');
     if ($controllerName == 'Dashboard' && $actionName == 'index') {
         $view = new View('@Widgetize/iframe_empty');
     } else {
         $view = new View('@Widgetize/iframe');
     }
     $this->setGeneralVariablesView($view);
     $view->setXFrameOptions('allow');
     $view->content = FrontController::getInstance()->fetchDispatch($controllerName, $actionName);
     return $view->render();
 }
开发者ID:a4tunado,项目名称:piwik,代码行数:16,代码来源:Controller.php

示例15: dispatch

 /**
  * @param \Exception|null $exception
  */
 public function dispatch($exception = null)
 {
     if ($exception) {
         $message = $exception->getMessage();
     } else {
         $message = '';
     }
     Translate::loadCoreTranslation();
     $step = Common::getRequestVar('action', 'welcome', 'string');
     $controller = $this->getInstallationController();
     $isActionWhiteListed = in_array($step, array('saveLanguage', 'getBaseCss'));
     if (in_array($step, array_keys($controller->getInstallationSteps())) || $isActionWhiteListed) {
         echo FrontController::getInstance()->dispatch('Installation', $step, array($message));
     } else {
         Piwik::exitWithErrorMessage(Piwik::translate('Installation_NoConfigFound'));
     }
     exit;
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:21,代码来源:Installation.php


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