From 0d566e56ff27dcbf25a90d513950bbf26fe71422 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 11 Aug 2009 16:43:10 +0000 Subject: [PATCH] Fix for method in FrameworkConfiguration, removal of unneccessary code - Fix for wrongly named method 'isConfigEntrySet', must be 'isConfigurationEntrySet' due to we don't want to use shorted names - Removed legacy array $systemClasses - Removed two methods to reduce the call stack --- .gitattributes | 1 + .../interfaces/class_FrameworkInterface.php | 1 + .../crypto/class_EncryptableStream.php | 15 +++ inc/classes/main/actions/class_BaseAction.php | 4 - .../application/class_BaseApplication.php | 4 - inc/classes/main/auth/class_CookieAuth.php | 4 - inc/classes/main/cache/class_MemoryCache.php | 4 - inc/classes/main/class_ | 4 - inc/classes/main/class_Base | 4 - .../main/class_BaseFrameworkSystem.php | 92 ++++--------------- .../main/controller/class_BaseController.php | 4 - .../main/criteria/class_BaseCriteria.php | 4 - .../main/crypto/class_CryptoHelper.php | 4 - inc/classes/main/database/class_ | 4 - .../database/class_BaseDatabaseWrapper.php | 4 - .../databases/class_LocalFileDatabase.php | 4 - inc/classes/main/discovery/class_ | 4 - .../main/discovery/class_BaseDiscovery.php | 4 - .../payment/class_LocalPaymentDiscovery.php | 4 - .../main/factories/class_BaseFactory.php | 28 ------ .../filter/class_AbstractFilterDecorator.php | 87 +----------------- inc/classes/main/filter/class_BaseFilter.php | 4 - .../main/filter/class_BaseFilterDecorator.php | 83 +++++++++++++++++ inc/classes/main/filter/class_FilterChain.php | 4 - inc/classes/main/helper/class_BaseHelper.php | 4 - inc/classes/main/images/class_BaseImage.php | 4 - inc/classes/main/io/class_FileIoStream.php | 4 - .../io/class_FrameworkDirectoryPointer.php | 4 - .../io/class_FrameworkFileInputPointer.php | 4 - .../io/class_FrameworkFileOutputPointer.php | 4 - .../main/language/class_LanguageSystem.php | 4 - inc/classes/main/mailer/class_BaseMailer.php | 4 - inc/classes/main/menu/class_BaseMenu.php | 4 - inc/classes/main/points/class_UserPoints.php | 4 - .../main/reader/class_ConsoleNewsReader.php | 4 - .../main/reader/class_DefaultNewsReader.php | 4 - .../registration/class_BaseRegistration.php | 4 - inc/classes/main/registry/class_Registry.php | 4 - .../main/request/class_BaseRequest.php | 4 - .../main/resolver/class_BaseResolver.php | 4 - .../main/response/class_BaseResponse.php | 4 - .../main/result/class_DatabaseResult.php | 4 - .../main/rng/class_RandomNumberGenerator.php | 4 - inc/classes/main/streams/class_BaseStream.php | 4 - .../streams/crypto/class_NullCryptoStream.php | 28 ++++++ .../template/class_BaseTemplateEngine.php | 4 - inc/classes/main/user/class_BaseUser.php | 4 - .../middleware/class_BaseMiddleware.php | 4 - .../api/primusportal/class_PrimeraApi.php | 8 +- .../api/wernisportal/class_WernisApi.php | 4 - inc/config/class_FrameworkConfiguration.php | 2 +- 51 files changed, 150 insertions(+), 359 deletions(-) create mode 100755 inc/classes/main/filter/class_BaseFilterDecorator.php diff --git a/.gitattributes b/.gitattributes index 020a7810..cdcec144 100644 --- a/.gitattributes +++ b/.gitattributes @@ -331,6 +331,7 @@ inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php -text inc/classes/main/filter/class_ -text inc/classes/main/filter/class_AbstractFilterDecorator.php -text inc/classes/main/filter/class_BaseFilter.php -text +inc/classes/main/filter/class_BaseFilterDecorator.php -text inc/classes/main/filter/class_FilterChain.php -text inc/classes/main/filter/crypto/.htaccess -text inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php -text diff --git a/inc/classes/interfaces/class_FrameworkInterface.php b/inc/classes/interfaces/class_FrameworkInterface.php index 2859d7a3..ea2df039 100644 --- a/inc/classes/interfaces/class_FrameworkInterface.php +++ b/inc/classes/interfaces/class_FrameworkInterface.php @@ -8,6 +8,7 @@ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org + * @todo Find a better name for this interface * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/inc/classes/interfaces/streams/crypto/class_EncryptableStream.php b/inc/classes/interfaces/streams/crypto/class_EncryptableStream.php index fafb299a..ae4a5e69 100644 --- a/inc/classes/interfaces/streams/crypto/class_EncryptableStream.php +++ b/inc/classes/interfaces/streams/crypto/class_EncryptableStream.php @@ -22,6 +22,21 @@ * along with this program. If not, see . */ interface EncryptableStream extends Streamable { + /** + * Encrypt the string with fixed salt + * + * @param $str The unencrypted string + * @return $encrypted Encrypted string + */ + function encryptStream ($str); + + /** + * Decrypt the string with fixed salt + * + * @param $encrypted Encrypted string + * @return $str The unencrypted string + */ + function decryptStream ($encrypted); } // diff --git a/inc/classes/main/actions/class_BaseAction.php b/inc/classes/main/actions/class_BaseAction.php index bdfccd1d..9f6d71fa 100644 --- a/inc/classes/main/actions/class_BaseAction.php +++ b/inc/classes/main/actions/class_BaseAction.php @@ -33,10 +33,6 @@ class BaseAction extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } } diff --git a/inc/classes/main/application/class_BaseApplication.php b/inc/classes/main/application/class_BaseApplication.php index 89884cc3..bf6ec3e0 100644 --- a/inc/classes/main/application/class_BaseApplication.php +++ b/inc/classes/main/application/class_BaseApplication.php @@ -32,10 +32,6 @@ class BaseApplication extends BaseFrameworkSystem { // Call parent constructor parent::__construct($className); - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); - // Get registry instance $registryInstance = Registry::getRegistry(); diff --git a/inc/classes/main/auth/class_CookieAuth.php b/inc/classes/main/auth/class_CookieAuth.php index b6e00764..e302ccb2 100644 --- a/inc/classes/main/auth/class_CookieAuth.php +++ b/inc/classes/main/auth/class_CookieAuth.php @@ -30,10 +30,6 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/cache/class_MemoryCache.php b/inc/classes/main/cache/class_MemoryCache.php index 1b03c723..da004138 100644 --- a/inc/classes/main/cache/class_MemoryCache.php +++ b/inc/classes/main/cache/class_MemoryCache.php @@ -35,10 +35,6 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/class_ b/inc/classes/main/class_ index 23b54cab..992c09fb 100644 --- a/inc/classes/main/class_ +++ b/inc/classes/main/class_ @@ -30,10 +30,6 @@ class extends BaseFrameworkSystem { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } } diff --git a/inc/classes/main/class_Base b/inc/classes/main/class_Base index d2067452..34a47d02 100644 --- a/inc/classes/main/class_Base +++ b/inc/classes/main/class_Base @@ -31,10 +31,6 @@ class Base??? extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } } diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 0b5ce310..9e7f247b 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -161,29 +161,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { const EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED = 0x039; const EXCEPTION_FILTER_CHAIN_INTERCEPTED = 0x040; - /** - * In the super constructor these system classes shall be ignored or else - * we would get an endless calling loop. - * - *---------------------------------------------------------------------* - * ATTENTION: IF YOU REMOVE ONE OF THEM YOU WILL RUN YOUR SERVER IN AN * - * ENDLESS LOOP !!! * - *---------------------------------------------------------------------* - */ - private $systemClasses = array( - 'DebugMiddleware', // Debug middleware output sub-system - 'Registry', // Object registry - 'ObjectFactory', // Object factory - 'DebugWebOutput', // Debug web output sub-system - 'WebOutput', // Web output sub-system - 'CompressorChannel', // Compressor sub-system - 'DebugConsoleOutput', // Debug console output sub-system - 'DebugErrorLogOutput', // Debug error_log() output sub-system - 'FrameworkDirectoryPointer', // Directory handler sub-system - 'NullCompressor', // Null compressor - 'Bzip2Compressor', // BZIP2 compressor - 'GzipCompressor', // GZIP compressor - ); /** * Protected super constructor * @@ -274,33 +251,8 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ private final function initInstance () { - // Is this a system class? - if (!in_array($this->__toString(), $this->systemClasses)) { - // Set configuration instance - $this->setConfigInstance(FrameworkConfiguration::getInstance()); - - // Add application helper to our class - $this->systemclasses[] = $this->getConfigInstance()->getConfigEntry('app_helper_class'); - - // Set debug instance - $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->getConfigEntry('debug_class'))); - - // Get output instance and set it - $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()->getConfigEntry('base_path'). - $this->getConfigInstance()->getConfigEntry('compressor_base_path') - )); - - // Initialization done! :D - Registry::isInitialized('OK'); - } elseif ($this->__toString() == 'DebugMiddleware') { - // Set configuration instance - $this->setConfigInstance(FrameworkConfiguration::getInstance()); - } + // Set configuration instance + $this->setConfigInstance(FrameworkConfiguration::getInstance()); } /** @@ -591,13 +543,22 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { } /** - * Compare class name of this and given class name + * Checks wether an object equals this object. You should overwrite this + * method to implement own equality checks * - * @param $className The class name as string from the other class - * @return boolean The result of comparing both class names + * @param $objectInstance An instance of a FrameworkInterface object + * @return $equals Wether both objects equals */ - public final function isClass ($className) { - return ($this->__toString() == $className); + public function equals (FrameworkInterface $objectInstance) { + // Now test it + $equals = (( + $this->__toString() == $objectInstance->__toString() + ) && ( + $this->hashCode() == $objectInstance->hashCode() + )); + + // Return the result + return $result; } /** @@ -629,16 +590,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $price; } - /** - * Removes number formating characters - * - * @return void - */ - public final function removeNumberFormaters () { - unset($this->thousands); - unset($this->decimals); - } - /** * Private getter for language instance * @@ -660,15 +611,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { Registry::getRegistry()->addInstance('language', $langInstance); } - /** - * Remove the $systemClasses array from memory - * - * @return void - */ - public final function removeSystemArray () { - unset($this->systemClasses); - } - /** * Appends a trailing slash to a string * @@ -716,7 +658,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @throws NullPointerException If the discovered application * instance is still null */ - protected function prepareTemplateInstance (BaseFrameworkSystem $appInstance=null) { + protected function prepareTemplateInstance (FrameworkInterface $appInstance=null) { // Is the application instance set? if (is_null($appInstance)) { // Get the current instance diff --git a/inc/classes/main/controller/class_BaseController.php b/inc/classes/main/controller/class_BaseController.php index 9e1c43e0..7839ea02 100644 --- a/inc/classes/main/controller/class_BaseController.php +++ b/inc/classes/main/controller/class_BaseController.php @@ -42,10 +42,6 @@ class BaseController extends BaseFrameworkSystem implements Registerable { // Call parent constructor parent::__construct($className); - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); - // Initialize both filter chains $this->initFilterChain('pre'); $this->initFilterChain('post'); diff --git a/inc/classes/main/criteria/class_BaseCriteria.php b/inc/classes/main/criteria/class_BaseCriteria.php index 6b870c41..67f9918e 100644 --- a/inc/classes/main/criteria/class_BaseCriteria.php +++ b/inc/classes/main/criteria/class_BaseCriteria.php @@ -36,10 +36,6 @@ class BaseCriteria extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/crypto/class_CryptoHelper.php b/inc/classes/main/crypto/class_CryptoHelper.php index c135b189..cbac7d7b 100644 --- a/inc/classes/main/crypto/class_CryptoHelper.php +++ b/inc/classes/main/crypto/class_CryptoHelper.php @@ -54,10 +54,6 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/database/class_ b/inc/classes/main/database/class_ index e80a4b8a..0fa9de49 100644 --- a/inc/classes/main/database/class_ +++ b/inc/classes/main/database/class_ @@ -31,10 +31,6 @@ class extends BaseDatabaseFrontend { protected function __construct($class = __CLASS__) { // Call parent constructor parent::__construct($class); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } } diff --git a/inc/classes/main/database/class_BaseDatabaseWrapper.php b/inc/classes/main/database/class_BaseDatabaseWrapper.php index 8d999f13..5e7099e7 100644 --- a/inc/classes/main/database/class_BaseDatabaseWrapper.php +++ b/inc/classes/main/database/class_BaseDatabaseWrapper.php @@ -43,10 +43,6 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { // Initialize the cache instance $this->initCacheInstance(); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/database/databases/class_LocalFileDatabase.php b/inc/classes/main/database/databases/class_LocalFileDatabase.php index 2d4929c8..d4c45e97 100644 --- a/inc/classes/main/database/databases/class_LocalFileDatabase.php +++ b/inc/classes/main/database/databases/class_LocalFileDatabase.php @@ -86,10 +86,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend protected function __construct() { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/discovery/class_ b/inc/classes/main/discovery/class_ index 18fd375c..4aeb610f 100644 --- a/inc/classes/main/discovery/class_ +++ b/inc/classes/main/discovery/class_ @@ -32,10 +32,6 @@ class ???Discovery extends BaseDiscovery implements Discoverable { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/discovery/class_BaseDiscovery.php b/inc/classes/main/discovery/class_BaseDiscovery.php index 40c67d8d..4429cf68 100644 --- a/inc/classes/main/discovery/class_BaseDiscovery.php +++ b/inc/classes/main/discovery/class_BaseDiscovery.php @@ -36,10 +36,6 @@ class BaseDiscovery extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php b/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php index 175756ea..e2530e81 100644 --- a/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php +++ b/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php @@ -32,10 +32,6 @@ class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable, Regis protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/factories/class_BaseFactory.php b/inc/classes/main/factories/class_BaseFactory.php index e897950f..5c4187f9 100644 --- a/inc/classes/main/factories/class_BaseFactory.php +++ b/inc/classes/main/factories/class_BaseFactory.php @@ -22,11 +22,6 @@ * along with this program. If not, see . */ class BaseFactory extends BaseFrameworkSystem { - /** - * An instance of the real factory class - */ - private $realFactoryInstance = null; - /** * Protected constructor * @@ -36,29 +31,6 @@ class BaseFactory extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); - } - - /** - * Setter for the *real* factory instance - * - * @param $realFactoryInstance An instance of the real factory class - * @return void - */ - public final function setRealFactoryInstance (BaseFrameworkSystem $realFactoryInstance) { - $this->realFactoryInstance = $realFactoryInstance; - } - - /** - * Getter for the *real* factory instance - * - * @return $realFactoryInstance An instance of the real factory class - */ - protected final function getRealFactoryInstance () { - return $this->realFactoryInstance; } } diff --git a/inc/classes/main/filter/class_AbstractFilterDecorator.php b/inc/classes/main/filter/class_AbstractFilterDecorator.php index 1d739c6b..adae8d19 100644 --- a/inc/classes/main/filter/class_AbstractFilterDecorator.php +++ b/inc/classes/main/filter/class_AbstractFilterDecorator.php @@ -1,87 +1,4 @@ - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -abstract class AbstractFilterDecorator extends BaseFrameworkSystem implements Filterable { - /** - * The decorated filter instance - */ - private $filterInstance = null; - - /** - * Protected constructor - * - * @param $className Name of the real class' name - * @return void - */ - protected function __construct ($className) { - // Call parent constructor - parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); - } - - /** - * Setter for the decorated filter instance - * - * @param $filterInstance An instance of a filter - * @return void - */ - protected final function setFilterInstance (Filterable $filterInstance) { - $this->filterInstance = $filterInstance; - } - - /** - * Getter for the decorated filter instance - * - * @return $filterInstance An instance of a filter - */ - protected final function getFilterInstance () { - return $this->filterInstance; - } - - /** - * Execute the inner filter - * - * @param $requestInstance An instance of a request class - * @param $responseInstance An instance of a response class - * @return void - */ - public final function execute (Requestable $requestInstance, Responseable $responseInstance) { - $this->getFilterInstance()->execute($requestInstance, $responseInstance); - } - - - /** - * Do the execution of the filter - * - * @param $requestInstance An instance of a request class - * @param $responseInstance An instance of a response class - * @return void - */ - abstract public function doExecute (Requestable $requestInstance, Responseable $responseInstance); -} - -// [EOF] +// @DEPRECATED +die("Use BaseFilterDecorator instead."); ?> diff --git a/inc/classes/main/filter/class_BaseFilter.php b/inc/classes/main/filter/class_BaseFilter.php index 9b9385d8..b47bf9c9 100644 --- a/inc/classes/main/filter/class_BaseFilter.php +++ b/inc/classes/main/filter/class_BaseFilter.php @@ -34,10 +34,6 @@ class BaseFilter extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } } diff --git a/inc/classes/main/filter/class_BaseFilterDecorator.php b/inc/classes/main/filter/class_BaseFilterDecorator.php new file mode 100755 index 00000000..57a30cac --- /dev/null +++ b/inc/classes/main/filter/class_BaseFilterDecorator.php @@ -0,0 +1,83 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseFilterDecorator extends BaseFrameworkSystem implements Filterable { + /** + * The decorated filter instance + */ + private $filterInstance = null; + + /** + * Protected constructor + * + * @param $className Name of the real class' name + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + } + + /** + * Setter for the decorated filter instance + * + * @param $filterInstance An instance of a filter + * @return void + */ + protected final function setFilterInstance (Filterable $filterInstance) { + $this->filterInstance = $filterInstance; + } + + /** + * Getter for the decorated filter instance + * + * @return $filterInstance An instance of a filter + */ + protected final function getFilterInstance () { + return $this->filterInstance; + } + + /** + * Execute the inner filter + * + * @param $requestInstance An instance of a request class + * @param $responseInstance An instance of a response class + * @return void + */ + public final function execute (Requestable $requestInstance, Responseable $responseInstance) { + $this->getFilterInstance()->execute($requestInstance, $responseInstance); + } + + + /** + * Do the execution of the filter + * + * @param $requestInstance An instance of a request class + * @param $responseInstance An instance of a response class + * @return void + */ + abstract public function doExecute (Requestable $requestInstance, Responseable $responseInstance); +} + +// [EOF] +?> diff --git a/inc/classes/main/filter/class_FilterChain.php b/inc/classes/main/filter/class_FilterChain.php index 41fdad22..8b31760d 100644 --- a/inc/classes/main/filter/class_FilterChain.php +++ b/inc/classes/main/filter/class_FilterChain.php @@ -35,10 +35,6 @@ class FilterChain extends BaseFrameworkSystem { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/helper/class_BaseHelper.php b/inc/classes/main/helper/class_BaseHelper.php index c07ff5bb..c79ccf14 100644 --- a/inc/classes/main/helper/class_BaseHelper.php +++ b/inc/classes/main/helper/class_BaseHelper.php @@ -76,10 +76,6 @@ class BaseHelper extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/images/class_BaseImage.php b/inc/classes/main/images/class_BaseImage.php index e15738f4..27d768cc 100644 --- a/inc/classes/main/images/class_BaseImage.php +++ b/inc/classes/main/images/class_BaseImage.php @@ -89,10 +89,6 @@ class BaseImage extends BaseFrameworkSystem implements Registerable { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/io/class_FileIoStream.php b/inc/classes/main/io/class_FileIoStream.php index 457c51f6..a9b12dfe 100644 --- a/inc/classes/main/io/class_FileIoStream.php +++ b/inc/classes/main/io/class_FileIoStream.php @@ -48,10 +48,6 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean-up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/io/class_FrameworkDirectoryPointer.php b/inc/classes/main/io/class_FrameworkDirectoryPointer.php index d6249dbb..98fe305a 100644 --- a/inc/classes/main/io/class_FrameworkDirectoryPointer.php +++ b/inc/classes/main/io/class_FrameworkDirectoryPointer.php @@ -38,10 +38,6 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean-up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/io/class_FrameworkFileInputPointer.php b/inc/classes/main/io/class_FrameworkFileInputPointer.php index f96b3615..7f4466ce 100644 --- a/inc/classes/main/io/class_FrameworkFileInputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileInputPointer.php @@ -40,10 +40,6 @@ class FrameworkFileInputPointer extends BaseFrameworkSystem { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean-up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/io/class_FrameworkFileOutputPointer.php b/inc/classes/main/io/class_FrameworkFileOutputPointer.php index af228660..8ea8a0d1 100644 --- a/inc/classes/main/io/class_FrameworkFileOutputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileOutputPointer.php @@ -38,10 +38,6 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean-up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/language/class_LanguageSystem.php b/inc/classes/main/language/class_LanguageSystem.php index 30e97786..867a3af7 100644 --- a/inc/classes/main/language/class_LanguageSystem.php +++ b/inc/classes/main/language/class_LanguageSystem.php @@ -51,10 +51,6 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage, protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/mailer/class_BaseMailer.php b/inc/classes/main/mailer/class_BaseMailer.php index 08f66fc4..76ab2836 100644 --- a/inc/classes/main/mailer/class_BaseMailer.php +++ b/inc/classes/main/mailer/class_BaseMailer.php @@ -41,10 +41,6 @@ class BaseMailer extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/menu/class_BaseMenu.php b/inc/classes/main/menu/class_BaseMenu.php index 4c7c18c0..2dc81496 100644 --- a/inc/classes/main/menu/class_BaseMenu.php +++ b/inc/classes/main/menu/class_BaseMenu.php @@ -31,10 +31,6 @@ class BaseMenu extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } } diff --git a/inc/classes/main/points/class_UserPoints.php b/inc/classes/main/points/class_UserPoints.php index 1fb95326..0e913d4e 100644 --- a/inc/classes/main/points/class_UserPoints.php +++ b/inc/classes/main/points/class_UserPoints.php @@ -35,10 +35,6 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/reader/class_ConsoleNewsReader.php b/inc/classes/main/reader/class_ConsoleNewsReader.php index 662609a8..54150ca7 100644 --- a/inc/classes/main/reader/class_ConsoleNewsReader.php +++ b/inc/classes/main/reader/class_ConsoleNewsReader.php @@ -30,10 +30,6 @@ class ConsoleNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/reader/class_DefaultNewsReader.php b/inc/classes/main/reader/class_DefaultNewsReader.php index c15ee30a..ae2d6d67 100644 --- a/inc/classes/main/reader/class_DefaultNewsReader.php +++ b/inc/classes/main/reader/class_DefaultNewsReader.php @@ -30,10 +30,6 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/registration/class_BaseRegistration.php b/inc/classes/main/registration/class_BaseRegistration.php index 55f42cab..341eeba6 100644 --- a/inc/classes/main/registration/class_BaseRegistration.php +++ b/inc/classes/main/registration/class_BaseRegistration.php @@ -41,10 +41,6 @@ class BaseRegistration extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/registry/class_Registry.php b/inc/classes/main/registry/class_Registry.php index 075432c0..876f7e38 100644 --- a/inc/classes/main/registry/class_Registry.php +++ b/inc/classes/main/registry/class_Registry.php @@ -46,10 +46,6 @@ class Registry extends BaseFrameworkSystem implements Register { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/request/class_BaseRequest.php b/inc/classes/main/request/class_BaseRequest.php index 9364112c..2bc5b059 100644 --- a/inc/classes/main/request/class_BaseRequest.php +++ b/inc/classes/main/request/class_BaseRequest.php @@ -43,10 +43,6 @@ class BaseRequest extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/resolver/class_BaseResolver.php b/inc/classes/main/resolver/class_BaseResolver.php index 80ec323c..d15ef310 100644 --- a/inc/classes/main/resolver/class_BaseResolver.php +++ b/inc/classes/main/resolver/class_BaseResolver.php @@ -41,10 +41,6 @@ class BaseResolver extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/response/class_BaseResponse.php b/inc/classes/main/response/class_BaseResponse.php index c7990d7f..c48d9efc 100644 --- a/inc/classes/main/response/class_BaseResponse.php +++ b/inc/classes/main/response/class_BaseResponse.php @@ -64,10 +64,6 @@ class BaseResponse extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/result/class_DatabaseResult.php b/inc/classes/main/result/class_DatabaseResult.php index 1140a90e..3e8df699 100644 --- a/inc/classes/main/result/class_DatabaseResult.php +++ b/inc/classes/main/result/class_DatabaseResult.php @@ -64,10 +64,6 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/rng/class_RandomNumberGenerator.php b/inc/classes/main/rng/class_RandomNumberGenerator.php index 857478fb..760f6f87 100644 --- a/inc/classes/main/rng/class_RandomNumberGenerator.php +++ b/inc/classes/main/rng/class_RandomNumberGenerator.php @@ -56,10 +56,6 @@ class RandomNumberGenerator extends BaseFrameworkSystem { protected function __construct ($className = __CLASS__) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/streams/class_BaseStream.php b/inc/classes/main/streams/class_BaseStream.php index e226545a..dccae115 100644 --- a/inc/classes/main/streams/class_BaseStream.php +++ b/inc/classes/main/streams/class_BaseStream.php @@ -31,10 +31,6 @@ class BaseStream extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } } diff --git a/inc/classes/main/streams/crypto/class_NullCryptoStream.php b/inc/classes/main/streams/crypto/class_NullCryptoStream.php index 864a896a..33ffdb82 100644 --- a/inc/classes/main/streams/crypto/class_NullCryptoStream.php +++ b/inc/classes/main/streams/crypto/class_NullCryptoStream.php @@ -45,6 +45,34 @@ class NullCryptoStream extends BaseStream implements EncryptableStream { // Return the instance return $streamInstance; } + + /** + * Encrypt the string with fixed salt + * + * @param $str The unencrypted string + * @return $encrypted Encrypted string + */ + public function encryptStream ($str) { + // Just handle it over + $encrypted = (string) $str; + + // Return it + return $encrypted; + } + + /** + * Decrypt the string with fixed salt + * + * @param $encrypted Encrypted string + * @return $str The unencrypted string + */ + function decryptStream ($encrypted) { + // Just handle it over + $str = (string) $encrypted; + + // Return it + return $str; + } } // [EOF] diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index 19e06431..71d3bb2c 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -145,10 +145,6 @@ class BaseTemplateEngine extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/main/user/class_BaseUser.php b/inc/classes/main/user/class_BaseUser.php index 60ed2355..5de1249a 100644 --- a/inc/classes/main/user/class_BaseUser.php +++ b/inc/classes/main/user/class_BaseUser.php @@ -51,10 +51,6 @@ class BaseUser extends BaseFrameworkSystem implements Updateable { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/classes/middleware/class_BaseMiddleware.php b/inc/classes/middleware/class_BaseMiddleware.php index a404f9bf..e098bd12 100644 --- a/inc/classes/middleware/class_BaseMiddleware.php +++ b/inc/classes/middleware/class_BaseMiddleware.php @@ -31,10 +31,6 @@ class BaseMiddleware extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } } diff --git a/inc/classes/third_party/api/primusportal/class_PrimeraApi.php b/inc/classes/third_party/api/primusportal/class_PrimeraApi.php index 1f7036e9..5e651500 100644 --- a/inc/classes/third_party/api/primusportal/class_PrimeraApi.php +++ b/inc/classes/third_party/api/primusportal/class_PrimeraApi.php @@ -125,17 +125,13 @@ class PrimeraApi extends BaseFrameworkSystem { // Call parent constructor parent::__construct(); - // Clean up a little - $this->removeSystemArray(); - $this->removeNumberFormaters(); - // Set data (DEPRECATED!) $this->username = $PPUsername; $this->password = $PPPassword; } /** - * Anfrage senden und Rückgabecode in Variable speichern + * Anfrage senden und Rueckgabecode in Variable speichern */ function queryApi ( $data = array() ) { $fp = fsockopen($this->host, 80, $this->errno, $this->_err); @@ -144,7 +140,7 @@ class PrimeraApi extends BaseFrameworkSystem { $data["PrimusInterface_Username"] = base64_encode($this->username); $data["PrimusInterface_Password"] = base64_encode(md5($this->password)); - // POST-Daten übermitteln: + // POST-Daten uebermitteln: $data = http_build_query($data, '', '&'); fputs($fp, "POST {$this->path}HTTP/1.1\r\n"); diff --git a/inc/classes/third_party/api/wernisportal/class_WernisApi.php b/inc/classes/third_party/api/wernisportal/class_WernisApi.php index 4fe08f45..9ea8e54b 100644 --- a/inc/classes/third_party/api/wernisportal/class_WernisApi.php +++ b/inc/classes/third_party/api/wernisportal/class_WernisApi.php @@ -70,10 +70,6 @@ class WernisApi extends BaseFrameworkSystem { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); } /** diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index 283ad69a..c96e8519 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -163,7 +163,7 @@ class FrameworkConfiguration implements Registerable { if (empty($cfgEntry)) { // Entry is empty throw new ConfigEntryIsEmptyException($this, self::EXCEPTION_CONFIG_ENTRY_IS_EMPTY); - } elseif (!$this->isConfigEntrySet($cfgEntry)) { + } elseif (!$this->isConfigurationEntrySet($cfgEntry)) { // Entry was not found! throw new ConfigEntryNotFoundException(array(__CLASS__, $cfgEntry), self::EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND); } -- 2.30.2