*/
public function __construct(Filterable $filterInstance, $code) {
// Get length
- $length = $filterInstance->getConfigInstance()->readConfig('captcha_string_length');
+ $length = $filterInstance->getConfigInstance()->getConfigEntry('captcha_string_length');
// Construct message
$message = sprintf("[%s:%d] Encrypt string has an invalid length. Valid: %d",
$this->setConfigInstance(FrameworkConfiguration::getInstance());
// Add application helper to our class
- $this->systemclasses[] = $this->getConfigInstance()->readConfig('app_helper_class');
+ $this->systemclasses[] = $this->getConfigInstance()->getConfigEntry('app_helper_class');
// Set debug instance
- $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->readConfig('debug_class')));
+ $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->getConfigEntry('debug_class')));
// Get output instance and set it
- $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class', array($this->getConfigInstance()->readConfig('web_content_type')));
+ $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class', array($this->getConfigInstance()->getConfigEntry('web_content_type')));
$this->setWebOutputInstance($outputInstance);
// Set the compressor channel
$this->setCompressorChannel(CompressorChannel::createCompressorChannel(
- $this->getConfigInstance()->readConfig('base_path').
- $this->getConfigInstance()->readConfig('compressor_base_path')
+ $this->getConfigInstance()->getConfigEntry('base_path').
+ $this->getConfigInstance()->getConfigEntry('compressor_base_path')
));
// Initialization done! :D
$timeArray = explode(':', $dateTime[1]);
// Construct the timestamp
- $readable = sprintf($this->getConfigInstance()->readConfig('german_date_time'),
+ $readable = sprintf($this->getConfigInstance()->getConfigEntry('german_date_time'),
$dateArray[0],
$dateArray[1],
$dateArray[2],
$appInstance = $registryInstance->getInstance('application');
// Default action is the one from configuration
- $this->actionName = $this->convertDashesToUnderscores($appInstance->getAppShortName()) . '_login_' . $this->getConfigInstance()->readConfig('login_default_action');
+ $this->actionName = $this->convertDashesToUnderscores($appInstance->getAppShortName()) . '_login_' . $this->getConfigInstance()->getConfigEntry('login_default_action');
// Get "action" from request
$actReq = $requestInstance->getRequestElement('action');
$userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH, $hashedString);
// Re-set config entry to mailer engine
- $this->getConfigInstance()->setConfigEntry('template_class', $this->getConfigInstance()->readConfig('mail_template_class'));
+ $this->getConfigInstance()->setConfigEntry('template_class', $this->getConfigInstance()->getConfigEntry('mail_template_class'));
// Prepare the template engine
$templateInstance = $this->prepareTemplateInstance($appInstance);
*/
public function addConfiguredCriteria ($criteriaKey, $configEntry) {
// Add configuration entry as criteria
- $value = $this->getConfigInstance()->readConfig($configEntry);
+ $value = $this->getConfigInstance()->getConfigEntry($configEntry);
$this->addCriteria($criteriaKey, $value);
}
*/
public final function addConfiguredCriteria ($criteriaKey, $configEntry) {
// Add the configuration entry as a criteria
- $value = $this->getConfigInstance()->readConfig($configEntry);
+ $value = $this->getConfigInstance()->getConfigEntry($configEntry);
$this->addCriteria($criteriaKey, $value);
}
*/
public function addConfiguredCriteria ($criteriaKey, $configEntry) {
// Add the configuration entry as a criteria
- $value = $this->getConfigInstance()->readConfig($configEntry);
+ $value = $this->getConfigInstance()->getConfigEntry($configEntry);
$this->addCriteria($criteriaKey, $value);
}
$randomString = $this->rngInstance->randomString();
// Get config entry for salt length
- $length = $this->getConfigInstance()->readConfig('salt_length');
+ $length = $this->getConfigInstance()->getConfigEntry('salt_length');
// Keep only defined number of characters
$this->salt = substr(sha1($randomString), -$length, $length);
// Is the old password set?
if (!empty($oldHash)) {
// Use the salt from hash, first get length
- $length = $this->getConfigInstance()->readConfig('salt_length');
+ $length = $this->getConfigInstance()->getConfigEntry('salt_length');
// Then extract the X first characters from the hash as our salt
$salt = substr($oldHash, 0, $length);
// Hash the password with salt
//* DEBUG: */ echo "salt=".$salt."/plain=".$str."<br />\n";
- $hashed = $salt . md5(sprintf($this->getConfigInstance()->readConfig('hash_mask'),
+ $hashed = $salt . md5(sprintf($this->getConfigInstance()->getConfigEntry('hash_mask'),
$salt,
$this->rngInstance->getFixedSalt(),
$str
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
// Get key
- if ($this->getConfigInstance()->readConfig('crypt_fixed_salt') == 'Y') {
+ if ($this->getConfigInstance()->getConfigEntry('crypt_fixed_salt') == 'Y') {
$key = md5($this->rngInstance->getFixedSalt());
} else {
$key = md5($this->rngInstance->getExtraSalt());
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
// Get key
- if ($this->getConfigInstance()->readConfig('crypt_fixed_salt') == 'Y') {
+ if ($this->getConfigInstance()->getConfigEntry('crypt_fixed_salt') == 'Y') {
$key = md5($this->rngInstance->getFixedSalt());
} else {
$key = md5($this->rngInstance->getExtraSalt());
if (!isset($this->tableInfo['primary'])) {
// Then create the info file
$this->createTableInfoFile($dataSetInstance);
- } elseif (($this->getConfigInstance()->readConfig('db_update_primary_forced') == 'Y') && ($dataSetInstance->getPrimaryKey() != $this->tableInfo['primary'])) {
+ } elseif (($this->getConfigInstance()->getConfigEntry('db_update_primary_forced') == 'Y') && ($dataSetInstance->getPrimaryKey() != $this->tableInfo['primary'])) {
// Set the array element
$this->tableInfo[$dataSetInstance->getTableName()]['primary'] = $dataSetInstance->getPrimaryKey();
*/
public function createConfiguredCache () {
// Read the config entry
- $cacheType = $this->getConfigInstance()->readConfig('cache_class');
+ $cacheType = $this->getConfigInstance()->getConfigEntry('cache_class');
// And get a new instance
$cacheInstance = ObjectFactory::createObjectByName($cacheType);
*/
public final static function createObjectByConfiguredName ($configEntry, array $args=array()) {
// Read the configuration entry
- $className = FrameworkConfiguration::getInstance()->readConfig($configEntry);
+ $className = FrameworkConfiguration::getInstance()->getConfigEntry($configEntry);
// Send this to the other factory...
$objectInstance = self::createObjectByName($className, $args);
} // END - if
// Get the news reader class name from config
- $className = $requestInstance->getConfigInstance()->readConfig($configEntry);
+ $className = $requestInstance->getConfigInstance()->getConfigEntry($configEntry);
// Once we have that name, try to load initialize it
$newsInstance = ObjectFactory::createObjectByName($className, array($requestInstance));
* @return void
*/
protected function setDefaultAuthMethod () {
- $this->authMethod = $this->getConfigInstance()->readConfig('auth_method_class');
+ $this->authMethod = $this->getConfigInstance()->getConfigEntry('auth_method_class');
}
/**
} // END - if
// Regular user account
- $className = $this->getConfigInstance()->readConfig('user_class');
+ $className = $this->getConfigInstance()->getConfigEntry('user_class');
$methodName = 'createMemberByUserName';
// Now, try to get a user or guest instance
- if ($authLogin == $this->getConfigInstance()->readConfig('guest_login_user')) {
+ if ($authLogin == $this->getConfigInstance()->getConfigEntry('guest_login_user')) {
// Set class
- $className = $this->getConfigInstance()->readConfig('guest_class');
+ $className = $this->getConfigInstance()->getConfigEntry('guest_class');
$methodName = 'createGuestByUserName';
} // END - if
$decryptedString = ObjectFactory::createObjectByConfiguredName('crypto_class')->decryptString($encryptDecoded);
// Is it the expected length?
- if (strlen($decryptedString) != $this->getConfigInstance()->readConfig('captcha_string_length')) {
+ if (strlen($decryptedString) != $this->getConfigInstance()->getConfigEntry('captcha_string_length')) {
// Not found, so request is invalid
$requestInstance->requestIsValid(false);
$userName = $requestInstance->getRequestElement('username');
// Does the user name match the guest login?
- if ($userName == $this->getConfigInstance()->readConfig('guest_login_user')) {
+ if ($userName == $this->getConfigInstance()->getConfigEntry('guest_login_user')) {
// Then set the password to the configured password
- $requestInstance->setRequestElement('pass1', $this->getConfigInstance()->readConfig('guest_login_passwd'));
- $requestInstance->setRequestElement('pass2', $this->getConfigInstance()->readConfig('guest_login_passwd'));
+ $requestInstance->setRequestElement('pass1', $this->getConfigInstance()->getConfigEntry('guest_login_passwd'));
+ $requestInstance->setRequestElement('pass2', $this->getConfigInstance()->getConfigEntry('guest_login_passwd'));
} // END - if
}
}
$userInstance = Registry::getRegistry()->getInstance('user');
// Get "confirmed" status from config
- $confirmed = $this->getConfigInstance()->readConfig('user_status_confirmed');
+ $confirmed = $this->getConfigInstance()->getConfigEntry('user_status_confirmed');
// Update the user status to "confirmed" here
$userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $confirmed);
$email = $requestInstance->getRequestElement('email');
// Is the Email set?
- if ((is_null($email)) || ($this->getConfigInstance()->readConfig('register_email_unique') == 'Y')) {
+ if ((is_null($email)) || ($this->getConfigInstance()->getConfigEntry('register_email_unique') == 'Y')) {
// Try it again
$email1 = $requestInstance->getRequestElement('email1');
$email2 = $requestInstance->getRequestElement('email2');
$userInstance->setEmailAddress($email);
} else {
// If this instance is created then the username *does* exist
- $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('user_class'), 'createMemberByEmail'), array($email));
+ $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('user_class'), 'createMemberByEmail'), array($email));
// Remember this user instance in our registry for later usage
$registry->addInstance('user', $userInstance);
// If this instance is created then the username *does* exist
try {
// Get a new instance
- $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('user_class'), 'createMemberByUsername'), array($userName));
+
+ $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('user_class'), 'createMemberByUsername'), array($userName));
// Remember this user instance in our registry for later usage
$registry->addInstance('user', $userInstance);
// If this instance is created then the username *does* exist
try {
// Get a new instance
- $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('guest_class'), 'createGuestByUsername'), array($userName));
+ $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('guest_class'), 'createGuestByUsername'), array($userName));
// Remember this user instance in our registry for later usage
$registry->addInstance('user', $userInstance);
// If this instance is created then the username *does* exist
try {
// Get a new instance
- $userInstance = call_user_func_array(array($this->getConfigInstance()->readConfig('user_class'), 'createMemberByUsername'), array($userName));
+ $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('user_class'), 'createMemberByUsername'), array($userName));
// Remember this user instance in our registry for later usage
$registry->addInstance('user', $userInstance);
$userInstance = Registry::getRegistry()->getInstance('user');
// Is the user account confirmed?
- if (($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->readConfig('user_status_confirmed')) && ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->readConfig('user_status_guest'))) {
+ if (($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->getConfigEntry('user_status_confirmed')) && ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->getConfigEntry('user_status_guest'))) {
// Request is invalid!
$requestInstance->requestIsValid(false);
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Get member class
- $userClass = $this->getConfigInstance()->readConfig('user_class');
+ $userClass = $this->getConfigInstance()->getConfigEntry('user_class');
// Get a user instance for comparison
$userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance));
} // END - if
// Is the user account confirmed?
- if ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->readConfig('user_status_unconfirmed')) {
+ if ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->getConfigEntry('user_status_unconfirmed')) {
// Request is invalid!
$requestInstance->requestIsValid(false);
*/
public function initiateCaptcha () {
// Get total length
- $captchaLength = $this->getConfigInstance()->readConfig('captcha_string_length');
+ $captchaLength = $this->getConfigInstance()->getConfigEntry('captcha_string_length');
// Get max string length
- $strLength = $this->getConfigInstance()->readConfig('random_string_length');
+ $strLength = $this->getConfigInstance()->getConfigEntry('random_string_length');
// Calculate starting position based on random place
$start = $this->getRngInstance()->randomNumber(0, ($strLength - $captchaLength));
$captchaString = substr($base64String, $start, $captchaLength);
// Get all characters we want to replace
- $searchChars = $this->getConfigInstance()->readConfig('captcha_search_chars');
+ $searchChars = $this->getConfigInstance()->getConfigEntry('captcha_search_chars');
// Get fixed salt and use it as "replacement characters"
$replaceChars = $this->getRngInstance()->getExtraSalt();
* @return $withRegistration Wether with registration date
*/
public function ifIncludeRegistrationStamp () {
- $withRegistration = ($this->getConfigInstance()->readConfig('block_shows_registration') == 'Y');
+ $withRegistration = ($this->getConfigInstance()->getConfigEntry('block_shows_registration') == 'Y');
return $withRegistration;
}
* @return $required Wether the email address is required
*/
public function ifRegisterRequiresEmailVerification () {
- $required = ($this->getConfigInstance()->readConfig('register_requires_email') == 'Y');
+ $required = ($this->getConfigInstance()->getConfigEntry('register_requires_email') == 'Y');
return $required;
}
* @return $required Wether profile shall be asked
*/
public function ifRegisterIncludesProfile () {
- $required = ($this->getConfigInstance()->readConfig('register_includes_profile') == 'Y');
+ $required = ($this->getConfigInstance()->getConfigEntry('register_includes_profile') == 'Y');
return $required;
}
* @return $required Wether personal data shall be asked
*/
public function ifRegisterIncludesPersonaData () {
- $required = ($this->getConfigInstance()->readConfig('register_personal_data') == 'Y');
+ $required = ($this->getConfigInstance()->getConfigEntry('register_personal_data') == 'Y');
return $required;
}
* @return $required Wether birthday shall be asked
*/
public function ifProfileIncludesBirthDay () {
- $required = ($this->getConfigInstance()->readConfig('profile_includes_birthday') == 'Y');
+ $required = ($this->getConfigInstance()->getConfigEntry('profile_includes_birthday') == 'Y');
return $required;
}
* @return $isUnique
*/
public function ifEmailMustBeUnique () {
- $isUnique = ($this->getConfigInstance()->readConfig('register_email_unique') == 'Y');
+ $isUnique = ($this->getConfigInstance()->getConfigEntry('register_email_unique') == 'Y');
return $isUnique;
}
* @return $required Wether the specified chat protocol is enabled
*/
public function ifChatEnabled ($chatProtocol) {
- $required = ($this->getConfigInstance()->readConfig('chat_enabled_' . $chatProtocol) == 'Y');
+ $required = ($this->getConfigInstance()->getConfigEntry('chat_enabled_' . $chatProtocol) == 'Y');
return $required;
}
* @return $isEnabled Wether the login is enabled or disabled
*/
public function ifLoginIsEnabled () {
- $isEnabled = ($this->getConfigInstance()->readConfig('login_enabled') == 'Y');
+ $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_enabled') == 'Y');
return $isEnabled;
}
* @return $isEnabled Wether the login shall be done by username
*/
public function ifLoginWithUsername () {
- $isEnabled = ($this->getConfigInstance()->readConfig('login_type') == "username");
+ $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_type') == "username");
return $isEnabled;
}
* @return $isEnabled Wether the login shall be done by email
*/
public function ifLoginWithEmail () {
- $isEnabled = ($this->getConfigInstance()->readConfig('login_type') == "email");
+ $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_type') == "email");
return $isEnabled;
}
* @return $isAllowed Wether guest login is allowed
*/
public function ifGuestLoginAllowed () {
- $isAllowed = ($this->getConfigInstance()->readConfig('guest_login_allowed') == 'Y');
+ $isAllowed = ($this->getConfigInstance()->getConfigEntry('guest_login_allowed') == 'Y');
return $isAllowed;
}
* @return $requireConfirm Wether email change must be confirmed
*/
public function ifEmailChangeRequireConfirmation () {
- $requireConfirm = ($this->getConfigInstance()->readConfig('email_change_confirmation') == 'Y');
+ $requireConfirm = ($this->getConfigInstance()->getConfigEntry('email_change_confirmation') == 'Y');
return $requireConfirm;
}
* @return $emailChange Wether changing email address is allowed
*/
public function ifEmailChangeAllowed () {
- $emailChange = ($this->getConfigInstance()->readConfig('email_change_allowed') == 'Y');
+ $emailChange = ($this->getConfigInstance()->getConfigEntry('email_change_allowed') == 'Y');
return $emailChange;
}
* @return $isUnconfirmed Wether the user account is unconfirmed
*/
public function ifUserAccountUnconfirmed () {
- $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->readConfig('user_status_unconfirmed'));
+ $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_unconfirmed'));
return $isUnconfirmed;
}
* @return $isUnconfirmed Wether the user account is locked
*/
public function ifUserAccountLocked () {
- $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->readConfig('user_status_locked'));
+ $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_locked'));
return $isUnconfirmed;
}
* @return $isUnconfirmed Wether the user account is a guest
*/
public function ifUserAccountGuest () {
- $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->readConfig('user_status_guest'));
+ $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_guest'));
return $isUnconfirmed;
}
* @return $refillActive Wether the refill page is active
*/
public function ifRefillPageActive () {
- $refillActive = ($this->getConfigInstance()->readConfig('refill_page_active') == 'Y');
+ $refillActive = ($this->getConfigInstance()->getConfigEntry('refill_page_active') == 'Y');
return $refillActive;
}
}
// Add HTML code
$formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s/%s\" method=\"%s\" target=\"%s\"",
$formName,
- $this->getConfigInstance()->readConfig('base_url'),
- $this->getConfigInstance()->readConfig('form_action'),
- $this->getConfigInstance()->readConfig('form_method'),
- $this->getConfigInstance()->readConfig('form_target')
+ $this->getConfigInstance()->getConfigEntry('base_url'),
+ $this->getConfigInstance()->getConfigEntry('form_action'),
+ $this->getConfigInstance()->getConfigEntry('form_method'),
+ $this->getConfigInstance()->getConfigEntry('form_target')
);
// Add form id as well
*/
public function addInputHiddenConfiguredField ($fieldName, $prefix) {
// Get the value from instance
- $fieldValue = $this->getConfigInstance()->readConfig("{$prefix}_{$fieldName}");
+ $fieldValue = $this->getConfigInstance()->getConfigEntry("{$prefix}_{$fieldName}");
//* DEBUG: */ echo __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
// Add the text field
* @return $required Wether the email address is required
*/
public function ifRegisterRequiresEmailVerification () {
- $required = ($this->getConfigInstance()->readConfig('register_requires_email') == 'Y');
+ $required = ($this->getConfigInstance()->getConfigEntry('register_requires_email') == 'Y');
return $required;
}
* @return $required Wether profile data shall be asked
*/
public function ifRegisterIncludesProfile () {
- $required = ($this->getConfigInstance()->readConfig('register_includes_profile') == 'Y');
+ $required = ($this->getConfigInstance()->getConfigEntry('register_includes_profile') == 'Y');
return $required;
}
* @return $isSecured Wether this form is secured by a CAPTCHA
*/
public function ifFormSecuredWithCaptcha () {
- $isSecured = ($this->getConfigInstance()->readConfig($this->getFormName().'_captcha_secured') == 'Y');
+ $isSecured = ($this->getConfigInstance()->getConfigEntry($this->getFormName().'_captcha_secured') == 'Y');
return $isSecured;
}
// Determine link base from config now and 'page' request
try {
- $newLinkBase = $helperInstance->getConfigInstance()->readConfig($configEntry);
+ $newLinkBase = $helperInstance->getConfigInstance()->getConfigEntry($configEntry);
$linkBase = $newLinkBase;
} catch (ConfigEntryNotFoundException $e) {
// Is the deprecated linkBase not set?
$langInstance->initLanguageStrings();
// Set language code from default config
- $langInstance->setLanguageCode(FrameworkConfiguration::getInstance()->readConfig('default_lang'));
+ $langInstance->setLanguageCode(FrameworkConfiguration::getInstance()->getConfigEntry('default_lang'));
// Remember this instance
self::$thisInstance = $langInstance;
$this->setTemplateName($templateName);
// Get configuration entry
- $templatePrefix = $this->getConfigInstance()->readConfig('email_tpl_' . $templateName);
+ $templatePrefix = $this->getConfigInstance()->getConfigEntry('email_tpl_' . $templateName);
// Load this email template
$this->getTemplateInstance()->loadEmailTemplate($templatePrefix . '_' . $templateName);
*/
public final static function getInstance() {
if (is_null(self::$consoleInstance)) {
- $contentType = FrameworkConfiguration::getInstance()->readConfig('web_content_type');
+ $contentType = FrameworkConfiguration::getInstance()->getConfigEntry('web_content_type');
self::$consoleInstance = ConsoleOutput::createConsoleOutput($contentType);
}
return self::$consoleInstance;
$hasRequired = false;
// Get the required points entry
- $requiredPoints = $this->getConfigInstance()->readConfig($action . '_action_points');
+ $requiredPoints = $this->getConfigInstance()->getConfigEntry($action . '_action_points');
// Now get a search criteria and set the user's name as criteria
$searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
$criteriaInstance->addCriteria('page', $command);
// Add limitation from config
- $criteriaInstance->setLimit($this->getConfigInstance()->readConfig('news_' . $command . '_limit'));
+ $criteriaInstance->setLimit($this->getConfigInstance()->getConfigEntry('news_' . $command . '_limit'));
// Get a resultInstance back from the database
$resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
$criteriaInstance->addCriteria('page', $page);
// Add limitation from config
- $criteriaInstance->setLimit($this->getConfigInstance()->readConfig('news_' . $page . '_limit'));
+ $criteriaInstance->setLimit($this->getConfigInstance()->getConfigEntry('news_' . $page . '_limit'));
// Get a resultInstance back from the database
$resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
$actionName = $requestInstance->getRequestElement('action');
// Is the action empty? Then fall back to default action
- if (empty($actionName)) $actionName = $this->getConfigInstance()->readConfig('default_action');
+ if (empty($actionName)) $actionName = $this->getConfigInstance()->getConfigEntry('default_action');
// Check if action is valid
if ($this->isActionValid($actionName) === false) {
$actionName = $this->getActionName();
// Is the action empty? Then fall back to default action
- if (empty($actionName)) $actionName = $this->getConfigInstance()->readConfig('default_action');
+ if (empty($actionName)) $actionName = $this->getConfigInstance()->getConfigEntry('default_action');
// Check if action is valid
if ($this->isActionValid($actionName) === false) {
$commandName = $requestInstance->getRequestElement('command');
// Is the command empty? Then fall back to default command
- if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_console_command');
+ if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_console_command');
// Check if command is valid
if ($this->isCommandValid($commandName) === false) {
$commandInstance = null;
// Is the command empty? Then fall back to default command
- if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_console_command');
+ if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_console_command');
// Check if command is valid
if ($this->isCommandValid($commandName) === false) {
$commandName = $requestInstance->getRequestElement('page');
// Is the command empty? Then fall back to default command
- if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_image_command');
+ if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_image_command');
// Check if command is valid
if ($this->isCommandValid($commandName) === false) {
$commandInstance = null;
// Is the command empty? Then fall back to default command
- if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_image_command');
+ if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_image_command');
// Check if command is valid
if ($this->isCommandValid($commandName) === false) {
$commandName = $requestInstance->getRequestElement('page');
// Is the command empty? Then fall back to default command
- if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command');
+ if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
// Check if command is valid
if ($this->isCommandValid($commandName) === false) {
$commandInstance = null;
// Is the command empty? Then fall back to default command
- if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_web_command');
+ if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
// Check if command is valid
if ($this->isCommandValid($commandName) === false) {
*/
protected function loadController ($controllerName) {
// Cache default command
- $defaultController = $this->getConfigInstance()->readConfig('default_' . strtolower($this->getControllerPrefix()) . '_command');
+ $defaultController = $this->getConfigInstance()->getConfigEntry('default_' . strtolower($this->getControllerPrefix()) . '_command');
// Init controller instance
$controllerInstance = null;
$resolverConfigEntry = sprintf("%s_cmd_%s_resolver_class", strtolower($this->getControllerPrefix()), strtolower($controllerName));
// Get the config, this will throw an exception if there is no special command resolver
- $resolverClass = $this->getConfigInstance()->readConfig($resolverConfigEntry);
+ $resolverClass = $this->getConfigInstance()->getConfigEntry($resolverConfigEntry);
} catch (ConfigEntryNotFoundException $e) {
// Use default resolver entry
// @TODO Maybe we need to log this?
$this->addHeader('Pragma', 'no-cache'); // HTTP/1.0
// Define the charset to be used
- //$this->addHeader('Content-type:', sprintf("text/html; charset=%s", $this->getConfigInstance()->readConfig('header_charset')));
+ //$this->addHeader('Content-type:', sprintf("text/html; charset=%s", $this->getConfigInstance()->getConfigEntry('header_charset')));
// Send all headers
foreach ($this->responseHeaders as $name => $value) {
* @return $defaultCommand Default command for this response
*/
public function getDefaultCommand () {
- $defaultCommand = $this->getConfigInstance()->readConfig('default_console_command');
+ $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_console_command');
return $defaultCommand;
}
// Get all config entries
if (is_null($expires)) {
- $expires = (time() + $this->getConfigInstance()->readConfig('cookie_expire'));
+ $expires = (time() + $this->getConfigInstance()->getConfigEntry('cookie_expire'));
} // END - if
- $path = $this->getConfigInstance()->readConfig('cookie_path');
- $domain = $this->getConfigInstance()->readConfig('cookie_domain');
+ $path = $this->getConfigInstance()->getConfigEntry('cookie_path');
+ $domain = $this->getConfigInstance()->getConfigEntry('cookie_domain');
setcookie($cookieName, $cookieValue, $expires);
//, $path, $domain, (isset($_SERVER['HTTPS']))
$this->getTemplateInstance()->assignApplicationData($this->getApplicationInstance());
// Get the url from config
- $url = $this->getConfigInstance()->readConfig($configEntry . "_url");
+ $url = $this->getConfigInstance()->getConfigEntry($configEntry . "_url");
// Compile the URL
$url = $this->getTemplateInstance()->compileRawCode($url);
if (substr($url, 0, 1) == '/') $url = substr($url, 1);
// No, then extend it with our base URL
- $url = $this->getConfigInstance()->readConfig('base_url') . '/' . $url;
+ $url = $this->getConfigInstance()->getConfigEntry('base_url') . '/' . $url;
} // END - if
// Add redirect header
* @return $defaultCommand Default command for this response
*/
public function getDefaultCommand () {
- $defaultCommand = $this->getConfigInstance()->readConfig('default_web_command');
+ $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_web_command');
return $defaultCommand;
}
}
$cfg = $this->getConfigInstance();
// Set new template engine
- $cfg->setConfigEntry('template_class' , $cfg->readConfig('image_template_class'));
+ $cfg->setConfigEntry('template_class' , $cfg->getConfigEntry('image_template_class'));
$cfg->setConfigEntry('raw_template_extension' , '.img');
$cfg->setConfigEntry('code_template_extension', '.xml');
$cfg->setConfigEntry('tpl_base_path' , 'templates/images/');
// Get all config entries
if (is_null($expires)) {
- $expires = (time() + $this->getConfigInstance()->readConfig('cookie_expire'));
+ $expires = (time() + $this->getConfigInstance()->getConfigEntry('cookie_expire'));
} // END - if
- $path = $this->getConfigInstance()->readConfig('cookie_path');
- $domain = $this->getConfigInstance()->readConfig('cookie_domain');
+ $path = $this->getConfigInstance()->getConfigEntry('cookie_path');
+ $domain = $this->getConfigInstance()->getConfigEntry('cookie_domain');
setcookie($cookieName, $cookieValue, $expires);
//, $path, $domain, (isset($_SERVER['HTTPS']))
$this->getTemplateInstance()->assignApplicationData($this->getApplicationInstance());
// Get the url from config
- $url = $this->getConfigInstance()->readConfig($configEntry . "_url");
+ $url = $this->getConfigInstance()->getConfigEntry($configEntry . "_url");
// Compile the URL
$url = $this->getTemplateInstance()->compileRawCode($url);
if (substr($url, 0, 1) == '/') $url = substr($url, 1);
// No, then extend it with our base URL
- $url = $this->getConfigInstance()->readConfig('base_url') . '/' . $url;
+ $url = $this->getConfigInstance()->getConfigEntry('base_url') . '/' . $url;
} // END - if
// Add redirect header
* @return $defaultCommand Default command for this response
*/
public function getDefaultCommand () {
- $defaultCommand = $this->getConfigInstance()->readConfig('default_image_command');
+ $defaultCommand = $this->getConfigInstance()->getConfigEntry('default_image_command');
return $defaultCommand;
}
}
*/
protected function initRng ($extraInstance) {
// Get the prime number from config
- $this->prime = $this->getConfigInstance()->readConfig('math_prime');
+ $this->prime = $this->getConfigInstance()->getConfigEntry('math_prime');
// Calculate the extra number which is always the same unless you give
// a better prime number
$serverIp = "cluster";
// Do we have a single server?
- if ($this->getConfigInstance()->readConfig('is_single_server') == 'Y') {
+ if ($this->getConfigInstance()->getConfigEntry('is_single_server') == 'Y') {
// Then use that IP for extra security
$serverIp = getenv('SERVER_ADDR');
} // END - if
}
// One-way data we need for "extra-salting" the random number
- $this->extraSalt = sha1($this->fixedSalt . ':' . getenv('SERVER_SOFTWARE') . ':' . $this->getConfigInstance()->readConfig('date_key') . $this->getConfigInstance()->readConfig('base_url'));
+ $this->extraSalt = sha1($this->fixedSalt . ':' . getenv('SERVER_SOFTWARE') . ':' . $this->getConfigInstance()->getConfigEntry('date_key') . $this->getConfigInstance()->getConfigEntry('base_url'));
// Get config entry for max salt length
- $this->rndStrLen = $this->getConfigInstance()->readConfig('rnd_str_length');
+ $this->rndStrLen = $this->getConfigInstance()->getConfigEntry('rnd_str_length');
}
/**
// Construct the FQFN for the template by honoring the current language
$fqfn = sprintf("%s%s%s%s/%s/%s%s",
- $this->getConfigInstance()->readConfig('base_path'),
+ $this->getConfigInstance()->getConfigEntry('base_path'),
$this->getTemplateBasePath(),
$this->getGenericBasePath(),
$this->getLanguageInstance()->getLanguageCode(),
$this->loadRawTemplateData($fqfn);
} catch (FileNotFoundException $e) {
// If we shall load a code-template we need to switch the file extension
- if (($this->getTemplateType() != $this->getConfigInstance()->readConfig('web_template_type')) && (empty($extOther))) {
+ if (($this->getTemplateType() != $this->getConfigInstance()->getConfigEntry('web_template_type')) && (empty($extOther))) {
// Switch over to the code-template extension and try it again
$ext = $this->getCodeTemplateExtension();
*/
public function loadWebTemplate ($template) {
// Set template type
- $this->setTemplateType($this->getConfigInstance()->readConfig('web_template_type'));
+ $this->setTemplateType($this->getConfigInstance()->getConfigEntry('web_template_type'));
// Load the special template
$this->loadTemplate($template);
public function assignConfigVariable ($var) {
// Sweet and simple...
//* DEBUG: */ echo __METHOD__.':var={$var}<br />\n';
- $this->varStack['config'][$var] = $this->getConfigInstance()->readConfig($var);
+ $this->varStack['config'][$var] = $this->getConfigInstance()->getConfigEntry($var);
}
/**
*/
public function loadEmailTemplate ($template) {
// Set template type
- $this->setTemplateType($this->getConfigInstance()->readConfig('email_template_type'));
+ $this->setTemplateType($this->getConfigInstance()->getConfigEntry('email_template_type'));
// Load the special template
$this->loadTemplate($template);
*/
public function loadCodeTemplate ($template) {
// Set template type
- $this->setTemplateType($this->getConfigInstance()->readConfig('code_template_type'));
+ $this->setTemplateType($this->getConfigInstance()->getConfigEntry('code_template_type'));
// Load the special template
$this->loadTemplate($template);
*/
public final function compileVariables () {
// Initialize the $content array
- $validVar = $this->getConfigInstance()->readConfig('tpl_valid_var');
+ $validVar = $this->getConfigInstance()->getConfigEntry('tpl_valid_var');
$dummy = array();
// Iterate through all general variables
*/
public function compileTemplate () {
// We will only work with template type "code" from configuration
- if ($this->getTemplateType() != $this->getConfigInstance()->readConfig('code_template_type')) {
+ if ($this->getTemplateType() != $this->getConfigInstance()->getConfigEntry('code_template_type')) {
// Abort here
- throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->readConfig('code_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
+ throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->getConfigEntry('code_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
} // END - if
// Get the raw data.
$ioInstance = $appInstance->getFileIoInstance();
// Determine base path
- $templateBasePath = $tplInstance->getConfigInstance()->readConfig('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/';
+ $templateBasePath = $tplInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/';
// Is the base path valid?
if (empty($templateBasePath)) {
$tplInstance->setFileIoInstance($ioInstance);
// Set template extensions
- $tplInstance->setRawTemplateExtension($configInstance->readConfig('raw_template_extension'));
- $tplInstance->setCodeTemplateExtension($configInstance->readConfig('code_template_extension'));
+ $tplInstance->setRawTemplateExtension($configInstance->getConfigEntry('raw_template_extension'));
+ $tplInstance->setCodeTemplateExtension($configInstance->getConfigEntry('code_template_extension'));
// Absolute output path for compiled templates
- $tplInstance->setCompileOutputPath($configInstance->readConfig('base_path') . $configInstance->readConfig('compile_output_path'));
+ $tplInstance->setCompileOutputPath($configInstance->getConfigEntry('base_path') . $configInstance->getConfigEntry('compile_output_path'));
// Return the prepared instance
return $tplInstance;
public function getImageCacheFqfn () {
// Get the FQFN ready
$fqfn = sprintf("%s%s%s/%s.%s",
- $this->getConfigInstance()->readConfig('base_path'),
+ $this->getConfigInstance()->getConfigEntry('base_path'),
$this->getGenericBasePath(),
'images/_cache',
md5(
*/
public function loadImageTemplate ($template) {
// Set template type
- $this->setTemplateType($this->getConfigInstance()->readConfig('image_template_type'));
+ $this->setTemplateType($this->getConfigInstance()->getConfigEntry('image_template_type'));
// Load the special template
$this->loadTemplate($template);
$ioInstance = $appInstance->getFileIoInstance();
// Determine base path
- $templateBasePath = $tplInstance->getConfigInstance()->readConfig('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/';
+ $templateBasePath = $tplInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/';
// Is the base path valid?
if (empty($templateBasePath)) {
$tplInstance->setFileIoInstance($ioInstance);
// Set template extensions
- $tplInstance->setRawTemplateExtension($configInstance->readConfig('raw_template_extension'));
- $tplInstance->setCodeTemplateExtension($configInstance->readConfig('code_template_extension'));
+ $tplInstance->setRawTemplateExtension($configInstance->getConfigEntry('raw_template_extension'));
+ $tplInstance->setCodeTemplateExtension($configInstance->getConfigEntry('code_template_extension'));
// Absolute output path for compiled templates
- $tplInstance->setCompileOutputPath($configInstance->readConfig('base_path') . $configInstance->readConfig('compile_output_path'));
+ $tplInstance->setCompileOutputPath($configInstance->getConfigEntry('base_path') . $configInstance->getConfigEntry('compile_output_path'));
// Return the prepared instance
return $tplInstance;
$ioInstance = $appInstance->getFileIoInstance();
// Determine base path
- $templateBasePath = $tplInstance->getConfigInstance()->readConfig('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/';
+ $templateBasePath = $tplInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/';
// Is the base path valid?
if (empty($templateBasePath)) {
$tplInstance->setFileIoInstance($ioInstance);
// Set template extensions
- $tplInstance->setRawTemplateExtension($configInstance->readConfig('raw_template_extension'));
- $tplInstance->setCodeTemplateExtension($configInstance->readConfig('menu_template_extension'));
+ $tplInstance->setRawTemplateExtension($configInstance->getConfigEntry('raw_template_extension'));
+ $tplInstance->setCodeTemplateExtension($configInstance->getConfigEntry('menu_template_extension'));
// Absolute output path for compiled templates
- $tplInstance->setCompileOutputPath($configInstance->readConfig('base_path') . $configInstance->readConfig('compile_output_path'));
+ $tplInstance->setCompileOutputPath($configInstance->getConfigEntry('base_path') . $configInstance->getConfigEntry('compile_output_path'));
// Return the prepared instance
return $tplInstance;
$ioInstance = $appInstance->getFileIoInstance();
// Determine base path
- $templateBasePath = $tplInstance->getConfigInstance()->readConfig('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/';
+ $templateBasePath = $tplInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/';
// Is the base path valid?
if (empty($templateBasePath)) {
$tplInstance->setFileIoInstance($ioInstance);
// Set template extensions
- $tplInstance->setRawTemplateExtension($configInstance->readConfig('raw_template_extension'));
- $tplInstance->setCodeTemplateExtension($configInstance->readConfig('code_template_extension'));
+ $tplInstance->setRawTemplateExtension($configInstance->getConfigEntry('raw_template_extension'));
+ $tplInstance->setCodeTemplateExtension($configInstance->getConfigEntry('code_template_extension'));
// Absolute output path for compiled templates
- $tplInstance->setCompileOutputPath($configInstance->readConfig('base_path') . $configInstance->readConfig('compile_output_path'));
+ $tplInstance->setCompileOutputPath($configInstance->getConfigEntry('base_path') . $configInstance->getConfigEntry('compile_output_path'));
// Return the prepared instance
return $tplInstance;
// If there is no action use the default on
if (is_null($lastAction)) {
- $lastAction = $this->getConfigInstance()->readConfig('login_default_action');
+ $lastAction = $this->getConfigInstance()->getConfigEntry('login_default_action');
} // END - if
// Get a critieria instance
$cfg->setConfigEntry('db_type', 'local');
// CFG: LOCAL-DB-PATH
-$cfg->setConfigEntry('local_db_path', $cfg->readConfig('base_path') . 'db/');
+$cfg->setConfigEntry('local_db_path', $cfg->getConfigEntry('base_path') . 'db/');
// CFG: TIME-ZONE
$cfg->setDefaultTimezone('Europe/Berlin');
$cfg->setConfigEntry('application_base_path', 'application/');
// CFG: APPLICATION-PATH
-$cfg->setConfigEntry('application_path', $cfg->readConfig('base_path') . $cfg->readConfig('application_base_path'));
+$cfg->setConfigEntry('application_path', $cfg->getConfigEntry('base_path') . $cfg->getConfigEntry('application_base_path'));
// CFG: COMPILE-OUTPUT-PATH
$cfg->setConfigEntry('compile_output_path', 'templates/_compiled/');
// Base path added? (Uni* / Windows)
if ((substr($inc, 0, 1) != '/') && (substr($inc, 1, 1) != ':')) {
// Generate FQFN
- $fqfn = $this->readConfig('base_path') . '/inc/extra/' . $inc;
+ $fqfn = $this->getConfigEntry('base_path') . '/inc/extra/' . $inc;
} // END - if
} // END - if
* @throws ConfigEntryNotFoundException If a configuration element
* was not found
*/
- public function readConfig ($cfgEntry) {
+ public function getConfigEntry ($cfgEntry) {
// Cast to string
$cfgEntry = (string) $cfgEntry;
$databaseInstance = null;
// Generate FQFN for the database layer
-$fqfn = FrameworkConfiguration::getInstance()->readConfig('base_path') . 'inc/database/lib-' . FrameworkConfiguration::getInstance()->readConfig('db_type') . '.php';
+$fqfn = FrameworkConfiguration::getInstance()->getConfigEntry('base_path') . 'inc/database/lib-' . FrameworkConfiguration::getInstance()->getConfigEntry('db_type') . '.php';
// Load the database layer include
if ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn))) {
} else {
// Layer is missing!
ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer is missing! (%s) -> R.I.P.",
- FrameworkConfiguration::getInstance()->readConfig('db_type')
+ FrameworkConfiguration::getInstance()->getConfigEntry('db_type')
));
}
// For testing purposes we use a local file database
$databaseInstance = LocalFileDatabase::createLocalFileDatabase(
- FrameworkConfiguration::getInstance()->readConfig('local_db_path'),
+ FrameworkConfiguration::getInstance()->getConfigEntry('local_db_path'),
FileIoHandler::getInstance()
);
*/
// Include the class loader function
-require(FrameworkConfiguration::getInstance()->readConfig('base_path') . 'inc/loader/class_ClassLoader.php');
+require(FrameworkConfiguration::getInstance()->getConfigEntry('base_path') . 'inc/loader/class_ClassLoader.php');
// Shall we include additional configs where you can configure some things? Then
// Load matching config
ClassLoader::getInstance()->loadExtraConfigs();
// Register hooks here
-require(FrameworkConfiguration::getInstance()->readConfig('base_path') . 'inc/hooks.php');
+require(FrameworkConfiguration::getInstance()->getConfigEntry('base_path') . 'inc/hooks.php');
// Does the user has an application specified?
if (!empty($_GET['app'])) {
$application = trim($app[1]);
} else {
// Invalid entry found, first must be "app"!
- $application = FrameworkConfiguration::getInstance()->readConfig('default_application');
+ $application = FrameworkConfiguration::getInstance()->getConfigEntry('default_application');
}
} else {
// Set the "application selector" application
- $application = FrameworkConfiguration::getInstance()->readConfig('default_application');
+ $application = FrameworkConfiguration::getInstance()->getConfigEntry('default_application');
}
// Secure it, by keeping out tags
FrameworkConfiguration::getInstance()->setConfigEntry('app_name', $application);
// Is the devel package included?
-if (is_dir(FrameworkConfiguration::getInstance()->readConfig('base_path') . 'devel')) {
+if (is_dir(FrameworkConfiguration::getInstance()->getConfigEntry('base_path') . 'devel')) {
// Load all development includes
ClassLoader::getInstance()->scanClassPath('devel');
} // END - if
// Try to instance the language system
$lang = LanguageSystem::createLanguageSystem(
- FrameworkConfiguration::getInstance()->readConfig('base_path').
- FrameworkConfiguration::getInstance()->readConfig('lang_base_path')
+ FrameworkConfiguration::getInstance()->getConfigEntry('base_path').
+ FrameworkConfiguration::getInstance()->getConfigEntry('lang_base_path')
);
// Is the app variable there and valid?
// Construct the FQFN for the cache
if (!defined('DEVELOPER')) {
- $this->listCacheFQFN = $this->configInstance->readConfig('local_db_path') . "list-" . $this->configInstance->readConfig('app_name') . ".cache";
- $this->classCacheFQFN = $this->configInstance->readConfig('local_db_path') . "class-" . $this->configInstance->readConfig('app_name') . ".cache";
+ $this->listCacheFQFN = $this->configInstance->getConfigEntry('local_db_path') . "list-" . $this->configInstance->getConfigEntry('app_name') . ".cache";
+ $this->classCacheFQFN = $this->configInstance->getConfigEntry('local_db_path') . "class-" . $this->configInstance->getConfigEntry('app_name') . ".cache";
} // END - if
// Set suffix and prefix from configuration
- $this->suffix = $configInstance->readConfig('class_suffix');
- $this->prefix = $configInstance->readConfig('class_prefix');
+ $this->suffix = $configInstance->getConfigEntry('class_suffix');
+ $this->prefix = $configInstance->getConfigEntry('class_prefix');
// Set own instance
self::$selfInstance = $this;
$this->prefix = 'config-';
// Set base directory
- $basePath = $this->configInstance->readConfig('base_path') . 'inc/config/';
+ $basePath = $this->configInstance->getConfigEntry('base_path') . 'inc/config/';
// Load all classes from the config directory
$this->scanClassPath($basePath);
*/
// Get a debugger instance
-$debug = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getInstance()->readConfig('debug_class'));
+$debug = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getInstance()->getConfigEntry('debug_class'));
// Empty string should be ignored and used for testing the middleware
DebugMiddleware::getInstance()->output('');
// Try to load these includes in the given order
$configAppIncludes = array(
- 'class_' . FrameworkConfiguration::getInstance()->readConfig('app_helper_class'), // The ApplicationHelper class
+ 'class_' . FrameworkConfiguration::getInstance()->getConfigEntry('app_helper_class'), // The ApplicationHelper class
'config', // The application's own configuration
'data', // Application data
'init', // The application initializer
);
// Cache base path/file here
-$basePathFile = FrameworkConfiguration::getInstance()->readConfig('application_path') . FrameworkConfiguration::getInstance()->readConfig('app_name');
+$basePathFile = FrameworkConfiguration::getInstance()->getConfigEntry('application_path') . FrameworkConfiguration::getInstance()->getConfigEntry('app_name');
// Is the directory there?
if (!is_dir($basePathFile)) {
// Not found.
- trigger_error('Application ' . FrameworkConfiguration::getInstance()->readConfig('app_name') . ' not found.');
+ trigger_error('Application ' . FrameworkConfiguration::getInstance()->getConfigEntry('app_name') . ' not found.');
} // END - if
// Load them all (try only)
//* DEBUG: */ print basename(__FILE__)."[".__LINE__."]: Loading ".basename($appFqFn)." - START\n";
require($appFqFn);
//* DEBUG: */ print basename(__FILE__)."[".__LINE__."]: Loading ".basename($appFqFn)." - END\n";
- } elseif (FrameworkConfiguration::getInstance()->readConfig('verbose_level') > 0) {
+ } elseif (FrameworkConfiguration::getInstance()->getConfigEntry('verbose_level') > 0) {
// File is missing
trigger_error(sprintf("Cannot load application script %s.php! File is missing or read-protected.",
$appInc
require(dirname(dirname(__FILE__)) . '/inc/config.php');
// Load all include files
-require($cfg->readConfig('base_path') . 'inc/includes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/includes.php');
// Load all game classes
-require($cfg->readConfig('base_path') . 'inc/classes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/classes.php');
// Set default application
FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
$testPassed = false;
try {
// Now find a configuration variable that does not exist
- $dummy = FrameworkConfiguration::getInstance()->readConfig('does_not_exist');
+ $dummy = FrameworkConfiguration::getInstance()->getConfigEntry('does_not_exist');
} catch (ConfigEntryNotFoundException $expected) {
// This exception was expected, so it is fine
$testPassed = true;
$testPassed = false;
try {
// Try to read an empty configuration variable
- $dummy = FrameworkConfiguration::getInstance()->readConfig('');
+ $dummy = FrameworkConfiguration::getInstance()->getConfigEntry('');
} catch (ConfigEntryIsEmptyException $expected) {
// This exception was expected, so it is fine
$testPassed = true;
*
* @return void
*/
- public function testWriteReadConfigEntry () {
+ public function testWritegetConfigEntryEntry () {
// Try it here
$value = "This is a test value";
try {
FrameworkConfiguration::getInstance()->setConfigEntry('test_key', "{$value}");
// Read the config entry we have just written
- $readValue = FrameworkConfiguration::getInstance()->readConfig('test_key');
+ $readValue = FrameworkConfiguration::getInstance()->getConfigEntry('test_key');
// Now test the values
$this->assertEquals($value, $readValue);
require(dirname(dirname(__FILE__)) . '/inc/config.php');
// Load all include files
-require($cfg->readConfig('base_path') . 'inc/includes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/includes.php');
// Load all game classes
-require($cfg->readConfig('base_path') . 'inc/classes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/classes.php');
// Set default application
FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
require(dirname(dirname(__FILE__)) . '/inc/config.php');
// Load all include files
-require($cfg->readConfig('base_path') . 'inc/includes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/includes.php');
// Load all game classes
-require($cfg->readConfig('base_path') . 'inc/classes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/classes.php');
// Set default application
FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
require(dirname(dirname(__FILE__)) . '/inc/config.php');
// Load all include files
-require($cfg->readConfig('base_path') . 'inc/includes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/includes.php');
// Load all game classes
-require($cfg->readConfig('base_path') . 'inc/classes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/classes.php');
// Set default application
FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
require(dirname(dirname(dirname(__FILE__))) . '/inc/config.php');
// Load all include files
-require($cfg->readConfig('base_path') . 'inc/includes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/includes.php');
// Load all game classes
-require($cfg->readConfig('base_path') . 'inc/classes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/classes.php');
// Load file I/O handler
-require($cfg->readConfig('base_path') . 'inc/file_io.php');
+require($cfg->getConfigEntry('base_path') . 'inc/file_io.php');
// Load database layer
-require($cfg->readConfig('base_path') . 'inc/database.php');
+require($cfg->getConfigEntry('base_path') . 'inc/database.php');
// Set default application
FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
$application = 'ship-simu';
// Load more includes
-require($cfg->readConfig('base_path') . 'application/ship-simu/loader.php');
+require($cfg->getConfigEntry('base_path') . 'application/ship-simu/loader.php');
// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
// jetzt die Personalliste wiederherstellen
require(dirname(dirname(dirname(__FILE__))) . '/inc/config.php');
// Load all include files
-require($cfg->readConfig('base_path') . 'inc/includes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/includes.php');
// Load all game classes
-require($cfg->readConfig('base_path') . 'inc/classes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/classes.php');
// Load file I/O handler
-require($cfg->readConfig('base_path') . 'inc/file_io.php');
+require($cfg->getConfigEntry('base_path') . 'inc/file_io.php');
// Load database layer
-require($cfg->readConfig('base_path') . 'inc/database.php');
+require($cfg->getConfigEntry('base_path') . 'inc/database.php');
// Set default application
FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
$application = 'ship-simu';
// Load more includes
-require($cfg->readConfig('base_path') . 'application/ship-simu/loader.php');
+require($cfg->getConfigEntry('base_path') . 'application/ship-simu/loader.php');
// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
// jetzt die Personalliste wiederherstellen
require(dirname(dirname(dirname(__FILE__))) . '/inc/config.php');
// Load all include files
-require($cfg->readConfig('base_path') . 'inc/includes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/includes.php');
// Load all game classes
-require($cfg->readConfig('base_path') . 'inc/classes.php');
+require($cfg->getConfigEntry('base_path') . 'inc/classes.php');
// Load file I/O handler
-require($cfg->readConfig('base_path') . 'inc/file_io.php');
+require($cfg->getConfigEntry('base_path') . 'inc/file_io.php');
// Load database layer
-require($cfg->readConfig('base_path') . 'inc/database.php');
+require($cfg->getConfigEntry('base_path') . 'inc/database.php');
// Set default application
FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu');
$application = 'ship-simu';
// Load more includes
-require($cfg->readConfig('base_path') . 'application/ship-simu/loader.php');
+require($cfg->getConfigEntry('base_path') . 'application/ship-simu/loader.php');
// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
// jetzt die Personalliste wiederherstellen