Some cleanups, more usage of ObjectFactory:
authorRoland Häder <roland@mxchange.org>
Wed, 31 Aug 2011 19:27:22 +0000 (19:27 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 31 Aug 2011 19:27:22 +0000 (19:27 +0000)
- Used more ObjectFactory to instance a new class (in local file database)
- The class LocalFileDatabase and CompressorChannel can now be instanced without
  any paramters
- Renamed 'null' to 'NULL'

72 files changed:
inc/classes/exceptions/class_FrameworkException.php
inc/classes/interfaces/crypto/class_Cryptable.php
inc/classes/interfaces/streams/crypto/class_EncryptableStream.php
inc/classes/interfaces/template/class_CompileableTemplate.php
inc/classes/interfaces/template/view/class_ViewHelper.php
inc/classes/main/cache/class_MemoryCache.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/commands/web/class_WebLoginAreaCommand.php
inc/classes/main/compressor/class_Bzip2Compressor.php
inc/classes/main/compressor/class_GzipCompressor.php
inc/classes/main/criteria/search/class_SearchCriteria.php
inc/classes/main/crypto/class_CryptoHelper.php
inc/classes/main/database/class_BaseDatabaseFrontend.php
inc/classes/main/database/class_BaseDatabaseWrapper.php
inc/classes/main/database/databases/class_LocalFileDatabase.php
inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php
inc/classes/main/factories/cache/class_CacheFactory.php
inc/classes/main/factories/web/class_WebNewsFactory.php
inc/classes/main/filter/class_BaseFilterDecorator.php
inc/classes/main/filter/validator/class_EmailValidatorFilter.php
inc/classes/main/filter/validator/class_UserNameValidatorFilter.php
inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php
inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php
inc/classes/main/helper/captcha/class_BaseCaptcha.php
inc/classes/main/helper/captcha/web/class_GraphicalCodeCaptcha.php
inc/classes/main/helper/class_BaseHelper.php
inc/classes/main/helper/web/forms/class_WebFormHelper.php
inc/classes/main/helper/web/links/class_WebLinkHelper.php
inc/classes/main/images/class_BaseImage.php
inc/classes/main/io/class_FileIoStream.php
inc/classes/main/io/class_FrameworkDirectoryPointer.php
inc/classes/main/io/class_FrameworkFileInputPointer.php
inc/classes/main/io/class_FrameworkFileOutputPointer.php
inc/classes/main/language/class_LanguageSystem.php
inc/classes/main/mailer/class_BaseMailer.php
inc/classes/main/output/class_ConsoleOutput.php
inc/classes/main/output/class_WebOutput.php
inc/classes/main/registration/class_BaseRegistration.php
inc/classes/main/registry/class_BaseRegistry.php
inc/classes/main/registry/generic/class_Registry.php
inc/classes/main/request/class_BaseRequest.php
inc/classes/main/request/web/class_HttpRequest.php
inc/classes/main/resolver/action/class_BaseActionResolver.php
inc/classes/main/resolver/action/web/class_WebActionResolver.php
inc/classes/main/resolver/class_BaseResolver.php
inc/classes/main/resolver/command/console/class_ConsoleCommandResolver.php
inc/classes/main/resolver/command/image/class_ImageCommandResolver.php
inc/classes/main/resolver/command/web/class_WebCommandResolver.php
inc/classes/main/resolver/controller/class_BaseControllerResolver.php
inc/classes/main/resolver/controller/console/class_ConsoleControllerResolver.php
inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php
inc/classes/main/resolver/controller/web/class_WebControllerResolver.php
inc/classes/main/response/class_BaseResponse.php
inc/classes/main/response/console/class_ConsoleResponse.php
inc/classes/main/response/http/class_HttpResponse.php
inc/classes/main/response/image/class_ImageResponse.php
inc/classes/main/result/class_DatabaseResult.php
inc/classes/main/rng/class_RandomNumberGenerator.php
inc/classes/main/streams/crypto/class_McryptStream.php
inc/classes/main/template/class_BaseTemplateEngine.php
inc/classes/main/template/mail/class_MailTemplateEngine.php
inc/classes/main/template/menu/class_MenuTemplateEngine.php
inc/classes/main/user/class_BaseUser.php
inc/classes/middleware/compressor/class_CompressorChannel.php
inc/classes/middleware/database/class_DatabaseConnection.php
inc/classes/middleware/debug/class_DebugMiddleware.php
inc/classes/middleware/io/class_FileIoHandler.php
inc/config.php
inc/config/class_FrameworkConfiguration.php
inc/database.php
inc/database/lib-local.php
inc/loader/class_ClassLoader.php

index c5ccc0aec023b6e41a039a88858777140187be3f..e32bdefbd2aa7addef9e957edd3428d958ddae8d 100644 (file)
@@ -172,7 +172,7 @@ abstract class FrameworkException extends ReflectionException {
         * @param       $code           Integer code to encode in hex
         * @return      $hexCode        The exception code in hex-decimal format
         */
-       public final function getHexCode ($code = null) {
+       public final function getHexCode ($code = NULL) {
                // Get the decimal code
                if (is_null($code)) $code = $this->getCode();
 
index 613f5057707dcd97590b998614fe5b7a0bd0689a..14533c3d6053aa314d770e1da9b5ac18d11a0fe1 100644 (file)
@@ -41,7 +41,7 @@ interface Cryptable extends FrameworkInterface {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
-       function encryptString ($str, $key = null);
+       function encryptString ($str, $key = NULL);
 
        /**
         * Decrypt the string with fixed salt
index d40e19158bc36c414c78694c549104bc86ddd727..d4256fe065d0cd47408a75d8f52ee136c362929a 100644 (file)
@@ -29,7 +29,7 @@ interface EncryptableStream extends Streamable {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
-       function encryptStream ($str, $key = null);
+       function encryptStream ($str, $key = NULL);
 
        /**
         * Decrypt the string with fixed salt
index ebef14a1ad039126e65bba0f649a4a920b3199ff..e1070c9d33d63d3c7012cb0f3739866d859da5d4 100644 (file)
@@ -149,7 +149,7 @@ interface CompileableTemplate extends FrameworkInterface {
         * @return      void
         * @throws      XmlParserException      If an XML error was found
         */
-       function renderXmlContent ($content = null);
+       function renderXmlContent ($content = NULL);
 
        /**
         * Enables or disables language support
index 8b7b6fa5693054b5ddd996254ccf8fa8d1ac6bb1..7278a0f6b0904959b8da7d03902cad00b51c227a 100644 (file)
@@ -28,7 +28,7 @@ interface ViewHelper extends FrameworkInterface {
         * @param       $args   Arguments to send to the view helper
         * @return      mixed   Unknown return arguments, or void
         */
-       function execute (array $args = null);
+       function execute (array $args = NULL);
 }
 
 // [EOF]
index d7d78864295c469bfaf45bae908c84abaf57624b..a38a65bab97d0290753aca47b9dd007021bc3e12 100644 (file)
@@ -25,7 +25,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable {
        /**
         * The "memory cache" is simply a wrapped object array
         */
-       private $dataCache = null;
+       private $dataCache = NULL;
 
        /**
         * Protected constructor
@@ -93,7 +93,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable {
         */
        public final function offsetGet ($offset) {
                // Default is offset not found
-               $data = null;
+               $data = NULL;
 
                // Is the offset there?
                if ($this->offsetExists($offset)) {
index fef51b5e0baff2dbf0b2c5c27e3098b84dc3d7c6..f9474ca7567244eec20a7c39e415263c9b76507a 100644 (file)
@@ -26,137 +26,137 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        /**
         * Instance of a request class
         */
-       private $requestInstance = null;
+       private $requestInstance = NULL;
 
        /**
         * Instance of a response class
         */
-       private $responseInstance = null;
+       private $responseInstance = NULL;
 
        /**
         * Search criteria instance
         */
-       private $searchInstance = null;
+       private $searchInstance = NULL;
 
        /**
         * Update criteria instance
         */
-       private $updateInstance = null;
+       private $updateInstance = NULL;
 
        /**
         * The file I/O instance for the template loader
         */
-       private $fileIoInstance = null;
+       private $fileIoInstance = NULL;
 
        /**
         * Resolver instance
         */
-       private $resolverInstance = null;
+       private $resolverInstance = NULL;
 
        /**
         * Template engine instance
         */
-       private $templateInstance = null;
+       private $templateInstance = NULL;
 
        /**
         * Database result instance
         */
-       private $resultInstance = null;
+       private $resultInstance = NULL;
 
        /**
         * Instance for user class
         */
-       private $userInstance = null;
+       private $userInstance = NULL;
 
        /**
         * A controller instance
         */
-       private $controllerInstance = null;
+       private $controllerInstance = NULL;
 
        /**
         * Instance of a RNG
         */
-       private $rngInstance = null;
+       private $rngInstance = NULL;
 
        /**
         * Instance of a crypto helper
         */
-       private $cryptoInstance = null;
+       private $cryptoInstance = NULL;
 
        /**
         * Instance of an Iterator class
         */
-       private $iteratorInstance = null;
+       private $iteratorInstance = NULL;
 
        /**
         * Instance of the list
         */
-       private $listInstance = null;
+       private $listInstance = NULL;
 
        /**
         * Instance of a menu
         */
-       private $menuInstance = null;
+       private $menuInstance = NULL;
 
        /**
         * Instance of the image
         */
-       private $imageInstance = null;
+       private $imageInstance = NULL;
 
        /**
         * Instance of the stacker
         */
-       private $stackerInstance = null;
+       private $stackerInstance = NULL;
 
        /**
         * A Compressor instance
         */
-       private $compressorInstance = null;
+       private $compressorInstance = NULL;
 
        /**
         * A Parseable instance
         */
-       private $parserInstance = null;
+       private $parserInstance = NULL;
 
        /**
         * A ProtocolHandler instance
         */
-       private $protocolInstance = null;
+       private $protocolInstance = NULL;
 
        /**
         * A database wrapper instance
         */
-       private $databaseInstance = null;
+       private $databaseInstance = NULL;
 
        /**
         * A helper instance for the form
         */
-       private $helperInstance = null;
+       private $helperInstance = NULL;
 
        /**
         * An instance of a Sourceable class
         */
-       private $sourceInstance = null;
+       private $sourceInstance = NULL;
 
        /**
         * An instance of a InputStreamable class
         */
-       private $inputStreamInstance = null;
+       private $inputStreamInstance = NULL;
 
        /**
         * An instance of a OutputStreamable class
         */
-       private $outputStreamInstance = null;
+       private $outputStreamInstance = NULL;
 
        /**
         * Networkable handler instance
         */
-       private $handlerInstance = null;
+       private $handlerInstance = NULL;
 
        /**
         * Visitor handler instance
         */
-       private $visitorInstance = null;
+       private $visitorInstance = NULL;
 
        /**
         * The real class name
@@ -166,7 +166,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        /**
         * An instance of a database wrapper class
         */
-       private $wrapperInstance = null;
+       private $wrapperInstance = NULL;
 
        /**
         * Thousands seperator
@@ -589,24 +589,24 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        /**
         * Setter for database instance
         *
-        * @param               $dbInstance     The instance for the database connection (forced DatabaseConnection)
+        * @param               $databaseInstance       The instance for the database connection (forced DatabaseConnection)
         * @return      void
         */
-       public final function setDatabaseInstance (DatabaseConnection $dbInstance) {
-               Registry::getRegistry()->addInstance('db_instance', $dbInstance);
+       public final function setDatabaseInstance (DatabaseConnection $databaseInstance) {
+               Registry::getRegistry()->addInstance('db_instance', $databaseInstance);
        }
 
        /**
         * Getter for database layer
         *
-        * @return      $dbInstance     The database layer instance
+        * @return      $databaseInstance       The database layer instance
         */
        public final function getDatabaseInstance () {
                // Get instance
-               $dbInstance = Registry::getRegistry()->getInstance('db_instance');
+               $databaseInstance = Registry::getRegistry()->getInstance('db_instance');
 
                // Return instance
-               return $dbInstance;
+               return $databaseInstance;
        }
 
        /**
@@ -826,7 +826,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @throws              NullPointerException    If the discovered application
         *                                                                              instance is still null
         */
-       protected function prepareTemplateInstance (ManageableApplication $applicationInstance = null) {
+       protected function prepareTemplateInstance (ManageableApplication $applicationInstance = NULL) {
                // Is the application instance set?
                if (is_null($applicationInstance)) {
                        // Get the current instance
@@ -1170,7 +1170,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        public final function getField ($fieldName) {
                // Default field value
-               $fieldValue = null;
+               $fieldValue = NULL;
 
                // Get result instance
                $resultInstance = $this->getResultInstance();
index 54aa15b635fb338a0e1a78239bc4b0fb5ce03f44..5720d535c3522c120a52713971ca51969d080dd9 100644 (file)
@@ -160,7 +160,7 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable {
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
                // Default is no action
-               $actionInstance = null;
+               $actionInstance = NULL;
 
                // Get registry
                $registryInstance = Registry::getRegistry();
index 1b3824f80038642263365dbd54d82c5acfdcdec1..55ab63a9fb584cc8c33739b4dfe659fba9b21d6f 100644 (file)
@@ -39,7 +39,7 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
         */
        public static final function createBzip2Compressor () {
                // Routines not found by default
-               $compressorInstance = null;
+               $compressorInstance = NULL;
 
                // Get new instance
                if ((function_exists('bzcompress')) && (function_exists('bzdecompress'))) {
index f69f4260ea9a74756ed880ccbbb9a437c555defb..000fc84429336bb5fbd5e80e0fc3d4599f4af1e8 100644 (file)
@@ -39,7 +39,7 @@ class GzipCompressor extends BaseFrameworkSystem implements Compressor {
         */
        public static final function createGzipCompressor () {
                // Routines not found by default
-               $compressorInstance = null;
+               $compressorInstance = NULL;
 
                // Get new instance
                if ((function_exists('gzcompress')) && (function_exists('gzuncompress'))) {
index c85d24412f9eb16be1e3e96b92655fdec957be4e..9692b713c297958586b0ac14090f9641b1abba37 100644 (file)
@@ -174,7 +174,7 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
         */
        public function getCriteriaElemnent ($criteria) {
                // Default is not found
-               $value = null;
+               $value = NULL;
 
                // Is the criteria there?
                if (isset($this->searchCriteria[$criteria])) {
index f377a575a1af45ce8e22804dc81547a973b6b6dc..0c626bba48025d4427bee36666cb393be3af1845 100644 (file)
@@ -29,12 +29,12 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
        /**
         * An instance of this own clas
         */
-       private static $selfInstance = null;
+       private static $selfInstance = NULL;
 
        /**
         * Instance of the crypto stream
         */
-       private $cryptoStreamInstance = null;
+       private $cryptoStreamInstance = NULL;
 
        /**
         * Salt for hashing operations
@@ -177,7 +177,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
-       public function encryptString ($str, $key = null) {
+       public function encryptString ($str, $key = NULL) {
                // Encrypt the string through the stream
                $encrypted = $this->cryptoStreamInstance->encryptStream($str, $key);
 
index f55aafbb5d2416921c0502952244e697308dead2..2001a11fa054a30c206c75985f637dbc7394c231 100644 (file)
@@ -29,7 +29,7 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implements Datab
        /**
         * The limiter instance
         */
-       private $limitInstance = null;
+       private $limitInstance = NULL;
 
        /**
         * Protected constructor
index 5096bb6ef168d53287c8b5d4906dac54c7a56194..76d486e2df65d4f7a3e8cf57b1f30eeff024b73c 100644 (file)
@@ -25,7 +25,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
        /**
         * Cache instance
         */
-       private $cacheInstance = null;
+       private $cacheInstance = NULL;
 
        /**
         * Current table name to use
index 407aa0d7c1d4145ac1d20f46bc982a47f2b957d0..083729efdac4e3812565dae4bc7c5ca1acc88389 100644 (file)
@@ -32,11 +32,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
        // Status results
        const RESULT_OKAY = 'ok';
 
-       /**
-        * Save path for "file database"
-        */
-       private $savePath = '';
-
        /**
         * The file's extension
         */
@@ -65,7 +60,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
        /**
         * Last exception
         */
-       private $lastException = null;
+       private $lastException = NULL;
 
        /**
         * Table information array
@@ -89,24 +84,20 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
        }
 
        /**
-        * Create an object of LocalFileDatabase and set the save path for local files.
-        * This method also validates the given file path.
+        * Create an object of LocalFileDatabase and set the save path from
+        * configuration for local files.
         *
-        * @param       $savePath               The local file path string
-        * @return      $dbInstance             An instance of LocalFileDatabase
+        * @return      $databaseInstance       An instance of LocalFileDatabase
         */
-       public static final function createLocalFileDatabase ($savePath) {
+       public static final function createLocalFileDatabase () {
                // Get an instance
                $databaseInstance = new LocalFileDatabase();
 
-               // Set save path and IO instance
-               $databaseInstance->setSavePath($savePath);
+               // Get a new compressor channel instance
+               $compressorInstance = ObjectFactory::createObjectByConfiguredName('compressor_channel_class');
 
                // Set the compressor channel
-               $databaseInstance->setCompressorChannel(CompressorChannel::createCompressorChannel(
-                       $databaseInstance->getConfigInstance()->getConfigEntry('base_path').
-                       $databaseInstance->getConfigInstance()->getConfigEntry('compressor_base_path')
-               ));
+               $databaseInstance->setCompressorChannel($compressorInstance);
 
                // "Connect" to the database
                $databaseInstance->connectToDatabase();
@@ -115,26 +106,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                return $databaseInstance;
        }
 
-       /**
-        * Setter for save path
-        *
-        * @param               $savePath               The local save path where we shall put our serialized classes
-        * @return      void
-        */
-       public final function setSavePath ($savePath) {
-               // Set save path
-               $this->savePath = (string) $savePath;
-       }
-
-       /**
-        * Getter for save path
-        *
-        * @return      $savePath               The local save path where we shall put our serialized classes
-        */
-       public final function getSavePath () {
-               return $this->savePath;
-       }
-
        /**
         * Getter for last error message
         *
@@ -172,7 +143,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         */
        private final function resetLastError () {
                $this->lastError = '';
-               $this->lastException = null;
+               $this->lastException = NULL;
        }
 
        /**
@@ -303,7 +274,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         */
        private function generateFqfnFromDataSet (Criteria $dataSetInstance, $rowName) {
                // This is the FQFN
-               $fqfn = $this->getSavePath() . $dataSetInstance->getTableName() . '/' . $rowName . '.' . $this->getFileExtension();
+               $fqfn = $this->getConfigInstance()->getConfigEntry('local_db_path') . $dataSetInstance->getTableName() . '/' . $rowName . '.' . $this->getFileExtension();
 
                // Return it
                return $fqfn;
@@ -375,10 +346,10 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         */
        public function querySelect ($resultType, $tableName, LocalSearchCriteria $criteriaInstance) {
                // The result is null by any errors
-               $resultData = null;
+               $resultData = NULL;
 
                // Create full path name
-               $pathName = $this->getSavePath() . $tableName . '/';
+               $pathName = $this->getConfigInstance()->getConfigEntry('local_db_path') . $tableName . '/';
 
                // A 'select' query is not that easy on local files, so first try to
                // find the 'table' which is in fact a directory on the server
@@ -511,7 +482,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         */
        public function queryUpdateDataSet (StoreableCriteria $dataSetInstance) {
                // Create full path name
-               $pathName = $this->getSavePath() . $dataSetInstance->getTableName() . '/';
+               $pathName = $this->getConfigInstance()->getConfigEntry('local_db_path') . $dataSetInstance->getTableName() . '/';
 
                // Try all the requests
                try {
@@ -602,7 +573,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         */
        public function getPrimaryKeyOfTable ($tableName) {
                // Default key is null
-               $primaryKey = null;
+               $primaryKey = NULL;
 
                // Does the table information exist?
                if (isset($this->tableInfo[$tableName])) {
index 0af47d42f55e033acb1fdc8641600d67d282f228..1f109a41a6e8bc2d99f58cb5cdd96230d29b822e 100644 (file)
@@ -343,7 +343,7 @@ class XmlRewriterTemplateDecorator extends BaseDecorator implements CompileableT
         * @return      void
         * @throws      XmlParserException      If an XML error was found
         */
-       public function renderXmlContent ($content = null) {
+       public function renderXmlContent ($content = NULL) {
                // Call the inner class' method
                $this->getTemplateInstance()->renderXmlContent($content);
        }
index 04f634c166a245c6818851d5a1c45034a764e183..029b6cd658836f9a31f54367b0e16ef3e72e8b1a 100644 (file)
@@ -25,7 +25,7 @@ class CacheFactory extends BaseFactory {
        /**
         * Singleton instance
         */
-       private static $selfInstance = null;
+       private static $selfInstance = NULL;
 
        /**
         * Protected constructor
index 7019b8e987fe8e072a0da32744d1436796bc3e4c..19fcce76da59e8a52c3b84a299ddff1a27fe94a9 100644 (file)
@@ -25,7 +25,7 @@ class WebNewsFactory extends BaseFactory {
        /**
         * Instance of a request class
         */
-       private $requestInstance = null;
+       private $requestInstance = NULL;
 
        /**
         * Protected constructor
index f5056a03a3806203e223c1f7f7ed4e58dd3b6ac1..a3a23693254a8df84db8c60354361195c25ee5d3 100644 (file)
@@ -25,7 +25,7 @@ abstract class BaseFilterDecorator extends BaseFrameworkSystem implements Filter
        /**
         * The decorated filter instance
         */
-       private $filterInstance = null;
+       private $filterInstance = NULL;
 
        /**
         * Protected constructor
index 8782f1631325f912c3758a63e9277f05248c5fd9..26da852baa47dc3e23803ab785cd03114d501649 100644 (file)
@@ -136,7 +136,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                $alreadyTaken = true;
 
                // Initialize instance
-               $userInstance = null;
+               $userInstance = NULL;
 
                // Get a registry instance
                $registry = Registry::getRegistry();
index d00b7ccd9c5e42ff6915fc5a2acb54eb08a327eb..c6fa4b2c2fdf860b4566f50aa909475766eff97c 100644 (file)
@@ -101,7 +101,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                $alreadyTaken = true;
 
                // Initialize instance
-               $userInstance = null;
+               $userInstance = NULL;
 
                // Get a registry instance
                $registry = Registry::getRegistry();
index 7e9efc8cb8ae0d8c3464a39efc0fe60f150f50d7..70aa47b67dca9bf6d9fadf8afda4cdccfdcae351 100644 (file)
@@ -104,7 +104,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                $alreadyTaken = true;
 
                // Initialize instance
-               $userInstance = null;
+               $userInstance = NULL;
 
                // Get a registry instance
                $registry = Registry::getRegistry();
index f24b0bc422801721966878337d2029e63e6c30e2..e4685727592e6bb04aab8bd5337b08dcde1397a5 100644 (file)
@@ -101,7 +101,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                $alreadyTaken = true;
 
                // Initialize instance
-               $userInstance = null;
+               $userInstance = NULL;
 
                // Get a registry instance
                $registry = Registry::getRegistry();
index 313ef4c69b9c75c99d67e1c59700f0bc7eea0000..3ef952b7d94bcaabac2c7d1d3f09bf2be2159de0 100644 (file)
@@ -39,7 +39,7 @@ class BaseCaptcha extends BaseHelper {
         * @param       $extraInstance  An extra instance, just for better hash data
         * @return      void
         */
-       protected final function initializeRandomNumberGenerator (FrameworkInterface $extraInstance = null) {
+       protected final function initializeRandomNumberGenerator (FrameworkInterface $extraInstance = NULL) {
                // Get an RNG from factory
                $this->setRngInstance(ObjectFactory::createObjectByConfiguredName('rng_class', array($extraInstance)));
        }
index aa676768aec5481e4967e12eb48a79210917ee81..6583e392549ae9bb25be37b29fc7f331f69c497a 100644 (file)
@@ -49,7 +49,7 @@ class GraphicalCodeCaptcha extends BaseCaptcha implements SolveableCaptcha {
         * @param       $extraInstance          An extra instance, just for better hash data
         * @return      $captchaInstance        An instance of this captcha class
         */
-       public static final function createGraphicalCodeCaptcha (HelpableTemplate $helperInstance, FrameworkInterface $extraInstance = null) {
+       public static final function createGraphicalCodeCaptcha (HelpableTemplate $helperInstance, FrameworkInterface $extraInstance = NULL) {
                // Get a new instance
                $captchaInstance = new GraphicalCodeCaptcha();
 
index eaaf08fa297ef837df58bdf333f4505b9ff683d2..e360adc6229f9a97f6e5a65a49f83b45bee6e986 100644 (file)
@@ -25,12 +25,12 @@ class BaseHelper extends BaseFrameworkSystem {
        /**
         * Instance to the class which provides field values
         */
-       private $valueInstance = null;
+       private $valueInstance = NULL;
 
        /**
         * Extra instance to the class which provides field values
         */
-       private $extraInstance = null;
+       private $extraInstance = NULL;
 
        /**
         * Rendered content created by the helper class
@@ -192,7 +192,7 @@ class BaseHelper extends BaseFrameworkSystem {
         * @return      void
         * @throws      NullPointerException    If recovery of requested value instance failed
         */
-       public function prefetchValueInstance ($registryKey, $extraKey = null) {
+       public function prefetchValueInstance ($registryKey, $extraKey = NULL) {
                //* DEBUG: */ $this->debugOutput('O:'.$registryKey.'/'.$extraKey);
                try {
                        // Get the required instance
index 5e396a0305f4efd5f495b01e7727150bea8b9b42..7c3e29df7e9ab080d12db6aa0970966f83c54fc8 100644 (file)
@@ -673,7 +673,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
         */
        public function addCaptcha () {
                // Init instance
-               $extraInstance = null;
+               $extraInstance = NULL;
 
                try {
                        // Get last executed pre filter
index 8c4d0aa402e8cbfc5951ad048e5a5b86bcf2087c..8ff8e54c9ad586ef446403d736c036587ab8aab3 100644 (file)
@@ -61,7 +61,7 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
         * @return      $helperInstance         A prepared instance of this helper
         * @throws      NoConfigEntryException  A deprecated exception at this point
         */
-       public static final function createWebLinkHelper (CompileableTemplate $templateInstance, $linkName, $linkBase = null) {
+       public static final function createWebLinkHelper (CompileableTemplate $templateInstance, $linkName, $linkBase = NULL) {
                // Get new instance
                $helperInstance = new WebLinkHelper();
 
index d2c2dd92040ff2c2986ab832590c363f98063aa1..f5aebb36d62020ae57452b588839631350419dbc 100644 (file)
@@ -63,7 +63,7 @@ class BaseImage extends BaseFrameworkSystem implements Registerable {
        /**
         * Image resource
         */
-       private $imageResource = null;
+       private $imageResource = NULL;
 
        /**
         * Image name
index d95f339fa2cc917d252563866c4ceefbf6e2adf1..66eeb668c95eeb19b2438d17db9bdf875c74addf 100644 (file)
@@ -75,7 +75,7 @@ class FileIoStream extends BaseFrameworkSystem implements FileInputStreamer, Fil
         */
        public final function saveFile ($fileName, $dataArray) {
                // Try it five times
-               $dirName = ''; $fileInstance = null;
+               $dirName = ''; $fileInstance = NULL;
                for ($idx = 0; $idx < 5; $idx++) {
                        // Get a file output pointer
                        try {
index 782d51f39b65bdd0f840b8c2d11793364014e6ae..c0728738a1fe947518681855f8fe05e02e6768d8 100644 (file)
@@ -30,7 +30,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem {
        /**
         * The directory pointer
         */
-       private $dirPointer = null;
+       private $dirPointer = NULL;
 
        /**
         * Protected constructor
index ebac49d4d2d530b5ca2595c5e6b9ee7fc93bfab8..f1d0b9e4c532ed416894f472a3b8b55280f31528 100644 (file)
@@ -30,7 +30,7 @@ class FrameworkFileInputPointer extends BaseFrameworkSystem {
        /**
         * The file pointer
         */
-       private $filePointer = null;
+       private $filePointer = NULL;
 
        /**
         * Protected constructor
index b76281b57d750b6007ed1e318f45a10f5b4ba5dd..5fb5e7510b13581fcd339815f477b0dc750496de 100644 (file)
@@ -30,7 +30,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem {
        /**
         * The file pointer
         */
-       private $filePointer = null;
+       private $filePointer = NULL;
 
        /**
         * Protected constructor
index 714926178bdbb20077647a5d23f58139576bbacb..df1fe429001379ecba87afbac262aa317ae18bac 100644 (file)
@@ -36,12 +36,12 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
        /**
         * The array-object for all language strings
         */
-       private $langStrings = null;
+       private $langStrings = NULL;
 
        /**
         * An instance of this class
         */
-       private static $thisInstance = null;
+       private static $thisInstance = NULL;
 
        /**
         * Protected constructor
index 5a6602d24f11a627138622025a6b165d05c00401..5a18f410caa3fb9d9e801ab36aa0ad987e03480a 100644 (file)
@@ -173,7 +173,7 @@ class BaseMailer extends BaseFrameworkSystem {
         */
        public final function getSubjectLine () {
                // Default subject is null
-               $subjectLine = null;
+               $subjectLine = NULL;
 
                // Get template name
                $templateName = $this->getTemplateName();
@@ -195,7 +195,7 @@ class BaseMailer extends BaseFrameworkSystem {
         */
        public function useSubjectFromTemplate () {
                // Set the subject line
-               $this->setSubjectLine("{?subject?}");
+               $this->setSubjectLine('{?subject?}');
        }
 
        /**
index 38379b289eb857a1c9c713604b6240641a0a165f..6a3e88f7b9c502df8394bebdf9a1308b79f5bbee 100644 (file)
@@ -26,7 +26,7 @@ class ConsoleOutput extends BaseFrameworkSystem implements OutputStreamer {
        /**
         * The instance for the singleton design pattern
         */
-       private static $consoleInstance = null;
+       private static $consoleInstance = NULL;
 
        /**
         * Protected constructor
index ff175d0bd10ba137d914b234fdefd5856ccb850d..835d18e49cf4ea3a0d80690bedb368dbc8029941 100644 (file)
@@ -26,7 +26,7 @@ class WebOutput extends BaseFrameworkSystem implements OutputStreamer, Registera
        /**
         * The instance for the singleton design pattern
         */
-       private static $webInstance = null;
+       private static $webInstance = NULL;
 
        /**
         * Protected constructor
index e90e0db73d7cdc1476d01b4ae2ab4a3f7e45a302..e0cf36998ea08a991d82557f30c2103386fdc0f1 100644 (file)
@@ -25,12 +25,12 @@ class BaseRegistration extends BaseFrameworkSystem {
        /**
         * Pre-registration filter chain
         */
-       private $preRegistrationFilter = null;
+       private $preRegistrationFilter = NULL;
 
        /**
         * Pre-registration filter chain
         */
-       private $postRegistrationFilter = null;
+       private $postRegistrationFilter = NULL;
 
        /**
         * Protected constructor
index 6330331d46b1b8fb983cc7eb8ccd4f7d83175be2..390d2c67bfcc9025bc80ea3656d754d9e6eda41f 100644 (file)
@@ -25,7 +25,7 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable {
        /**
         * Instance of this class
         */
-       private static $registryInstance = null;
+       private static $registryInstance = NULL;
 
        /**
         * Instance registry
@@ -100,7 +100,7 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable {
         *
         * @return      $entries        An array with entries from this registry
         */
-       public final function getEntries ($key = null) {
+       public final function getEntries ($key = NULL) {
                // Default is whole array
                $entries = $this->rawEntries;
 
@@ -164,7 +164,7 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable {
         */
        public function getInstance ($instanceKey) {
                // By default the instance is not in registry
-               $objectInstance = null;
+               $objectInstance = NULL;
 
                // Is the instance there?
                if ($this->instanceExists($instanceKey)) {
index 91a27f730bbf071a3211efce72cc903612577b76..359e4be0b83279d60a97aadbeb7595db71b8569e 100644 (file)
@@ -26,7 +26,7 @@ class Registry extends BaseRegistry implements Register {
        /**
         * Instance of this class
         */
-       private static $registryInstance = null;
+       private static $registryInstance = NULL;
 
        /**
         * Protected constructor
index 4eca9e2b52706588a5a6ad22d01c9898ad9858f7..3757607de5c389d86dc0fe9c9c1ed5dcc81df86a 100644 (file)
@@ -67,7 +67,7 @@ class BaseRequest extends BaseFrameworkSystem {
         */
        public function getRequestElement ($element) {
                // Initialize value
-               $value = null;
+               $value = NULL;
 
                // Is the element set?
                if ($this->isRequestElementSet($element)) {
index 2688f5fb9fa0108634aa3efacf407d13e391ff5f..97065380f9ac615f0a9c2b66207688333c9a8888 100644 (file)
@@ -69,7 +69,7 @@ class HttpRequest extends BaseRequest implements Requestable {
         */
        public function getHeader ($headerName) {
                // Default return value on error
-               $headerValue = null;
+               $headerValue = NULL;
 
                // Construct the name
                $name = 'HTTP_' . strtolower($this->convertDashesToUnderscores($headerName));
@@ -100,7 +100,7 @@ class HttpRequest extends BaseRequest implements Requestable {
         */
        public final function readCookie ($cookieName) {
                // Default is no cookie with that name found
-               $cookieValue = null;
+               $cookieValue = NULL;
 
                // Is the cookie set?
                if (isset($_COOKIE[$cookieName])) {
index 37e605bea2abb3ef1768b28ccddf3bbb269e143f..d7d309cd21e6c70878844955c2bb5dbfbfa79a1e 100644 (file)
@@ -100,7 +100,7 @@ class BaseActionResolver extends BaseResolver {
         */
        protected function loadAction () {
                // Init action instance
-               $actionInstance = null;
+               $actionInstance = NULL;
 
                // Create action class name
                $className = $this->getClassPrefix() . $this->convertToClassName($this->getActionName()) . 'Action';
index dff629d9fbc91d7ef6085d6454f41a8090c46d83..97b1a230c5b37e407e498938ab467ce7263e590a 100644 (file)
@@ -25,7 +25,7 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
        /**
         * Last successfull resolved action
         */
-       private $lastActionInstance = null;
+       private $lastActionInstance = NULL;
 
        /**
         * Protected constructor
@@ -83,7 +83,7 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
        public function resolveActionByRequest (Requestable $requestInstance) {
                // Init variables
                $actionName = '';
-               $actionInstance = null;
+               $actionInstance = NULL;
 
                // This goes fine so let's resolve the action
                $actionName = $requestInstance->getRequestElement('action');
@@ -123,7 +123,7 @@ class WebActionResolver extends BaseActionResolver implements ActionResolver {
         */
        public function resolveAction () {
                // Initiate the instance variable
-               $actionInstance = null;
+               $actionInstance = NULL;
 
                // Get action name
                $actionName = $this->getActionName();
index 06b34403f4c7c7bd0907d616daefaef2afcfb403..875ab39a32a4b977a270b147df3accbe7cf2ec81 100644 (file)
@@ -35,7 +35,7 @@ class BaseResolver extends BaseFrameworkSystem {
        /**
         * (Last) resolved instance
         */
-       private $resolvedInstance = null;
+       private $resolvedInstance = NULL;
 
        // Exception constants
        const EXCEPTION_INVALID_COMMAND    = 0x1d0;
index 9f9cdde72d8330b68a5a7a78d41e1a0987e0ccdc..572b9c0ffda1c3e5aedfdbd234bcc08a2c112eef 100644 (file)
@@ -78,7 +78,7 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol
        public function resolveCommandByRequest (Requestable $requestInstance) {
                // Init variables
                $commandName = '';
-               $commandInstance = null;
+               $commandInstance = NULL;
 
                // This goes fine so let's resolve the command
                $commandName = $requestInstance->getRequestElement('command');
@@ -119,7 +119,7 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol
         */
        public function resolveCommand ($commandName) {
                // Initiate the instance variable
-               $commandInstance = null;
+               $commandInstance = NULL;
 
                // Is the command empty? Then fall back to default command
                if (empty($commandName)) {
@@ -149,7 +149,7 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol
         */
        private function loadCommand ($commandName) {
                // Init command instance
-               $commandInstance = null;
+               $commandInstance = NULL;
 
                // Create class name
                $className = $this->getClassPrefix() . $this->convertToClassName($commandName) . 'Command';
index 204aebb5242e40da21ba7aee6321eddb212cc614..d62b3b190e4e49fbbbc2a4855dcd5478eab3696d 100644 (file)
@@ -25,7 +25,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
        /**
         * Last successfull resolved command
         */
-       private $lastCommandInstance = null;
+       private $lastCommandInstance = NULL;
 
        /**
         * Protected constructor
@@ -83,7 +83,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
        public function resolveCommandByRequest (Requestable $requestInstance) {
                // Init variables
                $commandName = '';
-               $commandInstance = null;
+               $commandInstance = NULL;
 
                // This goes fine so let's resolve the command
                $commandName = $requestInstance->getRequestElement('page');
@@ -124,7 +124,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
         */
        public function resolveCommand ($commandName) {
                // Initiate the instance variable
-               $commandInstance = null;
+               $commandInstance = NULL;
 
                // Is the command empty? Then fall back to default command
                if (empty($commandName)) {
@@ -154,7 +154,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
         */
        private function loadCommand ($commandName) {
                // Init command instance
-               $commandInstance = null;
+               $commandInstance = NULL;
 
                // Create class name
                $className = $this->getClassPrefix() . $this->convertToClassName($commandName) . 'Command';
index 103ea14ecf5833471f77f4c94b4b465234e767ce..a404e9557c6a0647f6828ea0b497d196371fd018 100644 (file)
@@ -25,7 +25,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
        /**
         * Last successfull resolved command
         */
-       private $lastCommandInstance = null;
+       private $lastCommandInstance = NULL;
 
        /**
         * Protected constructor
@@ -83,7 +83,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
        public function resolveCommandByRequest (Requestable $requestInstance) {
                // Init variables
                $commandName = '';
-               $commandInstance = null;
+               $commandInstance = NULL;
 
                // This goes fine so let's resolve the command
                $commandName = $requestInstance->getRequestElement('page');
@@ -124,7 +124,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
         */
        public function resolveCommand ($commandName) {
                // Initiate the instance variable
-               $commandInstance = null;
+               $commandInstance = NULL;
 
                // Is the command empty? Then fall back to default command
                if (empty($commandName)) {
@@ -154,7 +154,7 @@ class WebCommandResolver extends BaseCommandResolver implements CommandResolver
         */
        private function loadCommand ($commandName) {
                // Init command instance
-               $commandInstance = null;
+               $commandInstance = NULL;
 
                // Is this class loaded?
                if (!class_exists($this->getClassName())) {
index 62f02bbef684a444440e2889639ae4f95ef34ca4..176fa793dfe89b44efa3d9dd6fd8330bb7b55bbc 100644 (file)
@@ -72,7 +72,7 @@ class BaseControllerResolver extends BaseResolver {
                $defaultController = $this->getConfigInstance()->getConfigEntry('default_' . strtolower($this->getClassPrefix()) . '_command');
 
                // Init controller instance
-               $controllerInstance = null;
+               $controllerInstance = NULL;
 
                // Default controller
                $this->setClassName($this->getClassPrefix() . 'DefaultNewsController');
index 36e1fb6842a7188481f54e1b61a1ea72ca9ef43f..b6d61c99f19766c2b4fb52d243612ede06b7a714 100644 (file)
@@ -30,7 +30,7 @@ class ConsoleControllerResolver extends BaseControllerResolver implements Contro
        /**
         * Last successfull resolved controller (instance)
         */
-       private $lastControllerInstance = null;
+       private $lastControllerInstance = NULL;
 
        /**
         * Protected constructor
@@ -88,7 +88,7 @@ class ConsoleControllerResolver extends BaseControllerResolver implements Contro
        public function resolveController () {
                // Init variables
                $controllerName = '';
-               $controllerInstance = null;
+               $controllerInstance = NULL;
 
                // Get the command name 
                $controllerName = $this->getControllerName();
index 1d8e2426ecb52b88f0a152f473ae3e1482b3795e..92dd54066d71e86e4fddb72c78013217666ea589 100644 (file)
@@ -30,7 +30,7 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll
        /**
         * Last successfull resolved controller (instance)
         */
-       private $lastControllerInstance = null;
+       private $lastControllerInstance = NULL;
 
        /**
         * Protected constructor
@@ -88,7 +88,7 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll
        public function resolveController () {
                // Init variables
                $controllerName = '';
-               $controllerInstance = null;
+               $controllerInstance = NULL;
 
                // Get the command name 
                $controllerName = $this->getControllerName();
index 403f31acc77d124b330b1fbd2182ae1cf057d6b8..2379987467561e324e0d886c35498e32975e8934 100644 (file)
@@ -30,7 +30,7 @@ class WebControllerResolver extends BaseControllerResolver implements Controller
        /**
         * Last successfull resolved controller (instance)
         */
-       private $lastControllerInstance = null;
+       private $lastControllerInstance = NULL;
 
        /**
         * Protected constructor
@@ -88,7 +88,7 @@ class WebControllerResolver extends BaseControllerResolver implements Controller
        public function resolveController () {
                // Init variables
                $controllerName = '';
-               $controllerInstance = null;
+               $controllerInstance = NULL;
 
                // Get the command name 
                $controllerName = $this->getControllerName();
index 986ef5cce0cb8cbe38411efc9b2c0c94603236c7..fbaa85a7f72a87ba21ffe0e80692c587fd7611a3 100644 (file)
@@ -48,7 +48,7 @@ class BaseResponse extends BaseFrameworkSystem {
        /**
         * Instance of the template engine
         */
-       private $templateInstance = null;
+       private $templateInstance = NULL;
 
        /**
         * Fatal resolved messages from filters and so on
index 32e0cbd5d65751454b47940b2510427eef67f67d..1469bd32516093b581e2e7e2cb3ca7b7e0503246 100644 (file)
@@ -75,7 +75,7 @@ class ConsoleResponse extends BaseResponse implements Responseable {
         * @return      void
         * @throws      ResponseHeadersAlreadySentException             If headers are already sent
         */
-       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
+       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
                //* DEBUG: */ echo $cookieName.'='.$cookieValue."<br />\n";
                $this->partialStub('Naturally unimplemented in console response.');
        }
index 57a37e2f7b692b352eb5dd75f7993589793ed9d1..0378bdaffd11082d121e43a867cc91fab6e648b0 100644 (file)
@@ -79,7 +79,7 @@ class HttpResponse extends BaseResponse implements Responseable {
         * @todo        If the return statement is removed and setcookie() commented out,
         * @todo        this will send only one cookie out, the first one.
         */
-       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
+       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
                //* DEBUG: */ echo $cookieName.'='.$cookieValue."<br />\n";
                // Are headers already sent?
                if (headers_sent()) {
index 8e018d7ceb623d2024dc04baf9dbcbcc55d4d93b..b1f08a25029925f376fb63e4b0404f3e4862379a 100644 (file)
@@ -90,7 +90,7 @@ class ImageResponse extends BaseResponse implements Responseable {
         * @todo        If the return statement is removed and setcookie() commented out,
         * @todo        this will send only one cookie out, the first one.
         */
-       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
+       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
                // Are headers already sent?
                if (headers_sent()) {
                        // Throw an exception here
index dcbcf5e64298c250fb28431eb3e16283074cdfc0..e2505df0d50fd1000ccb5d1379fd5fd696c3ec02 100644 (file)
@@ -34,7 +34,7 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
        /**
         * Current row
         */
-       private $currentRow = null;
+       private $currentRow = NULL;
 
        /**
         * Result array
@@ -159,7 +159,7 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
         */
        public function current () {
                // Default is not found
-               $current = null;
+               $current = NULL;
 
                // Does the current enty exist?
                if (isset($this->resultArray['rows'][$this->currentPos])) {
index f656432286755dcf0ea7788eac360348e4b140d5..c92c6bccf0e12954488aa44e11d9e9d58243ba46 100644 (file)
@@ -64,7 +64,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem {
         * @param       $extraInstance  An extra instance for more salt (default: null)
         * @return      $rngInstance    An instance of this random number generator
         */
-       public static final function createRandomNumberGenerator (FrameworkInterface $extraInstance = null) {
+       public static final function createRandomNumberGenerator (FrameworkInterface $extraInstance = NULL) {
                // Get a new instance
                $rngInstance = new RandomNumberGenerator();
 
index 1c3eeeb2eba4c6d502a4398a6b428b58f66a42b1..5bab4ef5fc428e63a48143013dea21269299c193 100644 (file)
@@ -61,7 +61,7 @@ class McryptStream extends BaseStream implements EncryptableStream {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $encrypted      Encrypted string
         */
-       public function encryptStream ($str, $key = null) {
+       public function encryptStream ($str, $key = NULL) {
                // Init crypto module
                $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
                $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
@@ -125,7 +125,7 @@ class McryptStream extends BaseStream implements EncryptableStream {
         * @param       $key            Optional key, if none provided, a random key will be generated
         * @return      $str            The unencrypted string
         */
-       public function decryptStream ($encrypted, $key = null) {
+       public function decryptStream ($encrypted, $key = NULL) {
                // Init crypto module
                $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
                $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
index 65152544391ae55c93ee180069376915fc4c78b1..3e265df6488b99b950e6043a911d4fbe19542753 100644 (file)
@@ -87,12 +87,12 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
        /**
         * Loaded raw template data
         */
-       private $loadedRawData = null;
+       private $loadedRawData = NULL;
 
        /**
         * Raw templates which are linked in code templates
         */
-       private $rawTemplates = null;
+       private $rawTemplates = NULL;
 
        /**
         * A regular expression for variable=value pairs
@@ -171,7 +171,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $stack  Optional variable stack to look in
         * @return      $index  FALSE means not found, >=0 means found on a specific index
         */
-       private function getVariableIndex ($var, $stack = null) {
+       private function getVariableIndex ($var, $stack = NULL) {
                // First everything is not found
                $found = false;
 
@@ -239,9 +239,9 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $stack          Optional variable stack to look in
         * @return      $content        Content of the variable or null if not found
         */
-       protected function readVariable ($var, $stack = null) {
+       protected function readVariable ($var, $stack = NULL) {
                // First everything is not found
-               $content = null;
+               $content = NULL;
 
                // If the stack is null, use the current group
                if (is_null($stack)) $stack = $this->currGroup;
@@ -1168,7 +1168,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $$validVar = $dummy;
 
                // Prepare all configuration variables
-               $config = null;
+               $config = NULL;
                if ($this->isVarStackSet('config')) {
                        $config = $this->getVarStack('config');
                } // END - if
@@ -1444,7 +1444,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @return      void
         * @throws      XmlParserException      If an XML error was found
         */
-       public function renderXmlContent ($content = null) {
+       public function renderXmlContent ($content = NULL) {
                // Is the content set?
                if (is_null($content)) {
                        // Get current content
index c4e49b22f580e106554f88b39c41ed704112c82c..898aa2f3b00f9e006e5a4d176ef7e43c1f8c7bdb 100644 (file)
@@ -43,7 +43,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla
        /**
         * Mailer instance
         */
-       private $mailerInstance = null;
+       private $mailerInstance = NULL;
 
        /**
         * Current main node
index 1438c91402961cd8919599ed6955e9d88bb6eae2..ea98d81913ba2f16a626df60b58fc12893f265d7 100644 (file)
@@ -60,7 +60,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
        /**
         * Menu instance
         */
-       private $menuInstance = null;
+       private $menuInstance = NULL;
 
        /**
         * Current main node
index 6b0ddef3839ab2363db6225b2a9310d7219cf740..a26da5d5c3b5a04673b17f3b571899b43a01beb1 100644 (file)
@@ -265,7 +265,7 @@ class BaseUser extends BaseFrameworkSystem implements Updateable {
         */
        public final function getPasswordHash () {
                // Default is missing password hash
-               $passHash = null;
+               $passHash = NULL;
 
                // Get a database entry
                $entry = $this->getDatabaseEntry();
index 71ea35776349cf29beb369d2715bb7b953a8a9ab..0aa8205bae87b861829914996c346062639a8e69 100644 (file)
@@ -25,7 +25,7 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
        /**
         * Real compressor instance
         */
-       private $compressor = null;
+       private $compressor = NULL;
 
        /**
         * Protected constructor
@@ -38,40 +38,43 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
        }
 
        /**
-        * Create a new compressor channel based a given base directory where
-        * we shall look for compressor classes
+        * Create a new compressor channel.
         *
-        * @param       $baseDir        Directory which holds our compressor classes
-        * @return      $cInstance      A prepared instance of this class
+        * @return      $compressorInstance             A prepared instance of this class
         */
-       public static final function createCompressorChannel ($baseDir) {
+       public static final function createCompressorChannel () {
                // Get new instance
-               $cInstance = new CompressorChannel();
+               $compressorInstance = new CompressorChannel();
 
                // Is the compressor handler set?
                if (
-                          (is_null($cInstance->getCompressor()))
-                       || (!is_object($cInstance->getCompressor()))
-                       || (!method_exists($cInstance->getCompressor(), 'compressStream'))
-                       || (!method_exists($cInstance->getCompressor(), 'decompressStream'))
+                          (is_null($compressorInstance->getCompressor()))
+                       || (!is_object($compressorInstance->getCompressor()))
+                       || (!method_exists($compressorInstance->getCompressor(), 'compressStream'))
+                       || (!method_exists($compressorInstance->getCompressor(), 'decompressStream'))
                ) {
+                       // Init base directory
+                       $baseDir =
+                               $compressorInstance->getConfigInstance()->getConfigEntry('base_path') .
+                               $compressorInstance->getConfigInstance()->getConfigEntry('compressor_base_path');
+
                        // Get a directory pointer
                        $dirPointer = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($baseDir);
 
                        // Read all directories but no sub directories
-                       while ($dir = $dirPointer->readDirectoryExcept(array('..', '.', '.htaccess', '.svn'))) {
+                       while ($directoryEntry = $dirPointer->readDirectoryExcept(array('..', '.', '.htaccess', '.svn'))) {
                                // Is this a class file?
-                               if ((substr($dir, 0, 6) == 'class_') && (substr($dir, -4, 4) == '.php')) {
+                               if ((substr($directoryEntry, 0, 6) == 'class_') && (substr($directoryEntry, -4, 4) == '.php')) {
                                        // Get the compressor's name. That's why you must name
                                        // your files like your classes and also that's why you
                                        // must keep on class in one file.
-                                       $className = substr($dir, 6, -4);
+                                       $className = substr($directoryEntry, 6, -4);
 
                                        // Get an instance from our object factory
                                        $tempInstance = ObjectFactory::createObjectByName($className);
 
                                        // Set the compressor
-                                       $cInstance->setCompressor($tempInstance);
+                                       $compressorInstance->setCompressor($tempInstance);
 
                                        // No more searches required because we have found a valid compressor stream
                                        break;
@@ -84,17 +87,17 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
 
                // Check again if there is a compressor
                if (
-                          (is_null($cInstance->getCompressor()))
-                       || (!is_object($cInstance->getCompressor()))
-                       || (!method_exists($cInstance->getCompressor(), 'compressStream'))
-                       || (!method_exists($cInstance->getCompressor(), 'decompressStream'))
+                          (is_null($compressorInstance->getCompressor()))
+                       || (!is_object($compressorInstance->getCompressor()))
+                       || (!method_exists($compressorInstance->getCompressor(), 'compressStream'))
+                       || (!method_exists($compressorInstance->getCompressor(), 'decompressStream'))
                ) {
                        // Set the null compressor handler. This should not be configureable!
-                       $cInstance->setCompressor(ObjectFactory::createObjectByName('NullCompressor'));
+                       $compressorInstance->setCompressor(ObjectFactory::createObjectByName('NullCompressor'));
                } // END - if
 
                // Return the compressor instance
-               return $cInstance;
+               return $compressorInstance;
        }
 
        /**
@@ -112,7 +115,7 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
         * @param               $compressorInstance     The compressor instance we shall use
         * @return      void
         */
-       public final function setCompressor (Compressor $compressorInstance = null) {
+       public final function setCompressor (Compressor $compressorInstance = NULL) {
                $this->compressor = $compressorInstance;
        }
 
index a175f86182ee21ac76f76957fb266efb0d72abb5..c55c75159c8f1a665115efb27a522410b75f74ba 100644 (file)
@@ -33,10 +33,10 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
        );
 
        // The real database layer
-       private $dbLayer = null;
+       private $dbLayer = NULL;
 
        // An instance of this class
-       private static $thisInstance = null;
+       private static $thisInstance = NULL;
 
        /**
         * Protected constructor
@@ -51,19 +51,19 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
        // Create new database connection layer
        public static final function createDatabaseConnection (DebugMiddleware $debugInstance, DatabaseFrontendInterface $dbLayer) {
                // Get instance
-               $dbInstance = new DatabaseConnection();
+               $databaseInstance = new DatabaseConnection();
 
                // Set debug output handler
-               $dbInstance->setDebugInstance($debugInstance);
+               $databaseInstance->setDebugInstance($debugInstance);
 
                // Set database layer
-               $dbInstance->setDatabaseLayer($dbLayer);
+               $databaseInstance->setDatabaseLayer($dbLayer);
 
                // Set db instance
-               self::$thisInstance = $dbInstance;
+               self::$thisInstance = $databaseInstance;
 
                // Return instance
-               return $dbInstance;
+               return $databaseInstance;
        }
 
        // Get an instance of this class
index 2a010b69999308ea24e68511fa4435038ad59dd6..4d70703b842a2eafdc88e2a65f5886d1e07c4f7b 100644 (file)
@@ -27,12 +27,12 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
        /**
         * The concrete output instance
         */
-       private $outputInstance = null;
+       private $outputInstance = NULL;
 
        /**
         * An instance of this class
         */
-       private static $thisInstance = null;
+       private static $thisInstance = NULL;
 
        /**
         * Protected constructor
index 7d8b8cc80d24b9d240390bb2fc31a20c40a07d68..22dff80329e9e95fa96c8cee61eea8403d64e8a7 100644 (file)
@@ -26,17 +26,17 @@ class FileIoHandler extends BaseMiddleware {
        /**
         * The *real* file input class we shall use for reading data
         */
-       private $inputStream = null;
+       private $inputStream = NULL;
 
        /**
         * The *real* file output class we shall use for reading data
         */
-       private $outputStream = null;
+       private $outputStream = NULL;
 
        /**
         * An instance of this class
         */
-       private static $thisInstance = null;
+       private static $thisInstance = NULL;
 
        /**
         * Protected constructor
index 73dc39421163033439c561a3fd5d4b3ca513ab2d..feb9eb684f3c598b3072344baa534ecfd7e202d2 100644 (file)
@@ -320,5 +320,11 @@ $cfg->setConfigEntry('stacker_generic_max_size', 100);
 // CFG: STACKER-CURRENT-NODE-MAX-SIZE
 $cfg->setConfigEntry('stacker_current_node_max_size', 20);
 
+// CFG: LOCAL-FILE-DATABASE-CLASS
+$cfg->setConfigEntry('local_file_database_class', 'LocalFileDatabase');
+
+// CFG: COMPRESSOR-CHANNEL-CLASS
+$cfg->setConfigEntry('compressor_channel_class', 'CompressorChannel');
+
 // [EOF]
 ?>
index 1a809e070c7a871a1ee70912220c086b09a1a606..938b67ba99c954a1265b1e44dedf1be577554eee 100644 (file)
@@ -36,7 +36,7 @@ class FrameworkConfiguration implements Registerable {
        /**
         * The configuration instance itself
         */
-       private static $configInstance = null;
+       private static $configInstance = NULL;
 
        // Some constants for the configuration system
        const EXCEPTION_CONFIG_ENTRY_IS_EMPTY      = 0x130;
@@ -217,7 +217,7 @@ class FrameworkConfiguration implements Registerable {
         */
        public function detectHttpSecured () {
                // Default is null
-               $https = null;
+               $https = NULL;
 
                // Is HTTPS set?
                if ($this->isHttpSecured()) {
index 6a64487734d39c55a4aaccc832fd2187a3716e27..54329fdeff19c33bff97b7407934e1c23ca1b72f 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 // Initialize database layer
-$databaseInstance = null;
+$databaseInstance = NULL;
 
 // Generate FQFN for the database layer
 $fqfn = FrameworkConfiguration::getInstance()->getConfigEntry('base_path') . 'inc/database/lib-' . FrameworkConfiguration::getInstance()->getConfigEntry('db_type') . '.php';
index 7ca9530c5ac24f9729b46173438a91b19d21a44d..9ee5507687caccc102e8af41e565d96994eea21a 100644 (file)
@@ -23,9 +23,7 @@
  */
 
 // For testing purposes we use a local file database
-$databaseInstance = LocalFileDatabase::createLocalFileDatabase(
-       FrameworkConfiguration::getInstance()->getConfigEntry('local_db_path')
-);
+$databaseInstance = ObjectFactory::createObjectByConfiguredName('local_file_database_class');
 
 // [EOF]
 ?>
index eef05549a88553580a4d92e163603a58e7bba084..3645bf171cc850569d641b0eb04e938e68c4c57f 100644 (file)
@@ -38,7 +38,7 @@ class ClassLoader {
        /**
         * Instance of this class
         */
-       private static $selfInstance = null;
+       private static $selfInstance = NULL;
 
        /**
         * Array with all classes