当前位置: 首页>>代码示例>>PHP>>正文


PHP Application::boot方法代码示例

本文整理汇总了PHP中Illuminate\Foundation\Application::boot方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::boot方法的具体用法?PHP Application::boot怎么用?PHP Application::boot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Foundation\Application的用法示例。


在下文中一共展示了Application::boot方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: refreshApplication

 /**
  * Refresh the application instance.
  *
  * @return void
  */
 protected function refreshApplication()
 {
     $this->app = $this->createApplication();
     $this->client = $this->createClient();
     $this->app->setRequestForConsoleEnvironment();
     $this->app->boot();
 }
开发者ID:astronautyan,项目名称:O2OMobile_PHP,代码行数:12,代码来源:TestCase.php

示例2: initialize

 /**
  * Initialize the Laravel Framework.
  *
  * @throws ModuleConfig
  */
 private function initialize()
 {
     // Store a reference to the database object
     // so the database connection can be reused during tests
     $oldDb = null;
     if ($this->app['db'] && $this->app['db']->connection()) {
         $oldDb = $this->app['db'];
     }
     // Store the current value for the router filters
     // so it can be reset after reloading the application
     $oldFiltersEnabled = null;
     if ($router = $this->app['router']) {
         $property = new \ReflectionProperty(get_class($router), 'filtering');
         $property->setAccessible(true);
         $oldFiltersEnabled = $property->getValue($router);
     }
     $this->app = $this->loadApplication();
     $this->kernel = $this->getStackedClient();
     $this->app->boot();
     // Reset the booted flag of the Application object
     // so the app will be booted again if it receives a new Request
     $property = new \ReflectionProperty(get_class($this->app), 'booted');
     $property->setAccessible(true);
     $property->setValue($this->app, false);
     if ($oldDb) {
         $this->app['db'] = $oldDb;
         Model::setConnectionResolver($this->app['db']);
     }
     if (!is_null($oldFiltersEnabled)) {
         $oldFiltersEnabled ? $this->app['router']->enableFilters() : $this->app['router']->disableFilters();
     }
     $this->module->setApplication($this->app);
 }
开发者ID:hitechdk,项目名称:Codeception,代码行数:38,代码来源:Laravel4.php

示例3: __construct

 /**
  * Constructor.
  *
  * @param Application $app
  */
 public function __construct(Application $app)
 {
     $this->app = $app;
     $this->httpKernel = $this->app->make('Illuminate\\Contracts\\Http\\Kernel');
     $this->httpKernel->bootstrap();
     $this->app->boot();
     parent::__construct($this);
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:13,代码来源:Laravel5.php

示例4: createApplication

 /**
  * Create an barebones Laravel application.
  */
 protected function createApplication()
 {
     $this->app = new Application(__DIR__ . '/../../..');
     $this->app->instance('config', new Repository([]));
     $this->app['config']->set('session.driver', 'array');
     $this->app['config']->set('database', ['fetch' => PDO::FETCH_CLASS, 'default' => 'sqlite', 'connections' => ['sqlite' => ['driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '']], 'migrations' => 'migrations']);
     $this->app['config']->set('app', ['providers' => [FilesystemServiceProvider::class, FoundationServiceProvider::class, PipelineServiceProvider::class, SessionServiceProvider::class, ViewServiceProvider::class, DatabaseServiceProvider::class, MigrationServiceProvider::class]]);
     $this->app->registerConfiguredProviders();
     $this->app->boot();
 }
开发者ID:sellerlabs,项目名称:illuminated,代码行数:13,代码来源:IlluminatedTestCase.php

示例5: _before

 public function _before(\Codeception\TestCase $test)
 {
     $this->kernel = $this->getApplication();
     $this->kernel->boot();
     $this->kernel->setRequestForConsoleEnvironment();
     $this->client = new LaravelConnector($this->kernel);
     $this->client->followRedirects(true);
     if ($this->config['filters']) {
         $this->haveEnabledFilters();
     }
     if ($this->transactionCleanup()) {
         $this->kernel['db']->beginTransaction();
     }
 }
开发者ID:Eli-TW,项目名称:Codeception,代码行数:14,代码来源:Laravel4.php

示例6: __construct

 /**
  * Constructor.
  *
  * @param Application $app
  */
 public function __construct(Application $app)
 {
     $this->app = $app;
     $this->httpKernel = $this->app->make('Illuminate\\Contracts\\Http\\Kernel');
     $this->httpKernel->bootstrap();
     $this->app->boot();
     $url = $this->app->config->get('app.url', 'http://localhost');
     $this->app->instance('request', Request::createFromBase(SyfmonyRequest::create($url)));
     $components = parse_url($url);
     $host = isset($components['host']) ? $components['host'] : 'localhost';
     parent::__construct($this, ['HTTP_HOST' => $host]);
     $this->followRedirects(true);
     // Parent constructor sets this to false by default
 }
开发者ID:codeception,项目名称:base,代码行数:19,代码来源:Laravel5.php

示例7: make

 /**
  * Create a new Console application.
  *
  * @param  \Illuminate\Foundation\Application  $app
  * @return \Illuminate\Console\Application
  */
 public static function make($app)
 {
     $app->boot();
     $console = with($console = new static('Laravel Framework', $app::VERSION))->setLaravel($app)->setExceptionHandler($app['exception'])->setAutoExit(false);
     $app->instance('artisan', $console);
     return $console;
 }
开发者ID:mawaha,项目名称:tracker,代码行数:13,代码来源:Application.php

示例8: boot

 public function boot()
 {
     $this->registerIlluminateProviders();
     $this->registerCollejoProviders();
     $this->registerAliases();
     parent::boot();
 }
开发者ID:codebreez,项目名称:collejo-core,代码行数:7,代码来源:Application.php

示例9: refreshApplication

 /**
  * Refresh the application instance.
  *
  * @param \Illuminate\Foundation\Application $app Optionally provide your own unbooted
  *                                                Laravel Application instance. This
  *                                                parameter can largely be ignored and
  *                                                is used just for unit testing
  * @return void
  */
 public function refreshApplication($app = null)
 {
     $this->app = $app instanceof Application ? $app : $this->createApplication();
     $this->app->setRequestForConsoleEnvironment();
     $this->app->boot();
     if ($this->migrateDatabase) {
         $artisan = $this->app->make('artisan');
         try {
             $artisan->call('migrate:install');
         } catch (QueryException $e) {
             // migration table is already installed
         }
         $artisan->call('migrate:refresh');
         if ($this->seedDatabase) {
             $artisan->call('db:seed', array('--class' => $this->seedClass));
         }
     }
 }
开发者ID:visualturk,项目名称:phpspec-laravel,代码行数:27,代码来源:Laravel.php

示例10: refreshApplication

 /**
  * Refresh the application instance.
  *
  * @return void
  */
 protected function refreshApplication()
 {
     $this->app = $this->createApplication();
     Facade::setFacadeApplication($this->app);
     $this->app['env'] = 'testing';
     $this->app['path.storage'] = __DIR__;
     $loader = $this->getMockBuilder('Illuminate\\Config\\LoaderInterface')->setMethods(array('load', 'exists', 'getNamespaces', 'cascadePackage'))->getMockForAbstractClass();
     $loader->method('load')->will($this->returnValue(array()));
     $loader->method('exists')->will($this->returnValue(true));
     $loader->method('getNamespaces')->will($this->returnValue(array()));
     $loader->method('cascadePackage')->will($this->returnValue(array()));
     $this->app['config'] = new Repository($loader, $this->app['env']);
     $this->app['cache'] = new CacheManager($this->app);
     $this->app['config']['cache.driver'] = 'array';
     $this->app['session'] = new SessionManager($this->app);
     $this->app['config']['session.driver'] = 'array';
     $this->app['session.store'] = $this->app['session']->driver();
     $this->app->boot();
 }
开发者ID:maartenstaa,项目名称:laravel-41-route-caching,代码行数:24,代码来源:IntegrationTest.php

示例11: boot

 /**
  * Boot the application's service providers.
  *
  * @return void 
  * @static 
  */
 public static function boot()
 {
     \Illuminate\Foundation\Application::boot();
 }
开发者ID:satriashp,项目名称:tour,代码行数:10,代码来源:_ide_helper.php


注:本文中的Illuminate\Foundation\Application::boot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。