From: Roland Häder Date: Tue, 28 Jul 2009 17:19:56 +0000 (+0000) Subject: readConfig() is not naming convention, renamed to getConfigEntry() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b9c18d6c24e3be4393bf41005aa4e428a0ea3218;p=core.git readConfig() is not naming convention, renamed to getConfigEntry() --- diff --git a/inc/classes/exceptions/crypto/class_EncryptInvalidLengthException.php b/inc/classes/exceptions/crypto/class_EncryptInvalidLengthException.php index ceebf3ba..63c6c2e3 100644 --- a/inc/classes/exceptions/crypto/class_EncryptInvalidLengthException.php +++ b/inc/classes/exceptions/crypto/class_EncryptInvalidLengthException.php @@ -31,7 +31,7 @@ class EncryptInvalidLengthException extends FrameworkException { */ 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", diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 9f5ede14..5fb9912f 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -270,19 +270,19 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $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 @@ -968,7 +968,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $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], diff --git a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php index 673858d8..8eb65a93 100644 --- a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php @@ -163,7 +163,7 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable { $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'); diff --git a/inc/classes/main/commands/web/class_WebResendLinkCommand.php b/inc/classes/main/commands/web/class_WebResendLinkCommand.php index f1b5b30c..73aa5350 100644 --- a/inc/classes/main/commands/web/class_WebResendLinkCommand.php +++ b/inc/classes/main/commands/web/class_WebResendLinkCommand.php @@ -86,7 +86,7 @@ class WebResendLinkCommand extends BaseCommand implements Commandable { $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); diff --git a/inc/classes/main/criteria/dataset/class_DataSetCriteria.php b/inc/classes/main/criteria/dataset/class_DataSetCriteria.php index c7423cdb..bcce2422 100644 --- a/inc/classes/main/criteria/dataset/class_DataSetCriteria.php +++ b/inc/classes/main/criteria/dataset/class_DataSetCriteria.php @@ -90,7 +90,7 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria { */ public function addConfiguredCriteria ($criteriaKey, $configEntry) { // Add configuration entry as criteria - $value = $this->getConfigInstance()->readConfig($configEntry); + $value = $this->getConfigInstance()->getConfigEntry($configEntry); $this->addCriteria($criteriaKey, $value); } diff --git a/inc/classes/main/criteria/search/class_SearchCriteria.php b/inc/classes/main/criteria/search/class_SearchCriteria.php index 936200a0..09e61431 100644 --- a/inc/classes/main/criteria/search/class_SearchCriteria.php +++ b/inc/classes/main/criteria/search/class_SearchCriteria.php @@ -82,7 +82,7 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria { */ 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); } diff --git a/inc/classes/main/criteria/update/class_UpdateCriteria.php b/inc/classes/main/criteria/update/class_UpdateCriteria.php index 43b5d8f4..3166134e 100644 --- a/inc/classes/main/criteria/update/class_UpdateCriteria.php +++ b/inc/classes/main/criteria/update/class_UpdateCriteria.php @@ -82,7 +82,7 @@ class UpdateCriteria extends BaseCriteria implements LocalUpdateCriteria { */ 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); } diff --git a/inc/classes/main/crypto/class_CryptoHelper.php b/inc/classes/main/crypto/class_CryptoHelper.php index ed0c1795..34480b49 100644 --- a/inc/classes/main/crypto/class_CryptoHelper.php +++ b/inc/classes/main/crypto/class_CryptoHelper.php @@ -115,7 +115,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable { $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); @@ -141,7 +141,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable { // 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); @@ -149,7 +149,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable { // Hash the password with salt //* DEBUG: */ echo "salt=".$salt."/plain=".$str."
\n"; - $hashed = $salt . md5(sprintf($this->getConfigInstance()->readConfig('hash_mask'), + $hashed = $salt . md5(sprintf($this->getConfigInstance()->getConfigEntry('hash_mask'), $salt, $this->rngInstance->getFixedSalt(), $str @@ -171,7 +171,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable { $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()); @@ -235,7 +235,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable { $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()); diff --git a/inc/classes/main/database/databases/class_LocalFileDatabase.php b/inc/classes/main/database/databases/class_LocalFileDatabase.php index 1c03a521..78375f66 100644 --- a/inc/classes/main/database/databases/class_LocalFileDatabase.php +++ b/inc/classes/main/database/databases/class_LocalFileDatabase.php @@ -333,7 +333,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend 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(); diff --git a/inc/classes/main/factories/cache/class_CacheFactory.php b/inc/classes/main/factories/cache/class_CacheFactory.php index 5e169fb9..33619baa 100644 --- a/inc/classes/main/factories/cache/class_CacheFactory.php +++ b/inc/classes/main/factories/cache/class_CacheFactory.php @@ -60,7 +60,7 @@ class CacheFactory extends BaseFactory { */ 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); diff --git a/inc/classes/main/factories/objects/class_ObjectFactory.php b/inc/classes/main/factories/objects/class_ObjectFactory.php index 874d1401..e3be9d28 100644 --- a/inc/classes/main/factories/objects/class_ObjectFactory.php +++ b/inc/classes/main/factories/objects/class_ObjectFactory.php @@ -85,7 +85,7 @@ class ObjectFactory extends BaseFactory { */ 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); diff --git a/inc/classes/main/factories/web/class_WebNewsFactory.php b/inc/classes/main/factories/web/class_WebNewsFactory.php index 304d5a15..1c2906e3 100644 --- a/inc/classes/main/factories/web/class_WebNewsFactory.php +++ b/inc/classes/main/factories/web/class_WebNewsFactory.php @@ -67,7 +67,7 @@ class WebNewsFactory extends BaseFactory { } // 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)); diff --git a/inc/classes/main/filter/auth/class_UserAuthFilter.php b/inc/classes/main/filter/auth/class_UserAuthFilter.php index 4b9e0ddb..7745492f 100644 --- a/inc/classes/main/filter/auth/class_UserAuthFilter.php +++ b/inc/classes/main/filter/auth/class_UserAuthFilter.php @@ -62,7 +62,7 @@ class UserAuthFilter extends BaseFilter implements Filterable { * @return void */ protected function setDefaultAuthMethod () { - $this->authMethod = $this->getConfigInstance()->readConfig('auth_method_class'); + $this->authMethod = $this->getConfigInstance()->getConfigEntry('auth_method_class'); } /** @@ -102,13 +102,13 @@ class UserAuthFilter extends BaseFilter implements Filterable { } // 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 diff --git a/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php b/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php index 13ed7600..99fc84cf 100644 --- a/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php +++ b/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php @@ -73,7 +73,7 @@ class CaptchaEncryptFilter extends BaseFilter implements Filterable { $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); diff --git a/inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php b/inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php index 1d2c4eb3..518b1719 100644 --- a/inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php +++ b/inc/classes/main/filter/guest/class_UserNameIsGuestFilter.php @@ -58,10 +58,10 @@ class UserNameIsGuestFilter extends BaseFilter implements Filterable { $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 } } diff --git a/inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php b/inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php index a59e5051..5b94ec26 100644 --- a/inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php +++ b/inc/classes/main/filter/update/class_UserStatusConfimedUpdateFilter.php @@ -57,7 +57,7 @@ class UserStatusConfimedUpdateFilter extends BaseFilter implements Filterable { $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); diff --git a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php index 7d315039..8ec637cb 100644 --- a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php @@ -61,7 +61,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable { $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'); @@ -148,7 +148,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable { $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); diff --git a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php index 19ffd9bd..1d13472b 100644 --- a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php @@ -115,7 +115,8 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable { // 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); diff --git a/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php index 163ecffb..9fee9209 100644 --- a/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php @@ -118,7 +118,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable { // 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); diff --git a/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php index 50719fe1..b43b7f1c 100644 --- a/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php @@ -115,7 +115,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable { // 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); diff --git a/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php index ac76f566..43d71161 100644 --- a/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php @@ -57,7 +57,7 @@ class UserStatusVerifierFilter extends BaseFilter implements Filterable { $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); diff --git a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php index 35549fb8..63347c6e 100644 --- a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php @@ -54,7 +54,7 @@ class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable { */ 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)); @@ -72,7 +72,7 @@ class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable { } // 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); diff --git a/inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php b/inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php index 6fe5795b..84cc009d 100644 --- a/inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php +++ b/inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php @@ -70,10 +70,10 @@ class GraphicalCodeCaptcha extends BaseCaptcha implements SolveableCaptcha { */ 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)); @@ -91,7 +91,7 @@ class GraphicalCodeCaptcha extends BaseCaptcha implements SolveableCaptcha { $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(); diff --git a/inc/classes/main/helper/web/blocks/class_WebBlockHelper.php b/inc/classes/main/helper/web/blocks/class_WebBlockHelper.php index 64aafc77..23e99d98 100644 --- a/inc/classes/main/helper/web/blocks/class_WebBlockHelper.php +++ b/inc/classes/main/helper/web/blocks/class_WebBlockHelper.php @@ -83,7 +83,7 @@ class WebBlockHelper extends BaseWebHelper implements HelpableTemplate { * @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; } diff --git a/inc/classes/main/helper/web/class_BaseWebHelper.php b/inc/classes/main/helper/web/class_BaseWebHelper.php index d4aab6a7..d9ba848a 100644 --- a/inc/classes/main/helper/web/class_BaseWebHelper.php +++ b/inc/classes/main/helper/web/class_BaseWebHelper.php @@ -40,7 +40,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -50,7 +50,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -60,7 +60,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -70,7 +70,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -80,7 +80,7 @@ class BaseWebHelper extends BaseHelper { * @return $isUnique */ public function ifEmailMustBeUnique () { - $isUnique = ($this->getConfigInstance()->readConfig('register_email_unique') == 'Y'); + $isUnique = ($this->getConfigInstance()->getConfigEntry('register_email_unique') == 'Y'); return $isUnique; } @@ -90,7 +90,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -100,7 +100,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -110,7 +110,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -120,7 +120,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -130,7 +130,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -140,7 +140,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -160,7 +160,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -170,7 +170,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -180,7 +180,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -190,7 +190,7 @@ class BaseWebHelper extends BaseHelper { * @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; } @@ -201,7 +201,7 @@ class BaseWebHelper extends BaseHelper { * @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; } } diff --git a/inc/classes/main/helper/web/forms/class_WebFormHelper.php b/inc/classes/main/helper/web/forms/class_WebFormHelper.php index 5542d3a5..815db8d9 100644 --- a/inc/classes/main/helper/web/forms/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/forms/class_WebFormHelper.php @@ -116,10 +116,10 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { // Add HTML code $formContent = sprintf("
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 @@ -272,7 +272,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { */ 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."
\n"; // Add the text field @@ -723,7 +723,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { * @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; } @@ -733,7 +733,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { * @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; } @@ -743,7 +743,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { * @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; } diff --git a/inc/classes/main/helper/web/links/class_WebLinkHelper.php b/inc/classes/main/helper/web/links/class_WebLinkHelper.php index bbec50a6..fa0d9a2b 100644 --- a/inc/classes/main/helper/web/links/class_WebLinkHelper.php +++ b/inc/classes/main/helper/web/links/class_WebLinkHelper.php @@ -104,7 +104,7 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { // 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? diff --git a/inc/classes/main/language/class_LanguageSystem.php b/inc/classes/main/language/class_LanguageSystem.php index fd082dd0..30e97786 100644 --- a/inc/classes/main/language/class_LanguageSystem.php +++ b/inc/classes/main/language/class_LanguageSystem.php @@ -95,7 +95,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage, $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; diff --git a/inc/classes/main/mailer/class_BaseMailer.php b/inc/classes/main/mailer/class_BaseMailer.php index efda8218..08f66fc4 100644 --- a/inc/classes/main/mailer/class_BaseMailer.php +++ b/inc/classes/main/mailer/class_BaseMailer.php @@ -58,7 +58,7 @@ class BaseMailer extends BaseFrameworkSystem { $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); diff --git a/inc/classes/main/output/class_ConsoleOutput.php b/inc/classes/main/output/class_ConsoleOutput.php index a8b8155e..599ec7f9 100644 --- a/inc/classes/main/output/class_ConsoleOutput.php +++ b/inc/classes/main/output/class_ConsoleOutput.php @@ -76,7 +76,7 @@ class ConsoleOutput extends BaseFrameworkSystem implements OutputStreamer { */ 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; diff --git a/inc/classes/main/points/class_UserPoints.php b/inc/classes/main/points/class_UserPoints.php index 8da3eb94..1fb95326 100644 --- a/inc/classes/main/points/class_UserPoints.php +++ b/inc/classes/main/points/class_UserPoints.php @@ -89,7 +89,7 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo $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'); diff --git a/inc/classes/main/reader/class_ConsoleNewsReader.php b/inc/classes/main/reader/class_ConsoleNewsReader.php index e954686a..662609a8 100644 --- a/inc/classes/main/reader/class_ConsoleNewsReader.php +++ b/inc/classes/main/reader/class_ConsoleNewsReader.php @@ -73,7 +73,7 @@ class ConsoleNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg $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); diff --git a/inc/classes/main/reader/class_DefaultNewsReader.php b/inc/classes/main/reader/class_DefaultNewsReader.php index 0240b74d..c15ee30a 100644 --- a/inc/classes/main/reader/class_DefaultNewsReader.php +++ b/inc/classes/main/reader/class_DefaultNewsReader.php @@ -73,7 +73,7 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg $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); diff --git a/inc/classes/main/resolver/action/web/class_WebActionResolver.php b/inc/classes/main/resolver/action/web/class_WebActionResolver.php index 4f963db0..2118ba77 100644 --- a/inc/classes/main/resolver/action/web/class_WebActionResolver.php +++ b/inc/classes/main/resolver/action/web/class_WebActionResolver.php @@ -89,7 +89,7 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver { $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) { @@ -127,7 +127,7 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver { $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) { diff --git a/inc/classes/main/resolver/command/console/class_ConsoleCommandResolver.php b/inc/classes/main/resolver/command/console/class_ConsoleCommandResolver.php index b3903d6a..5eccb000 100644 --- a/inc/classes/main/resolver/command/console/class_ConsoleCommandResolver.php +++ b/inc/classes/main/resolver/command/console/class_ConsoleCommandResolver.php @@ -89,7 +89,7 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol $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) { @@ -125,7 +125,7 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol $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) { diff --git a/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php b/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php index 9dca5ec9..71c7a1b4 100644 --- a/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php +++ b/inc/classes/main/resolver/command/image/class_ImageCommandResolver.php @@ -89,7 +89,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve $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) { @@ -125,7 +125,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve $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) { diff --git a/inc/classes/main/resolver/command/web/class_WebCommandResolver.php b/inc/classes/main/resolver/command/web/class_WebCommandResolver.php index cb23dd1b..da0c35a6 100644 --- a/inc/classes/main/resolver/command/web/class_WebCommandResolver.php +++ b/inc/classes/main/resolver/command/web/class_WebCommandResolver.php @@ -89,7 +89,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver $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) { @@ -125,7 +125,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver $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) { diff --git a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php index 85662f67..e3a57211 100644 --- a/inc/classes/main/resolver/controller/class_BaseControllerResolver.php +++ b/inc/classes/main/resolver/controller/class_BaseControllerResolver.php @@ -94,7 +94,7 @@ class BaseControllerResolver extends BaseResolver { */ 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; @@ -131,7 +131,7 @@ class BaseControllerResolver extends BaseResolver { $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? diff --git a/inc/classes/main/response/class_BaseResponse.php b/inc/classes/main/response/class_BaseResponse.php index 694996b9..c7990d7f 100644 --- a/inc/classes/main/response/class_BaseResponse.php +++ b/inc/classes/main/response/class_BaseResponse.php @@ -170,7 +170,7 @@ class BaseResponse extends BaseFrameworkSystem { $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) { diff --git a/inc/classes/main/response/console/class_ConsoleResponse.php b/inc/classes/main/response/console/class_ConsoleResponse.php index 8320e47e..d7a76804 100644 --- a/inc/classes/main/response/console/class_ConsoleResponse.php +++ b/inc/classes/main/response/console/class_ConsoleResponse.php @@ -118,7 +118,7 @@ class ConsoleResponse extends BaseResponse implements Responseable { * @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; } diff --git a/inc/classes/main/response/http/class_HttpResponse.php b/inc/classes/main/response/http/class_HttpResponse.php index 0bd0ff2d..3d37fded 100644 --- a/inc/classes/main/response/http/class_HttpResponse.php +++ b/inc/classes/main/response/http/class_HttpResponse.php @@ -97,11 +97,11 @@ class HttpResponse extends BaseResponse implements Responseable { // 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'])) @@ -135,7 +135,7 @@ class HttpResponse extends BaseResponse implements Responseable { $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); @@ -146,7 +146,7 @@ class HttpResponse extends BaseResponse implements Responseable { 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 @@ -202,7 +202,7 @@ class HttpResponse extends BaseResponse implements Responseable { * @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; } } diff --git a/inc/classes/main/response/image/class_ImageResponse.php b/inc/classes/main/response/image/class_ImageResponse.php index 27fac282..28c67f5f 100644 --- a/inc/classes/main/response/image/class_ImageResponse.php +++ b/inc/classes/main/response/image/class_ImageResponse.php @@ -71,7 +71,7 @@ class ImageResponse extends BaseResponse implements Responseable { $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/'); @@ -111,11 +111,11 @@ class ImageResponse extends BaseResponse implements Responseable { // 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'])) @@ -149,7 +149,7 @@ class ImageResponse extends BaseResponse implements Responseable { $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); @@ -160,7 +160,7 @@ class ImageResponse extends BaseResponse implements Responseable { 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 @@ -259,7 +259,7 @@ class ImageResponse extends BaseResponse implements Responseable { * @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; } } diff --git a/inc/classes/main/rng/class_RandomNumberGenerator.php b/inc/classes/main/rng/class_RandomNumberGenerator.php index 3469b615..53ef6e76 100644 --- a/inc/classes/main/rng/class_RandomNumberGenerator.php +++ b/inc/classes/main/rng/class_RandomNumberGenerator.php @@ -88,7 +88,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem { */ 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 @@ -101,7 +101,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem { $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 @@ -116,10 +116,10 @@ class RandomNumberGenerator extends BaseFrameworkSystem { } // 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'); } /** diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index d6b3a157..5a45bd71 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -541,7 +541,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { // 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(), @@ -556,7 +556,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $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(); @@ -930,7 +930,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ 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); @@ -945,7 +945,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { public function assignConfigVariable ($var) { // Sweet and simple... //* DEBUG: */ echo __METHOD__.':var={$var}
\n'; - $this->varStack['config'][$var] = $this->getConfigInstance()->readConfig($var); + $this->varStack['config'][$var] = $this->getConfigInstance()->getConfigEntry($var); } /** @@ -957,7 +957,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ 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); @@ -972,7 +972,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ 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); @@ -986,7 +986,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ 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 @@ -1084,9 +1084,9 @@ class BaseTemplateEngine extends BaseFrameworkSystem { */ 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. diff --git a/inc/classes/main/template/image/class_ImageTemplateEngine.php b/inc/classes/main/template/image/class_ImageTemplateEngine.php index fd321ab4..eb536f84 100644 --- a/inc/classes/main/template/image/class_ImageTemplateEngine.php +++ b/inc/classes/main/template/image/class_ImageTemplateEngine.php @@ -92,7 +92,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl $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)) { @@ -120,11 +120,11 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl $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; @@ -475,7 +475,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl 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( @@ -508,7 +508,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl */ 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); diff --git a/inc/classes/main/template/mail/class_MailTemplateEngine.php b/inc/classes/main/template/mail/class_MailTemplateEngine.php index bad30ac3..2f69fab3 100644 --- a/inc/classes/main/template/mail/class_MailTemplateEngine.php +++ b/inc/classes/main/template/mail/class_MailTemplateEngine.php @@ -78,7 +78,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla $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)) { @@ -106,11 +106,11 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla $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; diff --git a/inc/classes/main/template/menu/class_MenuTemplateEngine.php b/inc/classes/main/template/menu/class_MenuTemplateEngine.php index 8c5cee4d..2d387124 100644 --- a/inc/classes/main/template/menu/class_MenuTemplateEngine.php +++ b/inc/classes/main/template/menu/class_MenuTemplateEngine.php @@ -53,7 +53,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla $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)) { @@ -81,11 +81,11 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla $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; diff --git a/inc/classes/main/template/web/class_WebTemplateEngine.php b/inc/classes/main/template/web/class_WebTemplateEngine.php index bc7eb79c..aee5afa9 100644 --- a/inc/classes/main/template/web/class_WebTemplateEngine.php +++ b/inc/classes/main/template/web/class_WebTemplateEngine.php @@ -54,7 +54,7 @@ class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplat $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)) { @@ -82,11 +82,11 @@ class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplat $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; diff --git a/inc/classes/main/user/member/class_Member.php b/inc/classes/main/user/member/class_Member.php index 9fc58839..907a495e 100644 --- a/inc/classes/main/user/member/class_Member.php +++ b/inc/classes/main/user/member/class_Member.php @@ -117,7 +117,7 @@ class Member extends BaseUser implements ManageableMember, Registerable { // 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 diff --git a/inc/config.php b/inc/config.php index 1e0c07cd..1226b150 100644 --- a/inc/config.php +++ b/inc/config.php @@ -42,7 +42,7 @@ $cfg->setConfigEntry('base_url', $cfg->detectBaseUrl()); $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'); @@ -84,7 +84,7 @@ $cfg->setConfigEntry('compressor_base_path', 'inc/classes/main/compressor/'); $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/'); diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index 85da3032..12d70442 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -111,7 +111,7 @@ class FrameworkConfiguration implements Registerable { // 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 @@ -130,7 +130,7 @@ class FrameworkConfiguration implements Registerable { * @throws ConfigEntryNotFoundException If a configuration element * was not found */ - public function readConfig ($cfgEntry) { + public function getConfigEntry ($cfgEntry) { // Cast to string $cfgEntry = (string) $cfgEntry; diff --git a/inc/database.php b/inc/database.php index f2b5632f..40d58f0b 100644 --- a/inc/database.php +++ b/inc/database.php @@ -26,7 +26,7 @@ $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))) { @@ -35,7 +35,7 @@ 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') )); } diff --git a/inc/database/lib-local.php b/inc/database/lib-local.php index 6d47355d..218f9298 100644 --- a/inc/database/lib-local.php +++ b/inc/database/lib-local.php @@ -24,7 +24,7 @@ // 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() ); diff --git a/inc/includes.php b/inc/includes.php index 107fbed3..29572e19 100644 --- a/inc/includes.php +++ b/inc/includes.php @@ -23,14 +23,14 @@ */ // 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'])) { @@ -45,11 +45,11 @@ 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 @@ -62,7 +62,7 @@ $application = preg_replace('/([^a-z0-9_-])+/i', '', $application); 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 diff --git a/inc/language.php b/inc/language.php index 627baabe..38ae358d 100644 --- a/inc/language.php +++ b/inc/language.php @@ -23,8 +23,8 @@ // 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? diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index b6094879..97a477e5 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -135,13 +135,13 @@ class ClassLoader { // 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; @@ -315,7 +315,7 @@ class ClassLoader { $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); diff --git a/inc/output.php b/inc/output.php index 603fae75..5216da1a 100644 --- a/inc/output.php +++ b/inc/output.php @@ -23,7 +23,7 @@ */ // 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(''); diff --git a/inc/selector.php b/inc/selector.php index 05b2379d..a441dafc 100644 --- a/inc/selector.php +++ b/inc/selector.php @@ -24,7 +24,7 @@ // 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 @@ -35,12 +35,12 @@ $configAppIncludes = array( ); // 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) @@ -60,7 +60,7 @@ foreach ($configAppIncludes as $appInc) { //* 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 diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 888bbdf8..30d45ff5 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); 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'); @@ -59,7 +59,7 @@ class ConfigTest extends PHPUnit_Framework_TestCase { $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; @@ -85,7 +85,7 @@ class ConfigTest extends PHPUnit_Framework_TestCase { $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; @@ -131,7 +131,7 @@ class ConfigTest extends PHPUnit_Framework_TestCase { * * @return void */ - public function testWriteReadConfigEntry () { + public function testWritegetConfigEntryEntry () { // Try it here $value = "This is a test value"; try { @@ -139,7 +139,7 @@ class ConfigTest extends PHPUnit_Framework_TestCase { 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); diff --git a/tests/RegistryTest.php b/tests/RegistryTest.php index 93cafa9b..78fc1968 100644 --- a/tests/RegistryTest.php +++ b/tests/RegistryTest.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); 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'); diff --git a/tests/RequestTest.php b/tests/RequestTest.php index 5c1cc76a..6312351a 100644 --- a/tests/RequestTest.php +++ b/tests/RequestTest.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); 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'); diff --git a/tests/Test.php b/tests/Test.php index 7dba7906..400f417a 100644 --- a/tests/Test.php +++ b/tests/Test.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); 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'); diff --git a/tests/old/contract-test.php b/tests/old/contract-test.php index ccf6fdb9..f29180e2 100644 --- a/tests/old/contract-test.php +++ b/tests/old/contract-test.php @@ -9,23 +9,23 @@ define('TEST_MODE', true); 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 diff --git a/tests/old/loader-test.php b/tests/old/loader-test.php index d8e00c62..7553ba21 100644 --- a/tests/old/loader-test.php +++ b/tests/old/loader-test.php @@ -9,23 +9,23 @@ define('TEST_MODE', true); 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 diff --git a/tests/old/personell-test.php b/tests/old/personell-test.php index c09ae48c..2399ed4f 100644 --- a/tests/old/personell-test.php +++ b/tests/old/personell-test.php @@ -9,23 +9,23 @@ define('TEST_MODE', true); 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