/** * Bootstrap the test environemnt: * - Create an application instance and register it within itself. * - Register the package service provider with the app. * - Set the APP facade. * * @return void */ public function setUp() { $app = new Illuminate\Foundation\Application(); $app->instance('app', $app); $app->register('Codesleeve\\Stapler\\StaplerServiceProvider'); Illuminate\Support\Facades\Facade::setFacadeApplication($app); }
/** * Bootstrap the test environemnt: * - Create an application instance and register it within itself. * - Register the package service provider with the app. * - Set the APP facade. * * @return void */ public function setUp() { $app = new Illuminate\Foundation\Application(); $app->instance('app', $app); $app->register('Expstudio\\LaraClip\\LaraClipServiceProvider'); Illuminate\Support\Facades\Facade::setFacadeApplication($app); }
/** * Register the session close event. * * @param Illuminate\Foundation\Application $app * @param array $config * @return void */ protected function registerCloseEvent($app, $config) { $app->close(function ($request, $response) use($app, $config) { $session = $app['session']; $session->finish($response, $config['lifetime']); $cookie = $session->getCookie($app['cookie'], $config['cookie'], $config['lifetime']); $response->headers->setCookie($cookie); }); }
/** * Get an instance of the possible current controller * being executed for the current route. * * @return mixed */ protected function getCurrentController() { $router = $this->app->make('router'); $route = $router->currentRouteAction(); if (($pos = strpos($route, '@')) !== false) { Controller::setFilterer($router); $controllerName = substr($route, 0, $pos); return $this->app[$controllerName]; } }
/** * @return \Illuminate\Foundation\Application */ function __dfe_bootstrap() { // Create the app $_app = new Illuminate\Foundation\Application(realpath(dirname(__DIR__))); // Bind our default services $_app->singleton('Illuminate\\Contracts\\Http\\Kernel', 'DreamFactory\\Enterprise\\Dashboard\\Http\\Kernel'); $_app->singleton('Illuminate\\Contracts\\Console\\Kernel', 'DreamFactory\\Enterprise\\Dashboard\\Console\\Kernel'); $_app->singleton('Illuminate\\Contracts\\Debug\\ExceptionHandler', 'DreamFactory\\Enterprise\\Dashboard\\Exceptions\\Handler'); // Return the app return $_app; }
public function makeApp() { $app = new \Illuminate\Foundation\Application(); $app->detectEnvironment(function () { return 'production'; }); $app['config'] = $this->mockConfig(); $app['request'] = $this->makeRequest(); $app['router'] = $this->mockRouter(); return $app; }
protected function makeApp(array $config = array()) { $app = new \Illuminate\Foundation\Application(); $app->detectEnvironment(function () { return 'production'; }); $app['config'] = $this->mockConfig($config); $app['request'] = m::mock('Illuminate\\Http\\Request'); $app['mailer'] = m::mock('Illuminate\\Mail\\Mailer'); return $app; }
/** * @return \Illuminate\Foundation\Application */ function __dfe_bootstrap() { // Create the app $_app = new Illuminate\Foundation\Application(realpath(__DIR__ . '/../')); // Bind our default services $_app->singleton('Illuminate\\Contracts\\Http\\Kernel', DreamFactory\Enterprise\Console\Http\Kernel::class); $_app->singleton('Illuminate\\Contracts\\Console\\Kernel', DreamFactory\Enterprise\Console\Console\Kernel::class); $_app->singleton('Illuminate\\Contracts\\Debug\\ExceptionHandler', DreamFactory\Enterprise\Console\Exceptions\Handler::class); // Return the app return $_app; }
public function storagePath() { if (array_key_exists('STORAGE_PATH', $_SERVER)) { return $_SERVER['STORAGE_PATH']; } return parent::storagePath(); }
/** * Make a storage instance */ public function createStorage($save = false) { $storage = $this->app->make('oauth.storage'); if ($save) { $this->storage = $storage; } return $storage; }
/** * Execute the console command. * * @return mixed */ public function fire() { restore_error_handler(); restore_exception_handler(); $this->app->error(function () { return ''; }); if ($configFile = $this->option('config')) { array_set($this->config, 'configuration.configFile', $configFile); } $configuration = new LaravelConfiguration($this->config['configuration']); $configuration->addPresenters($this->presenters()); $this->shell = new LaravelShell($configuration, $this->app); $this->shell->setIncludes($this->argument('include')); $this->shell->addCommands($this->commands()); $this->shell->addContributors($this->contributors()); $this->shell->run(); }
public function testExecution() { require_once __DIR__ . '/stubs/TestCommand.php'; require_once __DIR__ . '/stubs/TestCommandHandler.php'; $application = new \Illuminate\Foundation\Application(); $application->bind('config', function () { return new \Illuminate\Config\Repository(); }); $handler = new TestCommandHandler(); TestCommandHandler::$handledCommands = []; $application->singleton(TestCommandHandler::class, function () use(&$handler) { return $handler; }); $application->register(new TacticianServiceProvider($application)); $command = new TestCommand('data'); $application['tactician.dispatcher']->dispatch($command); $this->assertCount(1, TestCommandHandler::$handledCommands); $this->assertEquals($command, TestCommandHandler::$handledCommands[0]); }
public function testWithMiddleware() { require_once __DIR__ . '/stubs/TestCommand.php'; require_once __DIR__ . '/stubs/TestCommandHandler.php'; require_once __DIR__ . '/stubs/TestMiddleware.php'; $application = new \Illuminate\Foundation\Application(); $application->bind('config', function () { return new \Illuminate\Config\Repository(); }); $application->singleton(TestCommandHandler::class, function () use(&$handler) { return new TestCommandHandler(); }); $application->register(new TacticianServiceProvider($application)); $application['tactician.middleware']->prepend('test.middleware'); $middleware = new TestMiddleware(); $application->bind('test.middleware', function () use($middleware) { return $middleware; }); $command = new TestCommand('data'); $application['tactician.dispatcher']->dispatch($command); $this->assertCount(1, $middleware->handledCommands); $this->assertEquals($command, $middleware->handledCommands[0]); }
/** * Creates the application. * * @return \Illuminate\Foundation\Application */ public function createApplication() { $app = new \Illuminate\Foundation\Application(dirname(dirname(__DIR__)) . '/vendor/laravel/laravel'); $app->singleton(\Illuminate\Contracts\Http\Kernel::class, \App\Http\Kernel::class); $app->singleton(\Illuminate\Contracts\Console\Kernel::class, \App\Console\Kernel::class); $app->singleton(\Illuminate\Contracts\Debug\ExceptionHandler::class, \App\Exceptions\Handler::class); $app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap(); return $app; }
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(realpath(__DIR__ . '/../')); /* |-------------------------------------------------------------------------- | Bind Important Interfaces |-------------------------------------------------------------------------- | | Next, we need to bind some important interfaces into the container so | we will be able to resolve them when needed. The kernels serve the | incoming requests to this application from both the web and CLI. | */ $app->singleton(Illuminate\Contracts\Http\Kernel::class, vacantrentals\Http\Kernel::class); $app->singleton(Illuminate\Contracts\Console\Kernel::class, vacantrentals\Console\Kernel::class); $app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, vacantrentals\Exceptions\Handler::class); /* |-------------------------------------------------------------------------- | Return The Application |-------------------------------------------------------------------------- |
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(); /* |-------------------------------------------------------------------------- | Detect The Application Environment |-------------------------------------------------------------------------- | | Laravel takes a dead simple approach to your application environments | so you can just specify a machine name for the host that matches a | given environment, then we will automatically detect it for you. | */ $env = $app->detectEnvironment(array('local' => array('dreamlucid.local', 'dreamlucid', 'Anirudhas-MacBook-Pro.local'))); /* |-------------------------------------------------------------------------- | Bind Paths |-------------------------------------------------------------------------- | | Here we are binding the paths configured in paths.php to the app. You | should not be changing these here. If you need to change these you
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(); $app->redirectIfTrailingSlash(); /* |-------------------------------------------------------------------------- | Detect The Application Environment |-------------------------------------------------------------------------- | | Laravel takes a dead simple approach to your application environments | so you can just specify a machine name or HTTP host that matches a | given environment, then we will automatically detect it for you. | */ $env = $app->detectEnvironment(array('local' => array('your-machine-name'), 'production' => array('iRail', 'irail.test.ibbt.be', 'harv2', 'harv3', 'harv4', 'harv5', 'harv6', 'harv7', 'harv8', 'harv9', 'harv10'))); /* |-------------------------------------------------------------------------- | Bind Paths |-------------------------------------------------------------------------- | | Here we are binding the paths configured in paths.php to the app. You
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(realpath(__DIR__ . '/../')); /* |-------------------------------------------------------------------------- | Bind Important Interfaces |-------------------------------------------------------------------------- | | Next, we need to bind some important interfaces into the container so | we will be able to resolve them when needed. The kernels serve the | incoming requests to this application from both the web and CLI. | */ $app->singleton(Illuminate\Contracts\Http\Kernel::class, AdvancedELOQUENT\Http\Kernel::class); $app->singleton(Illuminate\Contracts\Console\Kernel::class, AdvancedELOQUENT\Console\Kernel::class); $app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, AdvancedELOQUENT\Exceptions\Handler::class); /* |-------------------------------------------------------------------------- | Return The Application |-------------------------------------------------------------------------- |
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(); $app->redirectIfTrailingSlash(); /* |-------------------------------------------------------------------------- | Detect The Application Environment |-------------------------------------------------------------------------- | | Laravel takes a dead simple approach to your application environments | so you can just specify a machine name or HTTP host that matches a | given environment, then we will automatically detect it for you. | */ $env = $app->detectEnvironment(['local' => ['machine']]); /* |-------------------------------------------------------------------------- | Bind Paths |-------------------------------------------------------------------------- | | Here we are binding the paths configured in paths.php to the app. You
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(realpath(__DIR__ . '/../')); /* |-------------------------------------------------------------------------- | Bind Important Interfaces |-------------------------------------------------------------------------- | | Next, we need to bind some important interfaces into the container so | we will be able to resolve them when needed. The kernels serve the | incoming requests to this application from both the web and CLI. | */ $app->singleton(Illuminate\Contracts\Http\Kernel::class, TasksLaravel\Http\Kernel::class); $app->singleton(Illuminate\Contracts\Console\Kernel::class, TasksLaravel\Console\Kernel::class); $app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, TasksLaravel\Exceptions\Handler::class); /* |-------------------------------------------------------------------------- | Return The Application |-------------------------------------------------------------------------- |
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(realpath(__DIR__ . '/../')); /* |-------------------------------------------------------------------------- | Bind Important Interfaces |-------------------------------------------------------------------------- | | Next, we need to bind some important interfaces into the container so | we will be able to resolve them when needed. The kernels serve the | incoming requests to this application from both the web and CLI. | */ $app->singleton(Illuminate\Contracts\Http\Kernel::class, NeonTsunami\Http\Kernel::class); $app->singleton(Illuminate\Contracts\Console\Kernel::class, NeonTsunami\Console\Kernel::class); $app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, NeonTsunami\Exceptions\Handler::class); /* |-------------------------------------------------------------------------- | Return The Application |-------------------------------------------------------------------------- |
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(realpath(__DIR__ . '/../')); /* |-------------------------------------------------------------------------- | Bind Important Interfaces |-------------------------------------------------------------------------- | | Next, we need to bind some important interfaces into the container so | we will be able to resolve them when needed. The kernels serve the | incoming requests to this application from both the web and CLI. | */ $app->singleton(Illuminate\Contracts\Http\Kernel::class, App\Http\Kernel::class); $app->singleton(Illuminate\Contracts\Console\Kernel::class, App\Console\Kernel::class); $app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, App\Exceptions\Handler::class); /* |-------------------------------------------------------------------------- | Return The Application |-------------------------------------------------------------------------- |
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(); /* |-------------------------------------------------------------------------- | Detect The Application Environment |-------------------------------------------------------------------------- | | Laravel takes a dead simple approach to your application environments | so you can just specify a machine name or HTTP host that matches a | given environment, then we will automatically detect it for you. | */ $env = $app->detectEnvironment(array('development' => array('server.sourcedonates.com', 'colorful-mist'), 'local' => array('homestead', '.local'))); /* |-------------------------------------------------------------------------- | Bind Paths |-------------------------------------------------------------------------- | | Here we are binding the paths configured in paths.php to the app. You | should not be changing these here. If you need to change these you
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(); /* |-------------------------------------------------------------------------- | Detect The Application Environment |-------------------------------------------------------------------------- | | Laravel takes a dead simple approach to your application environments | so you can just specify a machine name for the host that matches a | given environment, then we will automatically detect it for you. | */ $env = $app->detectEnvironment(array('local' => array('homestead'), 'safarishi' => array('sshfl-pc', 'Evyn-PC', 'Rootant004-PC', 'USER-20150530RF', 'USER-20150606KO', '10_131_140_23', 'WIN-7ILHV9HS7D5', 'USER-20151019FP'))); /* |-------------------------------------------------------------------------- | Bind Paths |-------------------------------------------------------------------------- | | Here we are binding the paths configured in paths.php to the app. You | should not be changing these here. If you need to change these you
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(realpath(__DIR__ . '/../')); /* |-------------------------------------------------------------------------- | Bind Important Interfaces |-------------------------------------------------------------------------- | | Next, we need to bind some important interfaces into the container so | we will be able to resolve them when needed. The kernels serve the | incoming requests to this application from both the web and CLI. | */ $app->singleton(Illuminate\Contracts\Http\Kernel::class, andresabello\Http\Kernel::class); $app->singleton(Illuminate\Contracts\Console\Kernel::class, andresabello\Console\Kernel::class); $app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, andresabello\Exceptions\Handler::class); /* |-------------------------------------------------------------------------- | Return The Application |-------------------------------------------------------------------------- |
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(); /* |-------------------------------------------------------------------------- | Detect The Application Environment |-------------------------------------------------------------------------- | | Laravel takes a dead simple approach to your application environments | so you can just specify a machine name for the host that matches a | given environment, then we will automatically detect it for you. | */ $env = $app->detectEnvironment(array('local' => array('homestead', 'zahan'))); /* |-------------------------------------------------------------------------- | Bind Paths |-------------------------------------------------------------------------- | | Here we are binding the paths configured in paths.php to the app. You | should not be changing these here. If you need to change these you
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(); /* |-------------------------------------------------------------------------- | Detect The Application Environment |-------------------------------------------------------------------------- | | Laravel takes a dead simple approach to your application environments | so you can just specify a machine name or HTTP host that matches a | given environment, then we will automatically detect it for you. | */ $env = $app->detectEnvironment(array('local' => array('localhost/snipe'), 'staging' => array('staging.yourserver.com'), 'production' => array('localhost/snipe'))); /* |-------------------------------------------------------------------------- | Bind Paths |-------------------------------------------------------------------------- | | Here we are binding the paths configured in paths.php to the app. You | should not be changing these here. If you need to change these you
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(realpath(__DIR__ . '/../')); /* |-------------------------------------------------------------------------- | Bind Important Interfaces |-------------------------------------------------------------------------- | | Next, we need to bind some important interfaces into the container so | we will be able to resolve them when needed. The kernels serve the | incoming requests to this application from both the web and CLI. | */ $app->singleton('Illuminate\\Contracts\\Http\\Kernel', 'App\\Http\\Kernel'); $app->singleton('Illuminate\\Contracts\\Console\\Kernel', 'App\\Console\\Kernel'); $app->singleton('Illuminate\\Contracts\\Debug\\ExceptionHandler', 'App\\Exceptions\\Handler'); $app->singleton('Illuminate\\Foundation\\Bootstrap\\ConfigureLogging', 'App\\Bootstrap\\ConfigureLogging'); /* |-------------------------------------------------------------------------- | Return The Application |--------------------------------------------------------------------------
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(realpath(__DIR__ . '/../')); /* |-------------------------------------------------------------------------- | Bind Important Interfaces |-------------------------------------------------------------------------- | | Next, we need to bind some important interfaces into the container so | we will be able to resolve them when needed. The kernels serve the | incoming requests to this application from both the web and CLI. | */ $app->singleton(Illuminate\Contracts\Http\Kernel::class, Flisk\Http\Kernel::class); $app->singleton(Illuminate\Contracts\Console\Kernel::class, Flisk\Console\Kernel::class); $app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, Flisk\Exceptions\Handler::class); /* |-------------------------------------------------------------------------- | Return The Application |-------------------------------------------------------------------------- |
<?php /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | The first thing we will do is create a new Laravel application instance | which serves as the "glue" for all the components of Laravel, and is | the IoC container for the system binding all of the various parts. | */ $app = new Illuminate\Foundation\Application(realpath(__DIR__ . '/../')); /* |-------------------------------------------------------------------------- | Bind Important Interfaces |-------------------------------------------------------------------------- | | Next, we need to bind some important interfaces into the container so | we will be able to resolve them when needed. The kernels serve the | incoming requests to this application from both the web and CLI. | */ $app->singleton('Illuminate\\Contracts\\Http\\Kernel', 'cobates\\Http\\Kernel'); $app->singleton('Illuminate\\Contracts\\Console\\Kernel', 'cobates\\Console\\Kernel'); $app->singleton('Illuminate\\Contracts\\Debug\\ExceptionHandler', 'cobates\\Exceptions\\Handler'); /* |-------------------------------------------------------------------------- | Return The Application |-------------------------------------------------------------------------- |