本文整理匯總了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);
}