/** * Cleans up the environment: * * - Restore the previous error and exception handlers * - Destroy the self::$log and self::$config objects * * @return void */ public static function deinit() { if (self::$_init) { // Removed the autoloader spl_autoload_unregister(array('KoJo', 'auto_load')); if (self::$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 self::$log = self::$config = NULL; // Reset internal storage self::$_modules = self::$_files = array(); self::$_paths = array(APPPATH, SYSPATH); // Reset file cache status self::$_files_changed = FALSE; // Kohana is no longer initialized self::$_init = FALSE; } }