diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-05-28 17:42:06 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-28 17:42:06 -0700 |
commit | d8f2c9f9f71ce0850e8f33ba96950d3ff72fabde (patch) | |
tree | e26321ae2f603e17a4230d28ba183d8a501e6c70 /system | |
parent | 1a095fffe50437dbe7814c52886a58b6309ce8eb (diff) |
Revert "Change Kohana::include_path() to put APPPATH (core) at the end of the"
This reverts commit 7e3705540875ac30e9610c5a608fe74399afd2b0.
No longer necessary now that we're putting all the code into
modules/gallery, which we can force to be at the end of the module
path.
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Kohana.php | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/system/core/Kohana.php b/system/core/Kohana.php index ac64b5b8..95e44d82 100644 --- a/system/core/Kohana.php +++ b/system/core/Kohana.php @@ -298,7 +298,8 @@ final class Kohana { { if ($process === TRUE) { - self::$include_paths = array(); + // Add APPPATH as the first path + self::$include_paths = array(APPPATH); foreach (self::$configuration['core']['modules'] as $path) { @@ -309,9 +310,6 @@ final class Kohana { } } - // Add APPPATH after all modules - self::$include_paths[] = APPPATH; - // Add SYSPATH as the last path self::$include_paths[] = SYSPATH; } @@ -813,14 +811,14 @@ final class Kohana { { // PHP errors have 5 args, always $PHP_ERROR = (func_num_args() === 5); - + // Test to see if errors should be displayed if ($PHP_ERROR AND (error_reporting() & $exception) === 0) return; - + // This is useful for hooks to determine if a page has an error self::$has_error = TRUE; - + // Error handling will use exactly 5 args, every time if ($PHP_ERROR) { @@ -837,11 +835,11 @@ final class Kohana { $line = $exception->getLine(); $template = ($exception instanceof Kohana_Exception) ? $exception->getTemplate() : 'kohana_error_page'; } - + if (is_numeric($code)) { $codes = self::lang('errors'); - + if ( ! empty($codes[$code])) { list($level, $error, $description) = $codes[$code]; @@ -860,22 +858,22 @@ final class Kohana { $error = $code; $description = ''; } - + // Remove the DOCROOT from the path, as a security precaution $file = str_replace('\\', '/', realpath($file)); $file = preg_replace('|^'.preg_quote(DOCROOT).'|', '', $file); - + if ($level <= self::$configuration['core']['log_threshold']) { // Log the error self::log('error', self::lang('core.uncaught_exception', $type, $message, $file, $line)); } - + if ($PHP_ERROR) { $description = self::lang('errors.'.E_RECOVERABLE_ERROR); $description = is_array($description) ? $description[2] : ''; - + if ( ! headers_sent()) { // Send the 500 header @@ -890,13 +888,13 @@ final class Kohana { $exception->sendHeaders(); } } - + while (ob_get_level() > self::$buffer_level) { // Close open buffers ob_end_clean(); } - + // Test if display_errors is on if (self::$configuration['core']['display_errors'] === TRUE) { @@ -904,11 +902,11 @@ final class Kohana { { // Remove the first entry of debug_backtrace(), it is the exception_handler call $trace = $PHP_ERROR ? array_slice(debug_backtrace(), 1) : $exception->getTrace(); - + // Beautify backtrace $trace = self::backtrace($trace); } - + // Load the error require self::find_file('views', empty($template) ? 'kohana_error_page' : $template); } @@ -917,17 +915,17 @@ final class Kohana { // Get the i18n messages $error = self::lang('core.generic_error'); $message = self::lang('core.errors_disabled', url::site(), url::site(Router::$current_uri)); - + // Load the errors_disabled view require self::find_file('views', 'kohana_error_disabled'); } - + if ( ! Event::has_run('system.shutdown')) { // Run the shutdown even to ensure a clean exit Event::run('system.shutdown'); } - + // Turn off error reporting error_reporting(0); exit; |