本文整理匯總了PHP中Kohana_Exception::disable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kohana_Exception::disable方法的具體用法?PHP Kohana_Exception::disable怎麽用?PHP Kohana_Exception::disable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Kohana_Exception
的用法示例。
在下文中一共展示了Kohana_Exception::disable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: cleanup
/**
* Cleans up the PHP environment. Disables error/exception handling and the
* auto-loading method and closes the output buffer.
*
* This method does not need to be called during normal system execution,
* however in some advanced situations it can be helpful. @see #1781
*
* @return void
*/
public static function cleanup()
{
static $run;
// Only run this function once
if ($run === TRUE) {
return;
}
$run = TRUE;
Kohana_Exception::disable();
Kohana_PHP_Exception::disable();
spl_autoload_unregister(array('Kohana', 'auto_load'));
Kohana::close_buffers();
}
示例2: defined
<?php
defined('SYSPATH') or die('No direct access allowed.');
if (class_exists('PHPUnit_Util_Filter')) {
// Hand control of errors and exceptions to PHPUnit
if (defined('Kohana::VERSION')) {
Kohana_Exception::disable();
Kohana_PHP_Exception::disable();
} else {
restore_exception_handler();
restore_error_handler();
}
Event::clear('system.ready');
Event::clear('system.routing');
Event::clear('system.execute');
}