public static function deinit() { if (Kohana::$_init) { spl_autoload_unregister(array('Kohana', 'auto_load')); if (Kohana::$errors) { restore_error_handler(); restore_exception_handler(); } Kohana::$log = NULL; Kohana::$_modules = array(); Kohana::$_paths = array(APPPATH, SYSPATH); Kohana::$_init = FALSE; } }
/** * Cleans up the environment: * * - Restore the previous error and exception handlers * - Destroy the Kohana::$log and Kohana::$config objects * * @return void */ public static function deinit() { if (Kohana::$_init) { // Removed the autoloader spl_autoload_unregister(array('Kohana', 'auto_load')); if (Kohana::$errors) { // Go back to the previous error handler restore_error_handler(); // Go back to the previous exception handler restore_exception_handler(); } // Destroy objects created by init Kohana::$log = Kohana::$config = NULL; // Reset internal storage Kohana::$_modules = Kohana::$_files = array(); Kohana::$_paths = array(APPPATH, SYSPATH); // Reset file cache status Kohana::$_files_changed = FALSE; // Kohana is no longer initialized Kohana::$_init = FALSE; } }