本文整理汇总了PHP中LoggerOptionConverter::findAndSubst方法的典型用法代码示例。如果您正苦于以下问题:PHP LoggerOptionConverter::findAndSubst方法的具体用法?PHP LoggerOptionConverter::findAndSubst怎么用?PHP LoggerOptionConverter::findAndSubst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoggerOptionConverter
的用法示例。
在下文中一共展示了LoggerOptionConverter::findAndSubst方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setProperties
public function setProperties($properties, $prefix)
{
$len = strlen($prefix);
while (list($key, ) = each($properties)) {
if (strpos($key, $prefix) === 0) {
if (strpos($key, '.', $len + 1) > 0) {
continue;
}
$value = LoggerOptionConverter::findAndSubst($key, $properties);
$key = substr($key, $len);
if ($key == 'layout' and $this->obj instanceof LoggerAppender) {
continue;
}
$this->setProperty($key, $value);
}
}
$this->activate();
}
示例2: parseAdditivityForLogger
/**
* Parse the additivity option for a non-root category.
*
* @param array $props array of properties
* @param Logger $cat
* @param string $loggerName
*/
private function parseAdditivityForLogger($props, Logger $cat, $loggerName)
{
$value = LoggerOptionConverter::findAndSubst(self::ADDITIVITY_PREFIX . $loggerName, $props);
// touch additivity only if necessary
if (!empty($value)) {
$additivity = LoggerOptionConverter::toBoolean($value, true);
$cat->setAdditivity($additivity);
}
}
示例3: parseAdditivityForLogger
/**
* Parse the additivity option for a non-root category.
*
* @param array $props array of properties
* @param Logger &$cat
* @param string $loggerName
*/
function parseAdditivityForLogger($props, &$cat, $loggerName)
{
$value = LoggerOptionConverter::findAndSubst(LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_ADDITIVITY_PREFIX . $loggerName, $props);
LoggerLog::debug("LoggerPropertyConfigurator::parseAdditivityForLogger() " . "Handling " . LOG4PHP_LOGGER_PROPERTY_CONFIGURATOR_ADDITIVITY_PREFIX . $loggerName . "=[{$value}]");
// touch additivity only if necessary
if (!empty($value)) {
$additivity = LoggerOptionConverter::toBoolean($value, true);
LoggerLog::debug("LoggerPropertyConfigurator::parseAdditivityForLogger() " . "Setting additivity for [{$loggerName}] to [{$additivity}]");
$cat->setAdditivity($additivity);
}
}
示例4: setProperties
/**
* Set the properites for the object that match the
* <code>prefix</code> passed as parameter.
*
* @param array $properties An array containing keys and values.
* @param string $prefix Only keys having the specified prefix will be set.
*/
function setProperties($properties, $prefix)
{
LoggerLog::debug("LoggerOptionConverter::setProperties():prefix=[{$prefix}]");
$len = strlen($prefix);
while (list($key, ) = each($properties)) {
if (strpos($key, $prefix) === 0) {
if (strpos($key, '.', $len + 1) > 0) {
continue;
}
$value = LoggerOptionConverter::findAndSubst($key, $properties);
$key = substr($key, $len);
if ($key == 'layout' && is_a($this->obj, 'loggerappender')) {
continue;
}
$this->setProperty($key, $value);
}
}
$this->activate();
}