Changeset 3386
- Timestamp:
- 08/29/2008 09:49:20 AM (3 months ago)
- Location:
- trunk/system
- Files:
-
- 2 modified
-
bootstrap.php (modified) (4 diffs)
-
classes/kohana.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/bootstrap.php
r3366 r3386 14 14 define('KOHANA_CODENAME', 'kernachtig'); 15 15 16 // Test of Kohana is running in Windows17 define('KOHANA_IS_WIN', PHP_SHLIB_SUFFIX === 'dll');18 19 16 // Kohana benchmarks are prefixed to prevent collisions 20 17 define('SYSTEM_BENCHMARK', 'system_benchmark'); … … 26 23 Benchmark::start(SYSTEM_BENCHMARK.'_total_execution'); 27 24 28 // Start kohana_loading 29 Benchmark::start(SYSTEM_BENCHMARK.'_kohana_loading'); 25 // Start environment_test 26 Benchmark::start(SYSTEM_BENCHMARK.'_environment_test'); 27 28 // Test of Kohana is running in Windows 29 define('KOHANA_IS_WIN', PHP_SHLIB_SUFFIX === 'dll'); 30 30 31 31 // Check UTF-8 support … … 79 79 } 80 80 81 // Stop environment_test 82 Benchmark::stop(SYSTEM_BENCHMARK.'_environment_test'); 83 84 // Start system_initialization 85 Benchmark::start(SYSTEM_BENCHMARK.'_system_initialization'); 86 81 87 // Load utf8 support 82 88 require SYSPATH.'classes/utf8'.EXT; 89 90 // Load Event support 91 require SYSPATH.'classes/event'.EXT; 92 93 // Load Kohana core 94 require SYSPATH.'classes/kohana'.EXT; 95 96 // Start utf8_conversion 97 Benchmark::start(SYSTEM_BENCHMARK.'_utf8_conversion'); 83 98 84 99 // Convert all global variables to UTF-8. … … 94 109 } 95 110 96 // Load Event support 97 require SYSPATH.'classes/event'.EXT; 98 99 // Load Kohana core 100 require SYSPATH.'classes/kohana'.EXT; 111 // Stop utf8_conversion 112 Benchmark::stop(SYSTEM_BENCHMARK.'_utf8_conversion'); 101 113 102 114 // Prepare the environment 103 115 Kohana::setup(); 104 105 // End kohana_loading106 Benchmark::stop(SYSTEM_BENCHMARK.'_kohana_loading');107 108 // Start system_initialization109 Benchmark::start(SYSTEM_BENCHMARK.'_system_initialization');110 116 111 117 // Prepare the system -
trunk/system/classes/kohana.php
r3367 r3386 77 77 return; 78 78 79 // Start the environment setup benchmark80 Benchmark::start(SYSTEM_BENCHMARK.'_environment_setup');81 82 79 // Define Kohana error constant 83 80 define('E_KOHANA', 42); … … 102 99 } 103 100 104 // Disable notices and "strict" errors 105 $ER = error_reporting(~E_NOTICE & ~E_STRICT); 101 // Send default text/html UTF-8 header 102 header('Content-Type: text/html; charset=UTF-8'); 103 104 // Enable exception handling 105 Kohana_Exception::enable(); 106 107 // Enable error handling 108 Kohana_PHP_Exception::enable(); 109 110 if (self::$configuration['core']['log_threshold'] > 0) 111 { 112 // Set the log directory 113 self::log_directory(self::$configuration['core']['log_directory']); 114 115 // Enable log writing at shutdown 116 register_shutdown_function(array(__CLASS__, 'log_save')); 117 } 106 118 107 119 // Set the user agent 108 120 self::$user_agent = trim($_SERVER['HTTP_USER_AGENT']); 109 121 110 if (function_exists('date_default_timezone_set')) 111 { 112 $timezone = Kohana::config('locale.timezone'); 113 114 // Set default timezone, due to increased validation of date settings 115 // which cause massive amounts of E_NOTICEs to be generated in PHP 5.2+ 116 date_default_timezone_set(empty($timezone) ? date_default_timezone_get() : $timezone); 117 } 118 119 // Restore error reporting 120 error_reporting($ER); 122 if ( ! ($timezone = Kohana::config('locale.timezone'))) 123 { 124 // Disable notices and "strict" errors, due to the E_NOTICE that 125 // will be generated in PHP 5.2+ 126 $ER = error_reporting(~E_NOTICE & ~E_STRICT); 127 128 // Get the default timezone 129 $timezone = date_default_timezone_get(); 130 131 // Restore error reporting 132 error_reporting($ER); 133 } 134 135 // Set the default timezone 136 date_default_timezone_set($timezone); 121 137 122 138 // Start output buffering … … 126 142 self::$buffer_level = ob_get_level(); 127 143 128 // Send default text/html UTF-8 header129 header('Content-Type: text/html; charset=UTF-8');130 131 144 // Set autoloader 132 145 spl_autoload_register(array('Kohana', 'auto_load')); 133 134 // Enable exception handling135 Kohana_Exception::enable();136 137 // Enable error handling138 Kohana_PHP_Exception::enable();139 140 if (self::$configuration['core']['log_threshold'] > 0)141 {142 // Set the log directory143 self::log_directory(self::$configuration['core']['log_directory']);144 145 // Enable log writing at shutdown146 register_shutdown_function(array(__CLASS__, 'log_save'));147 }148 146 149 147 // Load locales … … 171 169 if ($config = Kohana::config('core.enable_hooks')) 172 170 { 171 // Start the loading_hooks routine 172 Benchmark::start(SYSTEM_BENCHMARK.'_loading_hooks'); 173 173 174 $hooks = array(); 174 175 … … 213 214 } 214 215 } 216 217 // Stop the loading_hooks routine 218 Benchmark::stop(SYSTEM_BENCHMARK.'_loading_hooks'); 215 219 } 216 220 217 221 // Setup is complete, prevent it from being run again 218 222 $run = TRUE; 219 220 // Stop the environment setup routine221 Benchmark::stop(SYSTEM_BENCHMARK.'_environment_setup');222 223 } 223 224
