public static function run() { !defined('DS') && define('DS', DIRECTORY_SEPARATOR); spl_autoload_register(array('auto', 'autoload')); register_shutdown_function(array('auto', 'shutdownCall'), array()); if (self::$_hasRun) { throw new exception_base('auto can not run twice!', exception_base::type_autophp_has_run); } self::$_hasRun = true; if (php_sapi_name() == 'cli') { self::$_isCliMode = true; } if (get_magic_quotes_gpc()) { throw new exception_base('magic quotes should be turned off~ ', exception_base::type_magic_quotes_on); } if (!defined('APP_PATH')) { throw exception_base('APP_PATH not defined!', exception_base::type_app_path_not_defined); } if (!defined('AUTOPHP_PATH')) { throw exception_base('AUTOPHP_PATH not defined!', exception_base::type_autophp_path_not_defined); } self::$runtimeStart = microtime(true); }