/** * 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. */ public static function cleanup() { static $run; // Only run this function once if ($run === TRUE) { return; } $run = TRUE; // Using Eight Errors? Disable them since we're finished. if (Eight::$errors === TRUE) { Eight_Exception::disable(); Eight_Exception_PHP::disable(); } spl_autoload_unregister(array('Eight', 'auto_load')); Eight::close_buffers(); }