本文整理汇总了PHP中Seitenbau\Registry::setConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Registry::setConfig方法的具体用法?PHP Registry::setConfig怎么用?PHP Registry::setConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Seitenbau\Registry
的用法示例。
在下文中一共展示了Registry::setConfig方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defaultCodeLengthIsUsedWhenCodeLengthIsNotConfigured
/**
* @test
* @group library
*/
public function defaultCodeLengthIsUsedWhenCodeLengthIsNotConfigured()
{
$config = Registry::getConfig();
Registry::setConfig(new \Zend_Config(array()));
$this->assertEquals(OptinCodeGenerator::DEFAULT_CODE_LENGTH, strlen(OptinCodeGenerator::generate()));
Registry::setConfig($config);
}
示例2: _initConfig
protected function _initConfig()
{
$configOptions = $this->getOptions();
$config = new Zend_Config($configOptions, true);
Registry::setConfig($config);
return $config;
}
示例3: updateConfigModuleEnableDev
protected function updateConfigModuleEnableDev($enable)
{
// set quota in config
$newConfig = new \Zend_Config(Registry::getConfig()->toArray(), true);
$newConfig->quota->module->enableDev = $enable;
$newConfig->setReadOnly();
Registry::setConfig($newConfig);
}
示例4: setQuotaModuleEnableDev
/**
* @param boolean $enableDev
*/
protected function setQuotaModuleEnableDev($enableDev)
{
$config = Registry::getConfig();
$newConfig = new \Zend_Config($config->toArray(), true);
$newConfig->quota->module->enableDev = $enableDev;
$newConfig->setReadOnly();
Registry::setConfig($newConfig);
}
示例5: removeValue
/**
* @param array $pathToValue
*/
public static function removeValue(array $pathToValue)
{
$config = Registry::getConfig()->toArray();
if (count($pathToValue) <= 0) {
$config = array();
} else {
$configPart =& $config;
foreach (array_slice($pathToValue, 0, -1) as $key) {
if (!array_key_exists($key, $configPart)) {
return;
}
$configPart =& $configPart[$key];
}
unset($configPart[end($pathToValue)]);
}
$newConfig = new \Zend_Config($config, true);
$newConfig->setReadOnly();
Registry::setConfig($newConfig);
}