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


PHP Config::isReadOnly方法代码示例

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


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

示例1: process

 /**
  * Process the whole config structure with each parser in the queue.
  *
  * @param  Config $config
  * @return Config
  * @throws Exception\InvalidArgumentException
  */
 public function process(Config $config)
 {
     if ($config->isReadOnly()) {
         throw new Exception\InvalidArgumentException('Cannot process config because it is read-only');
     }
     foreach ($this as $parser) {
         /** @var $parser ProcessorInterface */
         $parser->process($config);
     }
 }
开发者ID:leonardovn86,项目名称:zf2_basic2013,代码行数:17,代码来源:Queue.php

示例2: process

 /**
  * Process
  * 
  * @param  Config $config
  * @return Config
  * @throws Exception\InvalidArgumentException
  */
 public function process(Config $config)
 {
     if ($config->isReadOnly()) {
         throw new Exception\InvalidArgumentException('Cannot process config because it is read-only');
     }
     /**
      * Walk through config and replace values
      */
     foreach ($config as $key => $val) {
         if ($val instanceof Config) {
             $this->process($val);
         } else {
             $config->{$key} = $this->filter->filter($val);
         }
     }
     return $config;
 }
开发者ID:navassouza,项目名称:zf2,代码行数:24,代码来源:Filter.php

示例3: process

 /**
  * Process
  *
  * @param  Config $config
  * @return Config
  * @throws InvalidArgumentException
  */
 public function process(Config $config)
 {
     if ($config->isReadOnly()) {
         throw new Exception\InvalidArgumentException('Cannot process config because it is read-only');
     }
     if ($this->map === null) {
         $this->buildMap();
     }
     /**
      * Walk through config and replace values
      */
     $keys = array_keys($this->map);
     $values = array_values($this->map);
     foreach ($config as $key => $val) {
         if ($val instanceof Config) {
             $this->process($val);
         } else {
             $config->{$key} = str_replace($keys, $values, $val);
         }
     }
     return $config;
 }
开发者ID:haoyanfei,项目名称:zf2,代码行数:29,代码来源:Token.php

示例4: testSetReadOnlyAppliesToChildren

 /**
  * @group ZF-4728
  *
  */
 public function testSetReadOnlyAppliesToChildren()
 {
     $config = new Config($this->all, true);
     $config->setReadOnly();
     $this->assertTrue($config->isReadOnly());
     $this->assertTrue($config->one->isReadOnly(), 'First level children are writable');
     $this->assertTrue($config->one->two->isReadOnly(), 'Second level children are writable');
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:12,代码来源:ConfigTest.php

示例5: process

    /**
     * Process
     *
     * @param Config $config
     * @return Config
     * @throws InvalidArgumentException
     */
    public function process(Config $config)
    {
        if ($config->isReadOnly()) {
            throw new InvalidArgumentException('Cannot parse config because it is read-only');
        }

        /**
         * Walk through config and replace values
         */
        foreach ($config as $key => $val) {
            if ($val instanceof Config) {
                $this->process($val);
            } else {
                $config->$key = $this->translator->translate($val, $this->locale);
            }
        }

        return $config;
    }
开发者ID:necrogami,项目名称:zf2,代码行数:26,代码来源:Translator.php


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