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


PHP Piwik::exitWithErrorMessage方法代码示例

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


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

示例1: dispatch

	function dispatch($notification = null)
	{
		if($notification)
		{
			$exception = $notification->getNotificationObject();
			$message = $exception->getMessage();
		}
		else
		{
			$message = '';
		}

		Piwik_Translate::getInstance()->loadCoreTranslation();

		Piwik_PostEvent('Installation.startInstallation', $this);

		$step = Piwik_Common::getRequestVar('action', 'welcome', 'string');
		$controller = $this->getInstallationController();
		if(in_array($step, array_keys($controller->getInstallationSteps())) || $step == 'saveLanguage')
		{
			$controller->$step($message);
		}
		else
		{
			Piwik::exitWithErrorMessage(Piwik_Translate('Installation_NoConfigFound'));
		}

		exit;
	}	
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:29,代码来源:Installation.php

示例2: startInstallation

 function startInstallation()
 {
     Piwik_PostEvent('Installation.startInstallation', $this);
     $step = Piwik_Common::getRequestVar('action', 'welcome', 'string');
     $controller = $this->getInstallationController();
     if (in_array($step, $controller->getInstallationSteps())) {
         $controller->{$step}();
     } else {
         Piwik::exitWithErrorMessage(Piwik_Translate('Installation_NoConfigFound'));
     }
     exit;
 }
开发者ID:klando,项目名称:pgpiwik,代码行数:12,代码来源:Installation.php

示例3: dispatch

 function dispatch()
 {
     Piwik_Translate::getInstance()->loadUserTranslation();
     Piwik_PostEvent('Installation.startInstallation', $this);
     $step = Piwik_Common::getRequestVar('action', 'welcome', 'string');
     $controller = $this->getInstallationController();
     if (in_array($step, array_keys($controller->getInstallationSteps())) || $step == 'saveLanguage') {
         $controller->{$step}();
     } else {
         Piwik::exitWithErrorMessage(Piwik_Translate('Installation_NoConfigFound'));
     }
     exit;
 }
开发者ID:ntulip,项目名称:piwik,代码行数:13,代码来源:Installation.php

示例4: Piwik_ExceptionHandler

/**
 * Exception handler used to display nicely exceptions in Piwik
 * 
 * @param Exception $exception
 */
function Piwik_ExceptionHandler(Exception $exception)
{
    try {
        Zend_Registry::get('logger_exception')->logEvent($exception);
    } catch (Exception $e) {
        // case when the exception is raised before the logger being ready
        // we handle the exception a la mano, but using the Logger formatting properties
        $event = array();
        $event['errno'] = $exception->getCode();
        $event['message'] = $exception->getMessage();
        $event['errfile'] = $exception->getFile();
        $event['errline'] = $exception->getLine();
        $event['backtrace'] = $exception->getTraceAsString();
        $formatter = new Piwik_Log_Exception_Formatter_ScreenFormatter();
        $message = $formatter->format($event);
        $message .= "<br><br>And this exception raised another exception \"" . $e->getMessage() . "\"";
        Piwik::exitWithErrorMessage($message);
    }
}
开发者ID:Doluci,项目名称:tomatocart,代码行数:24,代码来源:ExceptionHandler.php

示例5: 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(Piwik_Config::getDefaultUserConfigPath()))
			{
				$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_Login_Controller::clearSession();
			$message = Piwik_Translate('Installation_ErrorInvalidState',
						array( '<br /><b>',
								'</b>',
								'<a href=\''.Piwik_Common::sanitizeInputValue(Piwik_Url::getCurrentUrlWithoutFileName()).'\'>',
								'</a>')
					);
			Piwik::exitWithErrorMessage( $message );
		}
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:53,代码来源:Controller.php

示例6: 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)
  */
 protected function checkPreviousStepIsValid($currentStep)
 {
     $error = false;
     // first we make sure that the config file is not present, ie. Installation state is expected
     try {
         $config = new Piwik_Config();
         $config->init();
         $error = true;
     } catch (Exception $e) {
     }
     if (empty($this->session->currentStepDone)) {
         $error = true;
     } else {
         // the currentStep
         $currentStepId = array_search($currentStep, $this->steps);
         // the step before
         $previousStepId = array_search($this->session->currentStepDone, $this->steps);
         // not OK if currentStepId > previous+1
         if ($currentStepId > $previousStepId + 1) {
             $error = true;
         }
     }
     if ($error) {
         $message = Piwik_Translate('Installation_ErrorInvalidState', array('<br /><b>', '</b>', '<a href=\'' . Piwik_Url::getCurrentUrlWithoutFileName() . '\'>', '</a>'));
         Piwik::exitWithErrorMessage($message);
     }
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:32,代码来源:Controller.php


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