Example #1
0
 /**
  * Detect if a custom environment file matching the APP_ENV exists.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @return void
  */
 protected function checkForSpecificEnvironmentFile($app)
 {
     if (!env('APP_ENV')) {
         return;
     }
     $file = $app->environmentFile() . '.' . env('APP_ENV');
     if (file_exists($app->environmentPath() . '/' . $file)) {
         $app->loadEnvironmentFrom($file);
     }
 }
Example #2
0
 /**
  * Bootstrap the given application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @return void
  */
 public function bootstrap(Application $app)
 {
     if (!$app->configurationIsCached()) {
         try {
             (new Dotenv($app->environmentPath(), $app->environmentFile()))->load();
         } catch (InvalidArgumentException $e) {
             //
         }
     }
 }
 /**
  * Bootstrap the given application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @return void
  */
 public function bootstrap(Application $app)
 {
     try {
         Dotenv::load($app->environmentPath(), $app->environmentFile());
     } catch (InvalidArgumentException $e) {
         //
     }
     $app->detectEnvironment(function () {
         return env('APP_ENV', 'production');
     });
 }
 /**
  * Bootstrap the given application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 public function bootstrap(Application $app)
 {
     $app->detectEnvironment(function () {
         return env('APP_ENV', 'production');
     });
     if (!$app->configurationIsCached()) {
         try {
             (new Dotenv($app->environmentPath(), $app->environmentFile()))->load();
         } catch (InvalidPathException $e) {
             //
         }
     }
 }
Example #5
0
 /**
  * Detect if a custom environment file matching the APP_ENV exists.
  *
  * @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $app
  *
  * @return void
  */
 protected function checkForSpecificEnvironmentFile($app)
 {
     if (php_sapi_name() == 'cli') {
         $input = new ArgvInput();
         if ($input->hasParameterOption('--env')) {
             $file = $app->environmentFile() . '.' . $input->getParameterOption('--env');
             $this->loadEnvironmentFile($app, $file);
         }
     }
     if (!env('APP_ENV')) {
         return;
     }
     if (empty($file)) {
         $file = $app->environmentFile() . '.' . env('APP_ENV');
         $this->loadEnvironmentFile($app, $file);
     }
 }
 /**
  * Bootstrap the given application.
  *
  * @param Application $app
  */
 public function bootstrap(Application $app)
 {
     // Attempt to load the default .env
     try {
         Dotenv::load($app->environmentPath(), $app->environmentFile());
     } catch (InvalidArgumentException $e) {
         //
     }
     // Attempt to load the environment-specific .env
     try {
         Dotenv::load($app->environmentPath(), vsprintf('.%s.env', [env('APP_ENV', static::DEFAULT_ENVIRONMENT)]));
     } catch (InvalidArgumentException $e) {
         //
     }
     $app->detectEnvironment(function () {
         return env('APP_ENV', static::DEFAULT_ENVIRONMENT);
     });
 }