本文整理匯總了PHP中Kohana_Exception::handle方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kohana_Exception::handle方法的具體用法?PHP Kohana_Exception::handle怎麽用?PHP Kohana_Exception::handle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Kohana_Exception
的用法示例。
在下文中一共展示了Kohana_Exception::handle方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: shutdown_handler
/**
* Catches errors that are not caught by the error handler, such as E_PARSE.
*
* @uses Kohana_Exception::handle()
* @return void
*/
public static function shutdown_handler()
{
if (Kohana_PHP_Exception::$enabled and $error = error_get_last() and error_reporting() & $error['type']) {
// Fake an exception for nice debugging
Kohana_Exception::handle(new Kohana_PHP_Exception($error['type'], $error['message'], $error['file'], $error['line']));
}
}
示例2: __toString
/**
* Magically converts mod view object to string.
*
* @return string
*/
public function __toString()
{
try {
return $this->render(false, array($this, 'wrap'));
} catch (Exception $e) {
Kohana_Exception::handle($e);
return '';
}
}
示例3: __toString
/**
* Magically converts view object to string.
*
* @return string
*/
public function __toString()
{
try {
return $this->render();
} catch (Exception $e) {
Kohana_Exception::handle($e);
return (string) '';
}
}