isInstalled() public static method

public static isInstalled ( )
コード例 #1
0
ファイル: AuthServiceProvider.php プロジェクト: fluxbb/core
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app->singleton('Illuminate\\Contracts\\Auth\\Guard', function () {
         $hasher = $this->app->make('Illuminate\\Contracts\\Hashing\\Hasher');
         $session = $this->app->make('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface');
         $provider = new EloquentUserProvider($hasher, 'FluxBB\\Models\\User');
         $guard = new Guard($provider, $session);
         $guard->setCookieJar($this->app->make('Illuminate\\Contracts\\Cookie\\QueueingFactory'));
         $guard->setDispatcher($this->app->make('Illuminate\\Contracts\\Events\\Dispatcher'));
         $guard->setRequest($this->app->make('Symfony\\Component\\HttpFoundation\\Request'));
         return $guard;
     });
     if (Core::isInstalled()) {
         $this->app->extend('view', function ($view) {
             $view->share('user', $this->app->make('Illuminate\\Contracts\\Auth\\Guard')->user());
             return $view;
         });
     }
 }
コード例 #2
-1
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app->singleton('Illuminate\\Database\\ConnectionInterface', function () {
         $factory = new ConnectionFactory($this->app);
         $connection = $factory->make($this->app['config']->get('fluxbb.database'));
         $connection->setEventDispatcher($this->app->make('Illuminate\\Contracts\\Events\\Dispatcher'));
         $connection->setFetchMode(PDO::FETCH_CLASS);
         return $connection;
     });
     $this->app->singleton('Illuminate\\Database\\ConnectionResolverInterface', function () {
         $resolver = new ConnectionResolver(['fluxbb' => $this->app->make('Illuminate\\Database\\ConnectionInterface')]);
         $resolver->setDefaultConnection('fluxbb');
         return $resolver;
     });
     if (Core::isInstalled()) {
         $this->app->booting(function () {
             $resolver = $this->app->make('Illuminate\\Database\\ConnectionResolverInterface');
             Model::setConnectionResolver($resolver);
         });
     }
 }