當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。