diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-05-28 21:42:18 -0700 | 
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-28 21:42:18 -0700 | 
| commit | 0097803efc1c71711bf9ccf5015fe43e75f8f28d (patch) | |
| tree | b48e0013b55601d4d856350a3213880a424911ea /system | |
| parent | f56e095aeb6e5544360136a48373300f3cecb715 (diff) | |
| parent | 356bac0db0dca5d2b8102b31b6c6b9509f595c29 (diff) | |
Merge branch 'master' of git://github.com/gallery/gallery3
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; | 
