本文整理汇总了PHP中Illuminate\Contracts\Foundation\Application::environmentPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::environmentPath方法的具体用法?PHP Application::environmentPath怎么用?PHP Application::environmentPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\Foundation\Application
的用法示例。
在下文中一共展示了Application::environmentPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bootstrap
/**
* 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);
});
}
示例2: checkForSpecificEnvironmentFile
/**
* 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);
}
}
示例3: bootstrap
/**
* 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) {
//
}
}
}
示例4: bootstrap
/**
* 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');
});
}
示例5: bootstrap
/**
* 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) {
//
}
}
}
示例6: loadEnvironmentFile
/**
* Load a custom environment file.
*
* @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $app
* @param string $file
*
* @return void
*/
protected function loadEnvironmentFile($app, $file)
{
if (file_exists($app->environmentPath() . '/' . $file)) {
$app->loadEnvironmentFrom($file);
}
}