當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Repository::set方法代碼示例

本文整理匯總了PHP中Illuminate\Config\Repository::set方法的典型用法代碼示例。如果您正苦於以下問題:PHP Repository::set方法的具體用法?PHP Repository::set怎麽用?PHP Repository::set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Config\Repository的用法示例。


在下文中一共展示了Repository::set方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCacheConfiguredBy

 /**
  * Configures cache for test-suites.
  *
  * @param Repository $config
  */
 protected function getCacheConfiguredBy(Repository $config)
 {
     // Configuration for Redis.
     $config->set('cache.stores.redis', ['cluster' => false, 'test_connection' => ['host' => '127.0.0.1', 'port' => 6379, 'database' => 0]]);
     // Configuration for Redis.
     $config->set('yacache', ['driver' => 'redis', 'default' => 'redis', 'connection' => 'test_connection', 'prefix' => 'prefix', 'codec' => 'Illuminate\\YetAnother\\Cache\\Serializer\\Codec\\MsgPack']);
 }
開發者ID:shingoOKAWA,項目名稱:yacache-l5-php,代碼行數:12,代碼來源:IlluminateEnvironment.php

示例2: setUp

 /**
  * Setup
  *
  * @throws Exception
  */
 private function setUp()
 {
     if (!$this->config->has('purifier')) {
         if (!$this->config->has('mews.purifier')) {
             throw new Exception('Configuration parameters not loaded!');
         }
         $this->config->set('purifier', $this->config->get('mews.purifier'));
     }
     $this->checkCacheDirectory();
     // Create a new configuration object
     $config = HTMLPurifier_Config::createDefault();
     // Allow configuration to be modified
     if (!$this->config->get('purifier.finalize')) {
         $config->autoFinalize = false;
     }
     $config->loadArray($this->getConfig());
     if ($def = $config->maybeGetRawHTMLDefinition()) {
         if ($addElement = $this->config->get('purifier.addElement')) {
             foreach ($addElement as $item) {
                 call_user_func_array(array($def, "addElement"), $item);
             }
         }
         if ($addAttribute = $this->config->get('purifier.addAttribute')) {
             foreach ($addAttribute as $item) {
                 call_user_func_array(array($def, "addAttribute"), $item);
             }
         }
     }
     // Create HTMLPurifier object
     $this->purifier = new HTMLPurifier($config);
 }
開發者ID:petercsoka,項目名稱:Purifier,代碼行數:36,代碼來源:Purifier.php

示例3: handle

 /**
  * Handle the event.
  */
 public function handle()
 {
     if ($locale = $this->preferences->get('streams::locale')) {
         $this->application->setLocale($locale);
         $this->config->set('app.locale', $locale);
     }
 }
開發者ID:AkibaTech,項目名稱:preferences-module,代碼行數:10,代碼來源:SetLocale.php

示例4: handleDetectionComplete

 /**
  * This is what happens, wenn the detection passes
  *
  * @param $lookup
  *
  * @return mixed
  */
 protected function handleDetectionComplete($lookup)
 {
     debugger()->info('Language detected: ' . $this->detected->slug);
     Cookie::queue($this->keys['cookie'], $this->detected->slug);
     $this->session->set($this->keys['session'], $this->detected->slug);
     $this->config->set('app.locale', $this->detected->slug);
     return $this->detected;
 }
開發者ID:wegnermedia,項目名稱:melon,代碼行數:15,代碼來源:CurrentLanguageDetector.php

示例5: validate

 /**
  * {@inheritdoc}
  */
 public function validate()
 {
     $challenge = $this->request->get('recaptcha_challenge_field');
     $value = $this->request->get('recaptcha_response_field');
     if (empty($challenge) || empty($value)) {
         return false;
     }
     // Dirty hack to make use of our key instead of the config one
     $this->config->set('recaptcha.private_key', $this->settings->get('captcha.recaptcha_private_key'));
     return $this->service->check($challenge, $value);
 }
開發者ID:Adamzynoni,項目名稱:mybb2,代碼行數:14,代碼來源:CaptchaRecaptcha.php

示例6: validate

 /**
  * {@inheritdoc}
  */
 public function validate()
 {
     $value = $this->request->get('g-recaptcha-response');
     if (empty($value)) {
         return false;
     }
     // Dirty hack to make use of our key instead of the config one
     $this->config->set('recaptcha.private_key', $this->settings->get('captcha.nocaptcha_private_key'));
     $this->config->set('recaptcha.driver', 'curl');
     return $this->service->check(null, $value);
 }
開發者ID:Adamzynoni,項目名稱:mybb2,代碼行數:14,代碼來源:CaptchaNocaptcha.php

示例7: handle

 /**
  * Handle the command.
  *
  * @param Application                   $app
  * @param Repository                    $config
  * @param Request                       $request
  * @param PreferenceRepositoryInterface $preferences
  */
 function handle(Application $app, Repository $config, Request $request, PreferenceRepositoryInterface $preferences)
 {
     // Set using admin locale if in admin.
     if ($request->segment(1) === 'admin' && ($locale = $preferences->get('streams::admin_locale'))) {
         $app->setLocale($locale->getValue());
         $config->set('app.locale', $locale->getValue());
     }
     // Set using public locale if NOT in admin.
     if (!defined('LOCALE') && $request->segment(1) !== 'admin' && ($locale = $preferences->get('streams::public_locale'))) {
         $app->setLocale($locale->getValue());
         $config->set('app.locale', $locale->getValue());
     }
 }
開發者ID:visualturk,項目名稱:preferences-module,代碼行數:21,代碼來源:SetLocale.php

示例8: setUp

 protected function setUp()
 {
     $this->config = new \Illuminate\Config\Repository();
     $filesystem = new \Illuminate\Filesystem\Filesystem();
     $items = $filesystem->getRequire(__DIR__ . '/config/config.php');
     $this->config->set("ytake-laravel-smarty", $items);
     new \Illuminate\Config\Repository();
     $viewFinder = new \Illuminate\View\FileViewFinder($filesystem, ['views'], ['.tpl']);
     $this->factory = new \Ytake\LaravelSmarty\SmartyFactory(new \Illuminate\View\Engines\EngineResolver(), $viewFinder, new \Illuminate\Events\Dispatcher(), new Smarty(), $this->config);
     $this->factory->setSmartyConfigure();
     $this->factory->addSmartyExtension();
     $this->factory->resolveSmartyCache();
 }
開發者ID:noikiy,項目名稱:Laravel.Smarty,代碼行數:13,代碼來源:TestCase.php

示例9: let

 function let(Application $app, Repository $cfg)
 {
     $cfg->get(Argument::type('string'), Argument::any())->willReturn([]);
     $cfg->set(Argument::type('string'), Argument::any())->willReturn([]);
     $app->offsetGet('config')->willReturn($cfg);
     $this->beConstructedWith($app);
 }
開發者ID:AtlasCM,項目名稱:Core,代碼行數:7,代碼來源:CoreServiceProviderSpec.php

示例10: handle

 /**
  * Handle the command.
  *
  * @param Repository                    $config
  * @param PreferenceRepositoryInterface $preferences
  */
 function handle(Repository $config, PreferenceRepositoryInterface $preferences)
 {
     // Set the timezone.
     if ($timezone = $preferences->get('streams::timezone')) {
         $config->set('app.timezone', $timezone->getValue());
         $config->set('streams::datetime.timezone', $timezone->getValue());
     }
     // Set the date format.
     if ($format = $preferences->get('streams::date_format')) {
         $config->set('streams::datetime.date_format', $format->getValue());
     }
     // Set the time format.
     if ($format = $preferences->get('streams::time_format')) {
         $config->set('streams::datetime.time_format', $format->getValue());
     }
 }
開發者ID:visualturk,項目名稱:preferences-module,代碼行數:22,代碼來源:SetDatetime.php

示例11: globalTextStyle

 /**
  * Enables/Disables Global Text Styles
  *
  * @param boolean $enabled
  * @param textStyle $globalTextStyle
  */
 public static function globalTextStyle(boolean $enabled, textStyle $globalTextStyle = NULL)
 {
     $this->config->set('lavacharts::globalTextStyleEnabled', $enabled);
     if (!is_null($globalTextStyle)) {
         $this->config->set('lavacharts::globalTextStyle', $globalTextStyle);
     }
 }
開發者ID:hilmysyarif,項目名稱:l4-bootstrap-admin,代碼行數:13,代碼來源:Lavacharts.php

示例12: getConfig

 private function getConfig()
 {
     $applicationConfig = (include __DIR__ . '/AppConfig.php');
     $packageConfig = (include __DIR__ . '/../../config/culpa.php');
     $packageConfig['users']['classname'] = User::class;
     $applicationRepository = new Repository($applicationConfig);
     $applicationRepository->set('culpa', $packageConfig);
     return $applicationRepository;
 }
開發者ID:nstapelbroek,項目名稱:culpa-laravel-5,代碼行數:9,代碼來源:AppFactory.php

示例13: setUp

 protected function setUp()
 {
     $this->config = new \Illuminate\Config\Repository();
     $filesystem = new \Illuminate\Filesystem\Filesystem();
     $items = $filesystem->getRequire(__DIR__ . '/config/config.php');
     $this->config->set("ytake-laravel-smarty", $items);
     new \Illuminate\Config\Repository();
     $viewFinder = new \Illuminate\View\FileViewFinder($filesystem, ['views'], ['.tpl']);
     $this->factory = new \Ytake\LaravelSmarty\SmartyFactory(new \Illuminate\View\Engines\EngineResolver(), $viewFinder, new \Illuminate\Events\Dispatcher(), new Smarty(), $this->config);
     $this->factory->setSmartyConfigure();
     $this->factory->resolveSmartyCache();
     $extension = $this->config->get('ytake-laravel-smarty.extension', 'tpl');
     $this->factory->addExtension($extension, 'smarty', function () {
         // @codeCoverageIgnoreStart
         return new \Ytake\LaravelSmarty\Engines\SmartyEngine($this->factory->getSmarty());
         // @codeCoverageIgnoreEnd
     });
 }
開發者ID:shinichi81,項目名稱:Laravel.Smarty,代碼行數:18,代碼來源:TestCase.php

示例14: set

 /**
  * @param string $key
  * @param mixed $value
  * @return $this|Larfing
  */
 public function set($key, $value)
 {
     parent::set($key, $value);
     if ($this->setting['queue'] === false) {
         return $this->put($key);
     }
     $this->_put[implode('', array_slice($this->parseKey($key), 0, 2))] = $key;
     return $this;
 }
開發者ID:the-hasanov,項目名稱:larfing,代碼行數:14,代碼來源:Larfing.php

示例15: bindCoreClasses

 /**
  * Bind the core classes to the container
  */
 protected function bindCoreClasses()
 {
     // Bind request
     $this->app->bindIf('request', function () {
         return Request::createFromGlobals();
     });
     // Bind config
     $this->app->bindIf('config', function ($app) {
         $fileloader = new ConfigLoader($app['files'], __DIR__ . '/../');
         $config = new Repository($fileloader, 'config');
         $config->set('cache.driver', 'file');
         $config->set('cache.path', __DIR__ . '/../../cache');
         return $config;
     }, true);
     // Bind cache
     $this->app->bindIf('cache', function ($app) {
         return new CacheManager($app);
     });
 }
開發者ID:bberlijn,項目名稱:flatten,代碼行數:22,代碼來源:FlattenServiceProvider.php


注:本文中的Illuminate\Config\Repository::set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。