Commit 01a7991b authored by Taylor Otwell's avatar Taylor Otwell

fix artisan.

parent 4bee6d1b
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
use Laravel\Bundle; use Laravel\Bundle;
use Laravel\Config; use Laravel\Config;
use Laravel\Request;
/** /**
* Fire up the default bundle. This will ensure any dependencies that * Fire up the default bundle. This will ensure any dependencies that
...@@ -20,6 +21,16 @@ if (isset($_SERVER['CLI']['DB'])) ...@@ -20,6 +21,16 @@ if (isset($_SERVER['CLI']['DB']))
Config::set('database.default', $_SERVER['CLI']['DB']); Config::set('database.default', $_SERVER['CLI']['DB']);
} }
/**
* Overwrite the HttpFoundation request since we have set some of
* the server variables since it was created. This allows us to
* set the default database for the CLI task.
*/
use Symfony\Component\HttpFoundation\LaravelRequest as RequestFoundation;
Request::$foundation = RequestFoundation::createFromGlobals();
/** /**
* We will register all of the Laravel provided tasks inside the IoC * We will register all of the Laravel provided tasks inside the IoC
* container so they can be resolved by the task class. This allows * container so they can be resolved by the task class. This allows
......
...@@ -162,3 +162,39 @@ foreach ($bundles as $bundle => $config) ...@@ -162,3 +162,39 @@ foreach ($bundles as $bundle => $config)
{ {
Bundle::register($bundle, $config); Bundle::register($bundle, $config);
} }
/*
|--------------------------------------------------------------------------
| Magic Quotes Strip Slashes
|--------------------------------------------------------------------------
|
| Even though "Magic Quotes" are deprecated in PHP 5.3.x, they may still
| be enabled on the server. To account for this, we will strip slashes
| on all input arrays if magic quotes are enabled for the server.
|
*/
if (magic_quotes())
{
$magics = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
foreach ($magics as &$magic)
{
$magic = array_strip_slashes($magic);
}
}
/*
|--------------------------------------------------------------------------
| Create The HttpFoundation Request
|--------------------------------------------------------------------------
|
| Laravel uses the HttpFoundation Symfony component to handle the request
| and response functionality for the framework. This allows us to not
| worry about that boilerplate code and focus on what matters.
|
*/
use Symfony\Component\HttpFoundation\LaravelRequest as RequestFoundation;
Request::$foundation = RequestFoundation::createFromGlobals();
\ No newline at end of file
...@@ -55,42 +55,6 @@ register_shutdown_function(function() ...@@ -55,42 +55,6 @@ register_shutdown_function(function()
error_reporting(-1); error_reporting(-1);
/*
|--------------------------------------------------------------------------
| Magic Quotes Strip Slashes
|--------------------------------------------------------------------------
|
| Even though "Magic Quotes" are deprecated in PHP 5.3.x, they may still
| be enabled on the server. To account for this, we will strip slashes
| on all input arrays if magic quotes are enabled for the server.
|
*/
if (magic_quotes())
{
$magics = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
foreach ($magics as &$magic)
{
$magic = array_strip_slashes($magic);
}
}
/*
|--------------------------------------------------------------------------
| Create The HttpFoundation Request
|--------------------------------------------------------------------------
|
| Laravel uses the HttpFoundation Symfony component to handle the request
| and response functionality for the framework. This allows us to not
| worry about that boilerplate code and focus on what matters.
|
*/
use Symfony\Component\HttpFoundation\LaravelRequest as RequestFoundation;
Request::$foundation = RequestFoundation::createFromGlobals();
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Start The Application Bundle | Start The Application Bundle
......
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