本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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');
}
示例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;
}