本文整理汇总了PHP中Piwik_FrontController::shouldRethrowException方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_FrontController::shouldRethrowException方法的具体用法?PHP Piwik_FrontController::shouldRethrowException怎么用?PHP Piwik_FrontController::shouldRethrowException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_FrontController
的用法示例。
在下文中一共展示了Piwik_FrontController::shouldRethrowException方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dispatch
function dispatch()
{
$module = Piwik_Common::getRequestVar('module', '', 'string');
$updater = new Piwik_Updater();
$updater->addComponentToCheck('core', Piwik_Version::VERSION);
$updates = $updater->getComponentsWithNewVersion();
if (!empty($updates)) {
Piwik::deleteAllCacheOnUpdate();
}
if (self::getComponentUpdates($updater) !== null && $module != 'CoreUpdater' && $module != 'Proxy') {
if (Piwik_FrontController::shouldRethrowException()) {
throw new Exception("Piwik and/or some plugins have been upgraded to a new version. Please run the update process first. See documentation: http://piwik.org/docs/update/");
} else {
Piwik::redirectToModule('CoreUpdater');
}
}
}
示例2: 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) {
if (Piwik_FrontController::shouldRethrowException()) {
throw $exception;
}
// 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);
}
}