本文整理汇总了PHP中Illuminate\Support\Facades\Config::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::set方法的具体用法?PHP Config::set怎么用?PHP Config::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Config
的用法示例。
在下文中一共展示了Config::set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bindConfig
protected function bindConfig()
{
// simple config
$config = ['counterparty-sender.connection_string' => env('NATIVE_CONNECTION_STRING', 'http://localhost:8332'), 'counterparty-sender.rpc_user' => env('NATIVE_RPC_USER', null), 'counterparty-sender.rpc_password' => env('NATIVE_RPC_PASSWORD', null)];
// set the laravel config
Config::set($config);
}
示例2: refreshDriver
/**
* Sets a clean storage driver with configuration & credentials read from environment
*/
private function refreshDriver()
{
Config::set('mocked.config.key', array('key' => getenv('AWS_S3_KEY'), 'secret' => getenv('AWS_S3_SECRET'), 'region' => getenv('AWS_S3_REGION'), 's3Bucket' => getenv('AWS_S3_BUCKET'), 's3BucketSubfolder' => getenv('AWS_S3_BUCKET_SUBFOLDER')));
// Inject new file driver and mock config
$this->storageDriver = new StorageDriver();
$this->storageDriver->setConfigKey('mocked.config.key');
}
示例3: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string $l
* @return mixed
*/
public function handle($request, Closure $next)
{
//Session::flush();
if (!Session::has('locale')) {
/**
* Get the browser local code and lang code.
*/
$localCode = $request->getPreferredLanguage();
$localLang = substr($localCode, 0, 2);
if (in_array($localLang, $this->lang)) {
Session::set('locale', $localLang);
} else {
Session::set('locale', Config::get('app.locale'));
}
}
/**
* Set the local config.
*/
App::setLocale(Session::get('locale'));
Config::set('app.locale', Session::get('locale'));
/**
* Share variables in view.
*/
if (Config::get('app.locale') == 'fr') {
View::share(['lang' => 'fr', 'langreverse' => 'en']);
} else {
View::share(['lang' => 'en', 'langreverse' => 'fr']);
}
return $next($request);
}
示例4: setupCountryDependency
/**
* Sets up the basic country dependency that gets used all over the app.
*/
protected function setupCountryDependency()
{
factory(\Legit\Countries\Country::class)->create();
// Set the testing country tenant identifier.
app('Infrastructure\\TenantScope\\TenantScope')->addTenant('country_id', 1);
Config::set('country_iso', 'ZA');
}
示例5: bindConfig
protected function bindConfig()
{
// simple config
$config = ['insight.connection_string' => env('INSIGHT_CONNECTION_STRING', 'http://localhost:3000')];
// set the laravel config
Config::set($config);
}
示例6: handle
public function handle($payload)
{
$this->folder = $payload['folder'];
$this->cleanUp();
if (isset($payload['bucket'])) {
Config::set('S3_BUCKET', $payload['bucket']);
}
if (isset($payload['region'])) {
Config::set('S3_REGION', $payload['region']);
}
if (isset($payload['secret'])) {
Config::set('S3_SECRET', $payload['secret']);
}
if (isset($payload['key'])) {
Config::set('S3_KEY', $payload['key']);
}
if (isset($payload['destination'])) {
$this->thumbnail_destination = $payload['destination'];
} else {
$this->thumbnail_destination = base_path("storage");
}
if (!Storage::exists($this->thumbnail_destination)) {
Storage::makeDirectory($this->thumbnail_destination, 0755, true);
}
$files = Storage::disk('s3')->allFiles($this->folder);
Log::info(print_r($files, 1));
$this->getAndMake($files);
$this->uploadFilesBacktoS3();
$this->cleanUp();
}
示例7: bindConfig
protected function bindConfig()
{
$prefix = rtrim(env('CONSUL_HEALTH_SERVICE_ID_PREFIX', 'generic'), '_') . '_';
$config = ['consul-health.consul_url' => env('CONSUL_URL', 'http://consul.service.consul:8500'), 'consul-health.health_service_id' => env('CONSUL_HEALTH_SERVICE_ID', $prefix . 'monitor_health'), 'consul-health.loop_delay' => env('CONSUL_LOOP_DELAY', 15), 'consul-health.service_id_prefix' => $prefix];
// set the laravel config
Config::set($config);
}
示例8: createApplication
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = (require __DIR__ . '/../bootstrap/app.php');
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
\Illuminate\Support\Facades\Config::set('fodor.enable_time_estimates', false);
return $app;
}
示例9: refreshDriver
/**
* Sets a clean storage driver with default substorage path
*/
private function refreshDriver()
{
// Inject new file driver and mock config
$this->fileStorageDriver = new FileDriver();
$this->fileStorageDriver->setConfigKey('mocked.config.key');
Config::set('mocked.config.key', array('storageSubfolder' => $this->fileStorageFolderRelativeToStoragePath));
}
示例10: bindConfig
protected function bindConfig()
{
// simple config
$config = ['bitcoin-address-lib.seed' => env('BITCOIN_MASTER_KEY')];
// set the laravel config
Config::set($config);
}
示例11: set
public function set($themeName)
{
if (!Config::get('themes.enabled', true)) {
return;
}
if (!($theme = $this->find($themeName))) {
$theme = $this->add(new Theme($themeName));
}
$this->activeTheme = $theme;
// Build Paths array.
// All paths are relative first entry in 'paths' array (set in views.php config file)
$paths = [];
do {
$path = $this->defaultViewsPath[0];
$path .= empty($theme->viewsPath) ? '' : '/' . $theme->viewsPath;
if (!in_array($path, $paths)) {
$paths[] = $path;
}
} while ($theme = $theme->getParent());
// fall-back to default paths (set in views.php config file)
foreach ($this->defaultViewsPath as $path) {
if (!in_array($path, $paths)) {
$paths[] = $path;
}
}
Config::set('view.paths', $paths);
$themeViewFinder = app('view.finder');
$themeViewFinder->setPaths($paths);
}
示例12: optimized_class_is_created_in_production_environment
/** @test */
public function optimized_class_is_created_in_production_environment()
{
$this->assertFileNotExists(base_path('bootstrap/cache/compiled.php'));
Config::set('app.debug', false);
Artisan::call('azure:optimize-classes');
$this->assertFileExists(base_path('bootstrap/cache/compiled.php'));
}
示例13: merge
/**
* Recursively merges a file into the boomcms config group.
*
* @param string $file
*/
public static function merge($file)
{
if (file_exists($file)) {
$config = c::get('boomcms', []);
c::set('boomcms', array_merge_recursive(include $file, $config));
}
}
示例14: bindConfig
protected function bindConfig()
{
// simple config
$config = ['xcaller-client.queue_connection' => env('XCALLER_QUEUE_CONNECTION', 'blockingbeanstalkd'), 'xcaller-client.queue_name' => env('XCALLER_QUEUE_NAME', 'notifications_out')];
// set the laravel config
Config::set($config);
}
示例15: bindConfig
protected function bindConfig()
{
// simple config
$config = ['xchain.connection_url' => env('XCHAIN_CONNECTION_URL', 'http://xchain.tokenly.co'), 'xchain.api_token' => env('XCHAIN_API_TOKEN', null), 'xchain.api_key' => env('XCHAIN_API_KEY', null)];
// set the laravel config
Config::set($config);
return $config;
}