php Illuminate-Support-ServiceProvider类(方法)实例源码

下面列出了php Illuminate-Support-ServiceProvider 类(方法)源码代码实例,从而了解它的用法。

作者:jleonardolemo    项目:categorie   
public function boot(Dispatcher $events)
 {
     parent::boot($events);
     App::register('JLeonardoLemos\\Categories\\Providers\\RouteServiceProvider');
     App::register('JLeonardoLemos\\Categories\\Providers\\EventServiceProvider');
     $this->publishesMigrations();
 }

作者:guiwod    项目:route-binde   
public function test_it_should_publish_the_config_path()
 {
     $this->appMock->shouldReceive('routesAreCached')->andReturn(true);
     $this->appMock->shouldReceive('call');
     $this->sp->boot($this->routerMock);
     $paths = ServiceProvider::pathsToPublish(RouteBinderServiceProvider::class, 'config');
     $this->assertArrayHasKey(dirname(__DIR__) . '/config/routes.php', $paths);
     $this->assertContains('/config/routes.php', $paths);
 }

作者:netforcew    项目:framewor   
/**
  * Create do provider.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  */
 public function __construct($app)
 {
     parent::__construct($app);
     // Trocar instancias
     foreach ($this->instances as $provider => $classServiceProvider) {
         // Limpar facade
         Facade::clearResolvedInstance($provider);
         // Trocar / Criar
         $this->app->instance($provider, new $classServiceProvider($app));
     }
 }

作者:fparralej    项目:btrabaj   
/**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $paths = ServiceProvider::pathsToPublish($this->option('provider'), $this->option('tag'));
     foreach ($paths as $from => $to) {
         if ($this->files->isFile($from)) {
             $this->publishFile($from, $to);
         } elseif ($this->files->isDirectory($from)) {
             $this->publishDirectory($from, $to);
         }
     }
     $this->info('Publishing Complete!');
 }

作者:neondigita    项目:laravel-view-presente   
/**
  * @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);
 }

作者:okaufman    项目:google-movies-client-larave   
/**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     // Configure any bindings that are version dependent
     $this->provider->register();
     // Let the IoC container be able to make a Symfony event dispatcher
     $this->app->bind('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface', 'Symfony\\Component\\EventDispatcher\\EventDispatcher');
     // Setup default configurations for the GoogleMoviesClient Client
     $this->app->singleton('GoogleMoviesClient\\Client', function () {
         $config = $this->provider->config();
         $options = $config['options'];
         // Use an Event Dispatcher that uses the Laravel event dispatcher
         $options['event_dispatcher'] = $this->app->make('GoogleMoviesClient\\Laravel\\Adapters\\EventDispatcherAdapter');
         return new Client($options);
     });
 }

作者:sdh100shau    项目:gatekeepe   
/**
  * 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);
 }

作者:laravelflar    项目:flar   
/**
  * Create a new service provider instance.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  */
 public function __construct($app)
 {
     parent::__construct($app);
     $this->app->singleton('flare', function ($app) {
         return $app->make(\LaravelFlare\Flare\Flare::class, [$app]);
     });
 }

作者:eurobo    项目:construc   
/**
  * 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';
 }

作者:munz    项目:localit   
/**
  * Service provider constructor method.
  *
  * @param \Illuminate\Support\Facades\App $app
  * @return void
  */
 public function __construct($app)
 {
     parent::__construct($app);
     $this->providers = config('locality.providers', []);
     $this->aliases = config('locality.aliases', []);
     $this->aliasLoader = AliasLoader::getInstance();
 }

作者:lodui    项目:artisa   
/**
  * Crea a new instance of console
  *
  * @param string $basePath
  */
 public function __construct($basePath)
 {
     parent::__construct(new Application($basePath));
     $this->input = new ArgvInput();
     $this->output = new ConsoleOutput();
     $this->config = $this->getConfiguration($basePath);
 }

作者:PhonemeCm    项目:cm   
public function __construct(Application $app, Router $router, View $view)
 {
     parent::__construct($app);
     $this->app = $app;
     $this->router = $router;
     $this->view = $view;
 }

作者:delatbabe    项目:site-confi   
/**
  * 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');
 }

作者:edvinaskruca    项目:rbaut   
/**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     parent::boot();
     $this->package('edvinaskrucas/rbauth');
     $this->extendAuth();
     $this->registerFilters();
 }

作者:MarkVaugh    项目:illuminate   
/**
  * Create a new service provider instance.
  *
  * @param Application $app
  *
  * @throws LackOfCoffeeException
  */
 public function __construct(Application $app)
 {
     parent::__construct($app);
     if ($this->defer === null) {
         throw new LackOfCoffeeException('Please define whether this provider should be deferred or not.');
     }
 }

作者:belhard-use    项目:group   
/**
  * 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);
 }

作者:delatbabe    项目:applo   
/**
  * 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
         }
     });
 }

作者:arcanede    项目:workbenc   
/**
  * The constructor.
  *
  * @param Application $app
  * @param string      $name
  * @param string      $path
  */
 public function __construct(Application $app, $name, $path)
 {
     parent::__construct($app);
     $this->setName($name);
     $this->setPath(realpath($path));
     $this->setDispatcher($app['events']);
 }

作者:khanhpn    项目:sbd   
public function __construct($app)
 {
     parent::__construct($app);
     $this->houseModel = new House();
     $this->projectModel = new Project();
     $this->designModel = new Design();
 }

作者:npmwe    项目:php-env-loade   
/**
  * 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();
 }


问题


面经


文章

微信
公众号

扫码关注公众号