Файл: gapps/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php
Строк: 72
<?php
namespace IlluminateFoundationBootstrap;
use DotenvDotenv;
use DotenvExceptionInvalidPathException;
use IlluminateContractsFoundationApplication;
class DetectEnvironment
{
/**
* Bootstrap the given application.
*
* @param IlluminateContractsFoundationApplication $app
* @return void
*/
public function bootstrap(Application $app)
{
if (! $app->configurationIsCached()) {
$this->checkForSpecificEnvironmentFile($app);
try {
(new Dotenv($app->environmentPath(), $app->environmentFile()))->load();
} catch (InvalidPathException $e) {
//
}
}
}
/**
* Detect if a custom environment file matching the APP_ENV exists.
*
* @param IlluminateContractsFoundationApplication $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);
}
}
}