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


PHP Piwik\FrontController类代码示例

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


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

示例1: dispatch

 public function dispatch()
 {
     $module = Common::getRequestVar('module', '', 'string');
     $action = Common::getRequestVar('action', '', 'string');
     if ($module == 'CoreUpdater' || $module == 'Proxy' || $module == 'Installation' || $module == 'LanguagesManager' && $action == 'saveLanguage') {
         return;
     }
     $updater = new PiwikCoreUpdater();
     $updates = $updater->getComponentsWithNewVersion(array('core' => Version::VERSION));
     if (!empty($updates)) {
         Filesystem::deleteAllCacheOnUpdate();
     }
     if ($updater->getComponentUpdates() !== null) {
         if (FrontController::shouldRethrowException()) {
             throw new Exception("Piwik and/or some plugins have been upgraded to a new version. \n" . "--> Please run the update process first. See documentation: http://piwik.org/docs/update/ \n");
         } elseif ($module === 'API') {
             $outputFormat = strtolower(Common::getRequestVar('format', 'xml', 'string', $_GET + $_POST));
             $response = new ResponseBuilder($outputFormat);
             $e = new Exception('Database Upgrade Required. Your Piwik database is out-of-date, and must be upgraded before you can continue.');
             echo $response->getResponseException($e);
             Common::sendResponseCode(503);
             exit;
         } else {
             Piwik::redirectToModule('CoreUpdater');
         }
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:27,代码来源:CoreUpdater.php

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: init

 private function init()
 {
     $this->handleFatalErrors();
     \Piwik\FrontController::createConfigObject();
     if ($this->isDebugModeEnabled()) {
         ErrorHandler::registerErrorHandler();
         ExceptionHandler::setUp();
         Common::printDebug("Debug enabled - Input parameters: ");
         Common::printDebug(var_export($_GET, true));
     }
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:11,代码来源:Tracker.php

示例11: 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

示例12: _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

示例13: 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

示例14: 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

示例15: 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


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