src/Traits/BindIlluminate.php
public function bindIlluminateCore(Container $app = null)
    {
        if (! $app) {
            $app = new Container();
        }

        $this->ensureIlluminateBase($app);

        // Core classes
        $app->bindIf('url', $this->illuminateClasses[ 'url' ]);

        // Session and request
        $app->bindIf('session.manager', function ($app) {
            return new SessionManager($app);
        });

        $app->bindIf('session', function ($app) {
            return $app['session.manager']->driver('array');
        }, true);

        $app->bindIf('request', function ($app) {
            $request = Request::createFromGlobals();

            if (method_exists($request, 'setSessionStore')) {
                $request->setSessionStore($app['session']);
            } else {
                $request->setSession($app['session']);
            }

            return $request;
        }, true);

        // Config
        $app->bindIf('path.config', function ($app) {
            return $this->illuminateConfigPath;
        }, true);

        $app->bindIf('config', function ($app) {
            $config = new Repository;
            $this->loadIlluminateConfig($app, $config);

            return $config;
        }, true);

        // Localization
        $app->bindIf('translation.loader', function ($app) {
            return new FileLoader($app['files'], 'src/config');
        });

        $app->bindIf('translator', function ($app) {
            $loader = new FileLoader($app['files'], 'lang');

            return new Translator($loader, 'en');
        });

        return $app;
    }
public function bindIlluminateCore(Container $app = null)
    {
        if (! $app) {
            $app = new Container();
        }

        $this->ensureIlluminateBase($app);

        // Core classes
        $app->bindIf('url', $this->illuminateClasses[ 'url' ]);

        // Session and request
        $app->bindIf('session.manager', function ($app) {
            return new SessionManager($app);
        });

        $app->bindIf('session', function ($app) {
            return $app['session.manager']->driver('array');
        }, true);

        $app->bindIf('request', function ($app) {
            $request = Request::createFromGlobals();

            if (method_exists($request, 'setSessionStore')) {
                $request->setSessionStore($app['session']);
            } else {
                $request->setSession($app['session']);
            }

            return $request;
        }, true);

        // Config
        $app->bindIf('path.config', function ($app) {
            return $this->illuminateConfigPath;
        }, true);

        $app->bindIf('config', function ($app) {
            $config = new Repository;
            $this->loadIlluminateConfig($app, $config);

            return $config;
        }, true);

        // Localization
        $app->bindIf('translation.loader', function ($app) {
            return new FileLoader($app['files'], 'src/config');
        });

        $app->bindIf('translator', function ($app) {
            $loader = new FileLoader($app['files'], 'lang');

            return new Translator($loader, 'en');
        });

        return $app;
    }
public function bindIlluminateCore ( Container $ app = null ) { if ( ! $ app ) { $ app = new Container ( ) ; } $ this -> ensureIlluminateBase ( $ app ) ; // Core classes $ app -> bindIf ( 'url' , $ this -> illuminateClasses [ 'url' ] ) ; // Session and request $ app -> bindIf ( 'session.manager' , function ( $ app ) { return new SessionManager ( $ app ) ; } ) ; $ app -> bindIf ( 'session' , function ( $ app ) { return $ app [ 'session.manager' ] -> driver ( 'array' ) ; } , true ) ; $ app -> bindIf ( 'request' , function ( $ app ) { $ request = Request :: createFromGlobals ( ) ; if ( method_exists ( $ request , 'setSessionStore' ) ) { $ request -> setSessionStore ( $ app [ 'session' ] ) ; } else { $ request -> setSession ( $ app [ 'session' ] ) ; } return $ request ; } , true ) ; // Config $ app -> bindIf ( 'path.config' , function ( $ app ) { return $ this -> illuminateConfigPath ; } , true ) ; $ app -> bindIf ( 'config' , function ( $ app ) { $ config = new Repository ; $ this -> loadIlluminateConfig ( $ app , $ config ) ; return $ config ; } , true ) ; // Localization $ app -> bindIf ( 'translation.loader' , function ( $ app ) { return new FileLoader ( $ app [ 'files' ] , 'src/config' ) ; } ) ; $ app -> bindIf ( 'translator' , function ( $ app ) { $ loader = new FileLoader ( $ app [ 'files' ] , 'lang' ) ; return new Translator ( $ loader , 'en' ) ; } ) ; return $ app ; }
Bind the core classes to the Container

@param  Container  $app
@return Container
Bind the core classes to the Container