本文整理汇总了PHP中Illuminate\Foundation\Application::loadEnvironmentFrom方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::loadEnvironmentFrom方法的具体用法?PHP Application::loadEnvironmentFrom怎么用?PHP Application::loadEnvironmentFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Foundation\Application
的用法示例。
在下文中一共展示了Application::loadEnvironmentFrom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEnvironmentSetUp
/**
* Define environment setup.
*
* @param \Illuminate\Foundation\Application $app
* @return void
*/
protected function getEnvironmentSetUp($app)
{
$env = __DIR__ . '/../.env';
if (is_readable($env) && is_file($env)) {
$app->loadEnvironmentFrom('../../../../.env');
$app->make('Illuminate\\Foundation\\Bootstrap\\DetectEnvironment')->bootstrap($app);
}
$app['config']->set('services.viva', ['api_key' => env('VIVA_API_KEY', str_random()), 'merchant_id' => env('VIVA_MERCHANT_ID', str_random()), 'public_key' => env('VIVA_PUBLIC_KEY', str_random()), 'environment' => env('VIVA_ENVIRONMENT', 'demo')]);
}
示例2: createApplication
public function createApplication()
{
$app = new Application(__DIR__ . '/../stub');
$app->instance('path', '');
$app->instance('path.base', '');
$app->instance('path.storage', '');
$app->instance('config', new Config());
$app->loadEnvironmentFrom(__DIR__ . '/../examples/' . '.env');
(new DetectEnvironment())->bootstrap($app);
return $app;
}
示例3: loadEnvironmentFrom
/**
* Set the environment file to be loaded during bootstrapping.
*
* @param string $file
* @return $this
* @static
*/
public static function loadEnvironmentFrom($file)
{
return \Illuminate\Foundation\Application::loadEnvironmentFrom($file);
}