本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}
}