Пример #1
0
 /**
  * Set the directory for the environment file.
  *
  * @param string $path
  * @return $this 
  * @static 
  */
 public static function useEnvironmentPath($path)
 {
     return \Illuminate\Foundation\Application::useEnvironmentPath($path);
 }
Пример #2
0
 /**
  * @param string                 $basePath The application base path
  * @param ProvidesCapsulePattern $pattern  The capsule pattern
  *
  * @return \Illuminate\Foundation\Application
  */
 protected function bootstrapPattern($basePath, $pattern)
 {
     //  Get the app's autoloader
     /** @noinspection PhpIncludeInspection */
     require Disk::path([$basePath, 'vendor', 'autoload.php']);
     //  Create the application
     $_app = new Application($basePath);
     $_app->useEnvironmentPath($basePath);
     foreach ($pattern as $_abstract => $_concrete) {
         $_app->singleton($_abstract, $_concrete);
     }
     //  Set up logging
     $_app->configureMonologUsing(function (Logger $monolog) {
         $_logFile = Disk::path([env('DFE_CAPSULE_LOG_PATH', storage_path('logs')), $this->instanceId . '.log']);
         $_handler = new StreamHandler($_logFile);
         $_handler->setFormatter(new LineFormatter(null, null, true, true));
         $monolog->pushHandler($_handler);
     });
     $this->basePath = $basePath;
     return $this->app = $_app;
 }