Commit 8341797b by Taylor Otwell

cleaning up the bootstrap file.

parent eb193c1d
...@@ -25,10 +25,8 @@ set_exception_handler(function($e) ...@@ -25,10 +25,8 @@ set_exception_handler(function($e)
/** /**
* Register the PHP error handler. All PHP errors will fall into this * Register the PHP error handler. All PHP errors will fall into this
* handler, which will convert the error into an ErrorException object * handler which will convert the error into an ErrorException object
* and pass the exception into the common exception handler. Suppressed * and pass the exception into the exception handler.
* errors are ignored and errors in the developer configured whitelist
* are silently logged.
*/ */
set_error_handler(function($code, $error, $file, $line) set_error_handler(function($code, $error, $file, $line)
{ {
...@@ -36,9 +34,9 @@ set_error_handler(function($code, $error, $file, $line) ...@@ -36,9 +34,9 @@ set_error_handler(function($code, $error, $file, $line)
}); });
/** /**
* Register the PHP shutdown handler. This function will be called * Register the shutdown handler. This function will be called at the
* at the end of the PHP script or on a fatal PHP error. If an error * end of the PHP script or on a fatal PHP error. If a PHP error has
* has occured, we will convert it to an ErrorException and pass it * occured, we will convert it to an ErrorException and pass it
* to the common exception handler for the framework. * to the common exception handler for the framework.
*/ */
register_shutdown_function(function() register_shutdown_function(function()
...@@ -48,22 +46,22 @@ register_shutdown_function(function() ...@@ -48,22 +46,22 @@ register_shutdown_function(function()
/** /**
* Setting the PHP error reporting level to -1 essentially forces * Setting the PHP error reporting level to -1 essentially forces
* PHP to report every error, and is guranteed to show every error * PHP to report every error, and it is guranteed to show every
* on future versions of PHP. * error on future versions of PHP.
* *
* If error detail is turned off, we will turn off all PHP error * If error detail is turned off, we will turn off all PHP error
* reporting and display since the framework will be displaying a * reporting and display since the framework will be displaying
* generic message and we don't want any sensitive details about * a generic message and we do not want any sensitive details
* the exception leaking into the views. * about the exception leaking into the views.
*/ */
error_reporting(-1); error_reporting(-1);
ini_set('display_errors', 'Off'); ini_set('display_errors', 'Off');
/** /**
* Load the session and session manager instance. The session * Load the session using the session manager. The payload will
* payload will be registered in the IoC container as an instance * be registered in the IoC container as an instance so it can
* so it can be retrieved easily throughout the application. * be easily access throughout the framework.
*/ */
if (Config::get('session.driver') !== '') if (Config::get('session.driver') !== '')
{ {
...@@ -75,9 +73,10 @@ if (Config::get('session.driver') !== '') ...@@ -75,9 +73,10 @@ if (Config::get('session.driver') !== '')
} }
/** /**
* Gather the input to the application based on the current request. * Gather the input to the application based on the global input
* The input will be gathered based on the current request method * variables for the current request. The input will be gathered
* and will be set on the Input manager. * based on the current request method and will be set on the
* Input manager class' static $input property.
*/ */
$input = array(); $input = array();
...@@ -115,9 +114,8 @@ Input::$input = $input; ...@@ -115,9 +114,8 @@ Input::$input = $input;
/** /**
* Start all of the bundles that are specified in the configuration * Start all of the bundles that are specified in the configuration
* array of auto-loaded bundles. This gives the developer the ability * array of auto-loaded bundles. This lets the developer have an
* to conveniently and automatically load bundles that are used on * easy way to load bundles for every request.
* every request to their application.
*/ */
foreach (Config::get('application.bundles') as $bundle) foreach (Config::get('application.bundles') as $bundle)
{ {
...@@ -145,9 +143,9 @@ if ( ! is_null($bundle) and Bundle::routable($bundle)) ...@@ -145,9 +143,9 @@ if ( ! is_null($bundle) and Bundle::routable($bundle))
/** /**
* Route the request to the proper route in the application. If a * Route the request to the proper route in the application. If a
* route is found, the route will be called with the current request * route is found, the route will be called via the request class
* instance. If no route is found, the 404 response will be returned * static property. If no route is found, the 404 response will
* to the browser. * be returned to the browser.
*/ */
if (count(URI::$segments) > 15) if (count(URI::$segments) > 15)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment