当前位置: 首页>>代码示例>>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;未经允许,请勿转载。