src/Core/Bootstrap/SetRequestForConsole.php
public function bootstrap(Application $app)
    {
        $uri = $app->make('config')->get('app.url', 'http://localhost');

        $components = parse_url($uri);

        $server = $_SERVER;

        if (isset($components['path'])) {
            $server = array_merge($server, [
                'SCRIPT_FILENAME' => $components['path'],
                'SCRIPT_NAME' => $components['path']
            ]);
        }

        $app->instance('request', Request::create(
            $uri,
            'GET',
            [],
            [],
            [],
            $server
        ));
    }
public function bootstrap(Application $app)
    {
        $uri = $app->make('config')->get('app.url', 'http://localhost');

        $components = parse_url($uri);

        $server = $_SERVER;

        if (isset($components['path'])) {
            $server = array_merge($server, [
                'SCRIPT_FILENAME' => $components['path'],
                'SCRIPT_NAME' => $components['path']
            ]);
        }

        $app->instance('request', Request::create(
            $uri,
            'GET',
            [],
            [],
            [],
            $server
        ));
    }
public function bootstrap ( Application $ app ) { $ uri = $ app -> make ( 'config' ) -> get ( 'app.url' , 'http://localhost' ) ; $ components = parse_url ( $ uri ) ; $ server = $ _SERVER ; if ( isset ( $ components [ 'path' ] ) ) { $ server = array_merge ( $ server , [ 'SCRIPT_FILENAME' => $ components [ 'path' ] , 'SCRIPT_NAME' => $ components [ 'path' ] ] ) ; } $ app -> instance ( 'request' , Request :: create ( $ uri , 'GET' , [ ] , [ ] , [ ] , $ server ) ) ; }
Setup the request for console application.

@param Application $app
Setup the request for console application .