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


PHP ServiceProvider::boot方法代码示例

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


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

示例1: testItPerformsABootMethod

 /**
  * @test
  */
 public function testItPerformsABootMethod()
 {
     $this->applicationMock->shouldReceive('version')->once()->andReturn('5.2.6');
     $this->applicationMock->shouldReceive('make')->once()->andReturn('fake_config_path');
     $dispatcherMock = Mockery::mock(Dispatcher::class);
     $dispatcherMock->shouldReceive('listen')->once();
     $this->serviceProvider->boot($dispatcherMock);
 }
开发者ID:neondigital,项目名称:laravel-view-presenter,代码行数:11,代码来源:ViewPresenterServiceProviderTest.php

示例2: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     $this->loadViewsFrom(__DIR__ . '/views', 'construct');
     $this->publishes([__DIR__ . '/AppController.php' => base_path('app/Http/Controllers/AppController.php'), __DIR__ . '/app.scss' => base_path('resources/assets/sass/app.scss'), __DIR__ . '/ie.scss' => base_path('resources/assets/sass/ie.scss'), __DIR__ . '/admin.js' => base_path('resources/assets/js/admin.js'), __DIR__ . '/svg' => base_path('resources/assets/svg'), __DIR__ . '/_settings.scss' => base_path('resources/assets/sass/_settings.scss'), __DIR__ . '/.gitignore.example' => base_path('.gitignore'), __DIR__ . '/bower.json' => base_path('bower.json'), __DIR__ . '/.bowerrc' => base_path('.bowerrc'), __DIR__ . '/package.json' => base_path('package.json'), __DIR__ . '/gulpfile.js' => base_path('gulpfile.js'), __DIR__ . '/settings.js' => base_path('settings.js'), __DIR__ . '/config/site.php' => config_path('site.php'), __DIR__ . '/config/mail.php' => config_path('mail.php'), __DIR__ . '/config/filesystems.php' => config_path('filesystems.php'), __DIR__ . '/database/migrations' => $this->app->databasePath() . '/migrations']);
     include __DIR__ . '/routes.php';
 }
开发者ID:eurobob,项目名称:construct,代码行数:12,代码来源:EurobobConstructServiceProvider.php

示例3: boot

 /**
  * Boot the service provider.
  *
  * This method is called after all other service providers have
  * been registered, meaning you have access to all other services
  * that have been registered by the framework.
  *
  * @return void
  */
 public function boot(DispatcherContract $events)
 {
     parent::boot($events);
     // Publish the database migrations
     $this->publishes([__DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'], 'migrations');
     $this->publishes([__DIR__ . '/../config' => config_path()], 'config');
     // Log needs a closure as a listener
     Log::listen(function ($level, $message, $context) {
         // Throw out debug messages if we are not in debug mode
         if ($level == 'debug' && \Config::get('app.debug') != true) {
             return;
         }
         // Fetch the currently logged in user
         $username = ApplogHelper::currentUserName();
         // Get the list of client IP addresses
         $clientIp = ApplogHelper::getClientIps();
         // Split the log message to see how it is formatted.
         $logdata = explode(':', $message, 6);
         if (count($logdata) == 6) {
             list($classname, $traitname, $filename, $linenumber, $functionname, $message) = $logdata;
         } else {
             list($classname, $traitname, $filename, $linenumber, $functionname, $message) = ['', '', '', '', '', $message];
         }
         // Store the log entry.
         try {
             Applog::create(['type' => $level, 'classname' => $classname, 'traitname' => $traitname, 'filename' => $filename, 'linenumber' => $linenumber, 'functionname' => $functionname, 'message' => $message, 'details' => json_encode($context), 'ipaddr' => $clientIp, 'created_by' => $username, 'updated_by' => $username]);
         } catch (\Exception $e) {
             // Do nothing
         }
     });
 }
开发者ID:delatbabel,项目名称:applog,代码行数:40,代码来源:DebugServiceProvider.php

示例4: boot

 /**
  * Boot the service provider.
  *
  * This method is called after all other service providers have
  * been registered, meaning you have access to all other services
  * that have been registered by the framework.
  *
  * @return void
  */
 public function boot(DispatcherContract $events)
 {
     parent::boot($events);
     // Publish the database migrations
     $this->publishes([__DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'], 'migrations');
     $this->publishes([__DIR__ . '/../config' => config_path()], 'config');
 }
开发者ID:delatbabel,项目名称:site-config,代码行数:16,代码来源:SiteConfigServiceProvider.php

示例5: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     parent::boot();
     // @see https://coderwall.com/p/svocrg
     $this->package('npmweb/php-env-loader', null, __DIR__ . '/../../../');
     $this->loadEnv();
 }
开发者ID:npmweb,项目名称:php-env-loader,代码行数:12,代码来源:EnvLoaderServiceProvider.php

示例6: boot

 public function boot(Dispatcher $events)
 {
     parent::boot($events);
     App::register('JLeonardoLemos\\Categories\\Providers\\RouteServiceProvider');
     App::register('JLeonardoLemos\\Categories\\Providers\\EventServiceProvider');
     $this->publishesMigrations();
 }
开发者ID:jleonardolemos,项目名称:categories,代码行数:7,代码来源:CategoriesServiceProvider.php

示例7: boot

 /**
  * Boot the provider, adding the "gatekeeper" type to the Auth handling
  *
  * @param Router $router Laravel router instance
  */
 public function boot(Router $router)
 {
     Auth::extend('gatekeeper', function ($app) {
         return new UserProvider();
     });
     parent::boot($router);
 }
开发者ID:sdh100shaun,项目名称:gatekeeper,代码行数:12,代码来源:AuthServiceProvider.php

示例8: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot(Router $router)
 {
     $router->bind('article', function ($id) {
         return \App\Article::where('slug', $id)->first();
     });
     parent::boot($router);
 }
开发者ID:belhard-user,项目名称:group2,代码行数:12,代码来源:ModelProviders.php

示例9: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     parent::boot();
     $this->package('edvinaskrucas/rbauth');
     $this->extendAuth();
     $this->registerFilters();
 }
开发者ID:edvinaskrucas,项目名称:rbauth,代码行数:12,代码来源:RBAuthServiceProvider.php

示例10: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot(Router $router)
 {
     parent::boot($router);
     $this->loadViewsFrom(__DIR__ . '/views', 'build');
     $this->publishes([__DIR__ . '/app.scss' => base_path('resources/assets/sass/app.scss'), __DIR__ . '/app.scss' => base_path('resources/assets/sass/ie.scss'), __DIR__ . '/_settings.scss' => base_path('resources/assets/sass/_settings.scss'), __DIR__ . '/.gitignore.example' => base_path('.gitignore'), __DIR__ . '/bower.json' => base_path('bower.json'), __DIR__ . '/.bowerrc' => base_path('.bowerrc'), __DIR__ . '/package.json' => base_path('package.json'), __DIR__ . '/gulpfile.js' => base_path('gulpfile.js'), __DIR__ . '/settings.js' => base_path('settings.js'), __DIR__ . '/config/blog.php' => config_path('blog.php'), __DIR__ . '/config/mail.php' => config_path('mail.php'), __DIR__ . '/config/filesystems.php' => config_path('filesystems.php'), __DIR__ . '/database/migrations' => $this->app->databasePath() . '/migrations']);
     $this->publishes([__DIR__ . '/assets' => base_path('resources/assets/vendor/build')], 'publish');
     include __DIR__ . '/routes.php';
 }
开发者ID:eurobob,项目名称:build,代码行数:13,代码来源:LivitBuildServiceProvider.php

示例11: boot

 /**
  * Send logs from the given level to Pushbullet.
  *
  * @return void
  */
 public function boot()
 {
     parent::boot();
     if (in_array(config('app.env'), (array) config('services.monobullet.env', config('app.env')))) {
         $monolog = Log::getMonolog();
         $monolog->pushHandler(new PushbulletHandler(config('services.monobullet.token'), config('services.monobullet.recipients'), config('services.monobullet.level', Logger::INFO), config('services.monobullet.propagate', true)));
     }
 }
开发者ID:max13,项目名称:monobullet,代码行数:13,代码来源:MonobulletServiceProvider.php

示例12: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     parent::boot();
     \Blade::setRawTags("[[", "]]");
     \Blade::setContentTags('<%', '%>');
     // for variables and all things Blade
     \Blade::setEscapedContentTags('<%%', '%%>');
     // for escaped data
 }
开发者ID:jtpenny,项目名称:laratasks,代码行数:14,代码来源:AppServiceProvider.php

示例13: boot

 public function boot(Dispatcher $events)
 {
     # Call parent
     parent::boot($events);
     # Views
     $this->loadViewsFrom(__DIR__ . '/../View', 'install');
     # Call Events
     $this->events($events);
 }
开发者ID:hakoncms,项目名称:plugins,代码行数:9,代码来源:InstallServiceProvider.php

示例14: boot

 public function boot()
 {
     if (method_exists($this, 'package')) {
         $this->package('stevebauman/calendar-helper');
     } else {
         $this::$configSeparator = '.';
         $this->publishes([__DIR__ . '../../../config/config.php' => config_path('calendar-helper.php')], 'config');
         $this->loadTranslationsFrom(__DIR__ . '../../../lang', 'calendar-helper');
     }
     parent::boot();
 }
开发者ID:stevebauman,项目名称:calendar-helper,代码行数:11,代码来源:CalendarHelperServiceProvider.php

示例15: boot

 /**
  * Boot the service provider.
  *
  * This method is called after all other service providers have
  * been registered, meaning you have access to all other services
  * that have been registered by the framework.
  *
  * @return void
  */
 public function boot(DispatcherContract $events)
 {
     parent::boot($events);
     // Publish the database migrations and seeds
     $this->publishes([__DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'], 'migrations');
     $this->publishes([__DIR__ . '/../database/seeds' => $this->app->databasePath() . '/seeds'], 'seeds');
     $this->publishes([__DIR__ . '/../config' => config_path()], 'config');
     // Register other providers required by this provider, which saves the caller
     // from having to register them each individually.
     $this->app->register(\Baum\Providers\BaumServiceProvider::class);
     $this->app->register(\Cviebrock\EloquentSluggable\SluggableServiceProvider::class);
 }
开发者ID:delatbabel,项目名称:nestedcategories,代码行数:21,代码来源:NestedCategoriesServiceProvider.php


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