return self::$configInstance;
}
- /**
- * Converts dashes to underscores, e.g. useable for configuration entries
- *
- * @param $str The string with maybe dashes inside
- * @return $str The converted string with no dashed, but underscores
- * @throws NullPointerException If $str is null
- * @throws InvalidArgumentException If $str is empty
- */
- private final function convertDashesToUnderscores ($str) {
- // Is it null?
- if (is_null($str)) {
- // Throw NPE
- throw new NullPointerException($this, BaseFrameworkSystem::EXCEPTION_IS_NULL_POINTER);
- } elseif (!is_string($str)) {
- // Entry is empty
- throw new InvalidArgumentException(sprintf('str[]=%s is not a string', gettype($str)), self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
- } elseif ((is_string($str)) && (empty($str))) {
- // Entry is empty
- throw new InvalidArgumentException('str is empty', self::EXCEPTION_CONFIG_KEY_IS_EMPTY);
- }
-
- // Convert them all
- $str = str_replace('-', '_', $str);
-
- // Return converted string
- return $str;
- }
-
/**
* Checks whether the given configuration key is set
*
}
// Convert dashes to underscore
- $configKey = $this->convertDashesToUnderscores($configKey);
+ $configKey = BaseFrameworkSystem::convertDashesToUnderscores($configKey);
// Is a valid configuration key provided?
if (!$this->isConfigurationEntrySet($configKey)) {
}
// Cast to string
- $configKey = $this->convertDashesToUnderscores($configKey);
+ $configKey = BaseFrameworkSystem::convertDashesToUnderscores($configKey);
// Set the configuration value
//* NOISY-DEBUG: */ print(__METHOD__ . ':configEntry=' . $configKey . ',configValue[' . gettype($configValue) . ']=' . $configValue . PHP_EOL);
}
// Convert dashes to underscore
- $configKey = $this->convertDashesToUnderscores($configKey);
+ $configKey = BaseFrameworkSystem::convertDashesToUnderscores($configKey);
// Is the configuration key there?
if (!$this->isConfigurationEntrySet($configKey)) {