当前位置: 首页>>代码示例>>PHP>>正文


PHP Config::set方法代码示例

本文整理汇总了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);
 }
开发者ID:tokenly,项目名称:counterparty-sender,代码行数:7,代码来源:CounterpartySenderServiceProvider.php

示例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');
 }
开发者ID:inakianduaga,项目名称:eloquent-external-storage,代码行数:10,代码来源:AwsS3Test.php

示例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);
 }
开发者ID:remimetral,项目名称:laravel,代码行数:38,代码来源:LangAutoDetection.php

示例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');
 }
开发者ID:etiennemarais,项目名称:legit,代码行数:10,代码来源:TestCase.php

示例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);
 }
开发者ID:tokenly,项目名称:insight-client,代码行数:7,代码来源:InsightServiceProvider.php

示例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();
 }
开发者ID:nagyistoce,项目名称:thumbnail-maker,代码行数:30,代码来源:ThumbMakerService.php

示例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);
 }
开发者ID:tokenly,项目名称:consul-health-daemon,代码行数:7,代码来源:ConsulHealthDaemonServiceProvider.php

示例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;
 }
开发者ID:fodorxyz,项目名称:fodor,代码行数:12,代码来源:TestCase.php

示例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));
 }
开发者ID:inakianduaga,项目名称:eloquent-external-storage,代码行数:10,代码来源:FileTest.php

示例10: bindConfig

 protected function bindConfig()
 {
     // simple config
     $config = ['bitcoin-address-lib.seed' => env('BITCOIN_MASTER_KEY')];
     // set the laravel config
     Config::set($config);
 }
开发者ID:tokenly,项目名称:bitcoin-address-lib,代码行数:7,代码来源:BitcoinAddressServiceProvider.php

示例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);
 }
开发者ID:bagosii,项目名称:laravel-theme,代码行数:29,代码来源:Themes.php

示例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'));
 }
开发者ID:marchie,项目名称:lad-utils,代码行数:8,代码来源:AzureOptimizeClassesTest.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));
     }
 }
开发者ID:robbytaylor,项目名称:boom-core,代码行数:12,代码来源:Config.php

示例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);
 }
开发者ID:tokenly,项目名称:xcaller-client,代码行数:7,代码来源:XCallerClientServiceProvider.php

示例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;
 }
开发者ID:tokenly,项目名称:xchain-client,代码行数:8,代码来源:XChainServiceProvider.php


注:本文中的Illuminate\Support\Facades\Config::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。