當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Piwik::exitWithErrorMessage方法代碼示例

本文整理匯總了PHP中Piwik\Piwik::exitWithErrorMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Piwik::exitWithErrorMessage方法的具體用法?PHP Piwik::exitWithErrorMessage怎麽用?PHP Piwik::exitWithErrorMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Piwik\Piwik的用法示例。


在下文中一共展示了Piwik::exitWithErrorMessage方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

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

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

示例3: checkPiwikIsNotInstalled

 private function checkPiwikIsNotInstalled()
 {
     if (!SettingsPiwik::isPiwikInstalled()) {
         return;
     }
     \Piwik\Plugins\Login\Controller::clearSession();
     $message = Piwik::translate('Installation_InvalidStateError', array('<br /><strong>', '</strong>', '<a href=\'' . Common::sanitizeInputValue(Url::getCurrentUrlWithoutFileName()) . '\'>', '</a>'));
     Piwik::exitWithErrorMessage($message);
 }
開發者ID:brienomatty,項目名稱:elmsln,代碼行數:9,代碼來源:Controller.php

示例4: checkPreviousStepIsValid

 /**
  * The previous step is valid if it is either
  * - any step before (OK to go back)
  * - the current step (case when validating a form)
  * If step is invalid, then exit.
  *
  * @param string $currentStep Current step
  */
 protected function checkPreviousStepIsValid($currentStep)
 {
     $error = false;
     if (empty($this->session->currentStepDone)) {
         $error = true;
     } else {
         if ($currentStep == 'finished' && $this->session->currentStepDone == 'finished') {
             // ok to refresh this page or use language selector
         } else {
             if (file_exists(Config::getLocalConfigPath())) {
                 $error = true;
             }
             $steps = array_keys($this->steps);
             // the currentStep
             $currentStepId = array_search($currentStep, $steps);
             // the step before
             $previousStepId = array_search($this->session->currentStepDone, $steps);
             // not OK if currentStepId > previous+1
             if ($currentStepId > $previousStepId + 1) {
                 $error = true;
             }
         }
     }
     if ($error) {
         \Piwik\Plugins\Login\Controller::clearSession();
         $message = Piwik::translate('Installation_ErrorInvalidState', array('<br /><strong>', '</strong>', '<a href=\'' . Common::sanitizeInputValue(Url::getCurrentUrlWithoutFileName()) . '\'>', '</a>'));
         Piwik::exitWithErrorMessage($message);
     }
 }
開發者ID:KiwiJuicer,項目名稱:handball-dachau,代碼行數:37,代碼來源:Controller.php


注:本文中的Piwik\Piwik::exitWithErrorMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。