removed application and resolver classes. added phpunit tests.
This commit is contained in:
@@ -15,51 +15,51 @@ ini_set('display_errors', 'Off');
|
||||
// --------------------------------------------------------------
|
||||
// Register the error / exception handlers.
|
||||
// --------------------------------------------------------------
|
||||
set_exception_handler(function($e) use ($application)
|
||||
set_exception_handler(function($e) use ($container)
|
||||
{
|
||||
call_user_func($application->config->get('error.handler'), $e);
|
||||
call_user_func($container->config->get('error.handler'), $e);
|
||||
});
|
||||
|
||||
set_error_handler(function($number, $error, $file, $line) use ($application)
|
||||
set_error_handler(function($number, $error, $file, $line) use ($container)
|
||||
{
|
||||
$exception = new \ErrorException($error, $number, 0, $file, $line);
|
||||
|
||||
call_user_func($application->config->get('error.handler'), $exception);
|
||||
call_user_func($container->config->get('error.handler'), $exception);
|
||||
});
|
||||
|
||||
register_shutdown_function(function() use ($application)
|
||||
register_shutdown_function(function() use ($container)
|
||||
{
|
||||
if ( ! is_null($error = error_get_last()))
|
||||
{
|
||||
$exception = new \ErrorException($error['message'], $error['type'], 0, $error['file'], $error['line']);
|
||||
|
||||
call_user_func($application->config->get('error.handler'), $exception);
|
||||
call_user_func($container->config->get('error.handler'), $exception);
|
||||
}
|
||||
});
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// Set the default timezone.
|
||||
// --------------------------------------------------------------
|
||||
date_default_timezone_set($application->config->get('application.timezone'));
|
||||
date_default_timezone_set($container->config->get('application.timezone'));
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// Load the session and session manager.
|
||||
// --------------------------------------------------------------
|
||||
if ($application->config->get('session.driver') !== '')
|
||||
if ($container->config->get('session.driver') !== '')
|
||||
{
|
||||
$cookie = $application->input->cookies->get('laravel_session');
|
||||
$cookie = $container->input->cookies->get('laravel_session');
|
||||
|
||||
$application->session->start($cookie, $application->config->get('session.lifetime'));
|
||||
$container->session->start($cookie, $container->config->get('session.lifetime'));
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// Load the packages that are in the auto-loaded packages array.
|
||||
// --------------------------------------------------------------
|
||||
$packages = $application->config->get('application.packages');
|
||||
$packages = $container->config->get('application.packages');
|
||||
|
||||
if (count($packages) > 0)
|
||||
{
|
||||
$application->package->load($packages);
|
||||
$container->package->load($packages);
|
||||
}
|
||||
|
||||
unset($packages);
|
||||
@@ -67,17 +67,17 @@ unset($packages);
|
||||
// --------------------------------------------------------------
|
||||
// Route the request and get the response from the route.
|
||||
// --------------------------------------------------------------
|
||||
$route = $application->container->resolve('laravel.routing.router')->route();
|
||||
$route = $container->resolve('laravel.routing.router')->route();
|
||||
|
||||
if ( ! is_null($route))
|
||||
{
|
||||
$route->filters = require APP_PATH.'filters'.EXT;
|
||||
|
||||
$response = $application->container->resolve('laravel.routing.caller')->call($route);
|
||||
$response = $container->resolve('laravel.routing.caller')->call($route);
|
||||
}
|
||||
else
|
||||
{
|
||||
$response = $application->response->error('404');
|
||||
$response = $container->response->error('404');
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
@@ -88,9 +88,9 @@ $response->content = $response->render();
|
||||
// --------------------------------------------------------------
|
||||
// Close the session.
|
||||
// --------------------------------------------------------------
|
||||
if ($application->config->get('session.driver') !== '')
|
||||
if ($container->config->get('session.driver') !== '')
|
||||
{
|
||||
$application->session->close($application->input, $application->config->get('session'));
|
||||
$container->session->close($container->input, $container->config->get('session'));
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user