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


PHP Repository::has方法代码示例

本文整理汇总了PHP中Illuminate\Config\Repository::has方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::has方法的具体用法?PHP Repository::has怎么用?PHP Repository::has使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Config\Repository的用法示例。


在下文中一共展示了Repository::has方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  *
  * @param \Illuminate\Config\Repository $config
  * @param \Illuminate\Filesystem\Filesystem $files
  * @param \Illuminate\View\Factory $view
  * @param string $publicPath
  */
 public function __construct(ConfigRepository $config, Filesystem $files, $view, $publicPath)
 {
     $this->config = $config;
     $this->files = $files;
     $this->view = $view;
     $this->public_path = $publicPath;
     $this->showWarnings = $this->config->get('laravel-dompdf::show_warnings', false);
     //To prevent old configs from not working..
     if ($this->config->has('laravel-dompdf::paper')) {
         $this->paper = $this->config->get('laravel-dompdf::paper');
     } else {
         $this->paper = DOMPDF_DEFAULT_PAPER_SIZE;
     }
     $this->orientation = $this->config->get('laravel-dompdf::orientation') ?: 'portrait';
     $this->dompdf = new \DOMPDF();
     $this->dompdf->set_base_path(realpath($publicPath));
 }
开发者ID:heruujoko,项目名称:tsel-net-management,代码行数:24,代码来源:PDF.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: setEnvironment

 protected function setEnvironment()
 {
     if ($this->config->has('custom.environment')) {
         $this->environment = $this->config->get('custom.environment');
     } else {
         $this->environment = $this->config->get('general.environment');
     }
 }
开发者ID:jrijnaars,项目名称:PHP-project,代码行数:8,代码来源:DefaultSelenium.php

示例4: configure

 /**
  * Init configuration
  *
  * @return void
  */
 protected function configure()
 {
     if ($this->config->has('sphinx_search')) {
         foreach ($this->config->get('sphinx_search') as $key => $val) {
             $key = $this->camel($key);
             $this->{$key} = $val;
         }
     }
 }
开发者ID:euclid1990,项目名称:php-sphinx-search,代码行数:14,代码来源:SphinxSearch.php

示例5: store

 /**
  * Cache the passed response
  *
  * @param  \Illuminate\Routing\Route                    $route
  * @param  \Illuminate\Http\Request                     $request
  * @param  \Symfony\Component\HttpFoundation\Response   $response
  *
  * @return void
  */
 public function store(Route $route, Request $request, Response $response)
 {
     if ($ttl = $this->ttl) {
         $key = $this->makeCacheKey($request);
         if (!$this->cache->has($key)) {
             $cacheable = $this->serializeResponse($response);
             $this->cache->put($key, $cacheable, $ttl);
         }
     }
 }
开发者ID:mintbridge,项目名称:laravel-cache-filter,代码行数:19,代码来源:ResponseCacheFilter.php

示例6: loadSource

 /**
  *  Load the messages for the given locale.
  *
  *  @param  string  $locale
  *  @param  string  $group
  *  @param  string  $namespace
  *  @return array
  */
 public function loadSource($locale, $group, $namespace = '*')
 {
     if ($this->cache->has($locale, $group, $namespace)) {
         return $this->cache->get($locale, $group, $namespace);
     } else {
         $source = $this->fallback->load($locale, $group, $namespace);
         $this->cache->put($locale, $group, $namespace, $source, $this->cacheTimeout);
         return $source;
     }
 }
开发者ID:MarkRedeman,项目名称:translation,代码行数:18,代码来源:CacheLoader.php

示例7: __construct

 public function __construct(Config $config, SessionStore $session)
 {
     if ($config->has('ttwitter::config')) {
         $this->tconfig = $config->get('ttwitter::config');
     } else {
         if ($config->get('ttwitter')) {
             $this->tconfig = $config->get('ttwitter');
         } else {
             throw new Exception('No config found');
         }
     }
     $this->debug = isset($this->tconfig['debug']) && $this->tconfig['debug'] ? true : false;
     $this->parent_config = [];
     $this->parent_config['consumer_key'] = $this->tconfig['CONSUMER_KEY'];
     $this->parent_config['consumer_secret'] = $this->tconfig['CONSUMER_SECRET'];
     $this->parent_config['token'] = $this->tconfig['ACCESS_TOKEN'];
     $this->parent_config['secret'] = $this->tconfig['ACCESS_TOKEN_SECRET'];
     if ($session->has('access_token')) {
         $access_token = $session->get('access_token');
         if (is_array($access_token) && isset($access_token['oauth_token']) && isset($access_token['oauth_token_secret']) && !empty($access_token['oauth_token']) && !empty($access_token['oauth_token_secret'])) {
             $this->parent_config['token'] = $access_token['oauth_token'];
             $this->parent_config['secret'] = $access_token['oauth_token_secret'];
         }
     }
     $this->parent_config['use_ssl'] = $this->tconfig['USE_SSL'];
     $this->parent_config['user_agent'] = 'LTTW ' . parent::VERSION;
     $config = array_merge($this->parent_config, $this->tconfig);
     parent::__construct($this->parent_config);
 }
开发者ID:thujohn,项目名称:twitter,代码行数:29,代码来源:Twitter.php

示例8: extractProperties

 /**
  * @param Repository $config
  */
 protected function extractProperties(Repository $config)
 {
     if ($config->has(self::REPOSITORY_KEY)) {
         $data = $config->get(self::REPOSITORY_KEY);
         $this->properties = $data['properties'][$data['use']];
     }
 }
开发者ID:CodeYellowBV,项目名称:laravel-amqp,代码行数:10,代码来源:Context.php

示例9: getCacheLocale

 /**
  * Retrieves a cached locale from the specified locale code.
  *
  * @param string $code
  *
  * @return bool
  */
 protected function getCacheLocale($code)
 {
     $id = sprintf('translation.%s', $code);
     if ($this->cache->has($id)) {
         return $this->cache->get($id);
     }
     return false;
 }
开发者ID:mohamedsharaf,项目名称:translation-1,代码行数:15,代码来源:Translation.php

示例10: configure

 /**
  * @param string $config
  * @return void
  */
 protected function configure($config)
 {
     if ($this->config->has('captcha.' . $config)) {
         foreach ($this->config->get('captcha.' . $config) as $key => $val) {
             $this->{$key} = $val;
         }
     }
 }
开发者ID:diandianxiyu,项目名称:ApiTesting,代码行数:12,代码来源:Captcha.php

示例11: 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());
     // Create HTMLPurifier object
     $this->purifier = new HTMLPurifier($this->configure($config));
 }
开发者ID:AjansEsperto,项目名称:Purifier,代码行数:24,代码来源:Purifier.php

示例12: __call

 /**
  * Handle dynamic method calls into the model.
  *
  * @param  string  $method
  * @param  array  $parameters
  * @return mixed
  */
 public function __call($method, $parameters)
 {
     $className = class_basename($this);
     $config = implode('.', ['relationship', $className, $method]);
     if (Config::has($config)) {
         $function = Config::get($config);
         return $function($this);
     }
     return parent::__call($method, $parameters);
 }
开发者ID:xKairu,项目名称:repository,代码行数:17,代码来源:Model.php

示例13: availableLocales

 /**
  *  Returns a list of all available locales.
  *
  *  @return array
  */
 public function availableLocales()
 {
     if ($this->config->has('translator.locales')) {
         return $this->config->get('translator.locales');
     }
     if ($this->tableExists()) {
         $locales = $this->model->distinct()->get()->pluck('locale')->toArray();
         $this->config->set('translator.locales', $locales);
         return $locales;
     }
     return $this->defaultAvailableLocales;
 }
开发者ID:waavi,项目名称:translation,代码行数:17,代码来源:LanguageRepository.php

示例14: getLaravelConfigValue

 /**
  * Retrieves a configuration value from Laravel.
  *
  * @param $option
  * @return mixed
  */
 protected function getLaravelConfigValue($option)
 {
     $option = implode('.', (array) $option);
     // Laravel 5
     $optionKey = self::PACKAGE_CONFIG_NAMESPACE . '.' . $option;
     if ($this->laravelConfig->has($optionKey)) {
         return $this->laravelConfig->get($optionKey);
     }
     // Laravel 4
     $optionKey = self::PACKAGE_CONFIG_NAMESPACE . '::' . $option;
     return $this->laravelConfig->get($optionKey);
 }
开发者ID:MattStypa,项目名称:LaravelFeature,代码行数:18,代码来源:FeatureConnector.php

示例15: configure

 /**
  *
  * @param string $config        	
  * @return void
  */
 protected function configure($config, $formId = false)
 {
     if ($this->config->has('captcha.' . $config)) {
         foreach ($this->config->get('captcha.' . $config) as $key => $val) {
             $this->{$key} = $val;
         }
     }
     if ($formId !== false) {
         $this->formId = $formId;
     } elseif ($this->unique) {
         $this->formId = $this->str->random(32);
     }
 }
开发者ID:votong,项目名称:captcha,代码行数:18,代码来源:Captcha.php


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