本文整理匯總了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;
}