New field/attribute 'cryptoInstance' introduced:
authorRoland Häder <roland@mxchange.org>
Tue, 29 Mar 2011 12:30:00 +0000 (12:30 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 29 Mar 2011 12:30:00 +0000 (12:30 +0000)
- Getter/setter added for cryptoInstance field/attribute :-)
- Deprecated rngInstance removed from CryptoHelper, it is encapsulated in class
  BaseFrameworkSystem
- TODOs.txt updated

docs/TODOs.txt
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/crypto/class_CryptoHelper.php

index 5169e005c46e69dfeb68953297116b21e56071fd..07e8e2c38a25e1c33fb8f79b223da35940e68508 100644 (file)
@@ -3,11 +3,10 @@
 ./inc/classes/exceptions/main/class_MissingMethodException.php:13: * @todo             Try to rewrite user/guest login classes and mark this exception as deprecated
 ./inc/classes/exceptions/main/class_NoConfigEntryException.php:10: * @todo             Rename this class to NoFoundEntryException
 ./inc/classes/interfaces/class_FrameworkInterface.php:11: * @todo              Find a better name for this interface
 ./inc/classes/exceptions/main/class_MissingMethodException.php:13: * @todo             Try to rewrite user/guest login classes and mark this exception as deprecated
 ./inc/classes/exceptions/main/class_NoConfigEntryException.php:10: * @todo             Rename this class to NoFoundEntryException
 ./inc/classes/interfaces/class_FrameworkInterface.php:11: * @todo              Find a better name for this interface
-./inc/classes/main/class_BaseFrameworkSystem.php:1133:  * @todo        Write a logging mechanism for productive mode
-./inc/classes/main/class_BaseFrameworkSystem.php:1147:                 // @TODO Finish this part!
-./inc/classes/main/class_BaseFrameworkSystem.php:154:  // @todo Try to clean these constants up
-./inc/classes/main/class_BaseFrameworkSystem.php:233:   * @todo        This is old code. Do we still need this old lost code?
-./inc/classes/main/class_BaseFrameworkSystem.php:301:   * @todo        SearchableResult and UpdateableResult shall have a super interface to use here
+./inc/classes/main/class_BaseFrameworkSystem.php:1141:  * @todo        Write a logging mechanism for productive mode
+./inc/classes/main/class_BaseFrameworkSystem.php:1155:                 // @TODO Finish this part!
+./inc/classes/main/class_BaseFrameworkSystem.php:159:  // @todo Try to clean these constants up
+./inc/classes/main/class_BaseFrameworkSystem.php:318:   * @todo        SearchableResult and UpdateableResult shall have a super interface to use here
 ./inc/classes/main/commands/web/class_WebLoginAreaCommand.php:64:       * @todo        Add some stuff here: Some personal data, app/game related data
 ./inc/classes/main/commands/web/class_WebProblemCommand.php:58:         * @todo        0% done
 ./inc/classes/main/commands/web/class_WebStatusCommand.php:58:  * @todo        0% done
 ./inc/classes/main/commands/web/class_WebLoginAreaCommand.php:64:       * @todo        Add some stuff here: Some personal data, app/game related data
 ./inc/classes/main/commands/web/class_WebProblemCommand.php:58:         * @todo        0% done
 ./inc/classes/main/commands/web/class_WebStatusCommand.php:58:  * @todo        0% done
@@ -73,7 +72,7 @@
 ./inc/classes/main/response/image/class_ImageResponse.php:91:   * @todo        this will send only one cookie out, the first one.
 ./inc/classes/main/result/class_DatabaseResult.php:226:         * @todo        0% done
 ./inc/classes/main/result/class_DatabaseResult.php:379:4        * @todo        Find a caching way without modifying the result array
 ./inc/classes/main/response/image/class_ImageResponse.php:91:   * @todo        this will send only one cookie out, the first one.
 ./inc/classes/main/result/class_DatabaseResult.php:226:         * @todo        0% done
 ./inc/classes/main/result/class_DatabaseResult.php:379:4        * @todo        Find a caching way without modifying the result array
-./inc/classes/main/rng/class_RandomNumberGenerator.php:150:     * @todo        I had a better random number generator here but now it is somewhere lost :(
+./inc/classes/main/rng/class_RandomNumberGenerator.php:152:     * @todo        I had a better random number generator here but now it is somewhere lost :(
 ./inc/classes/main/rng/class_RandomNumberGenerator.php:83:      * @todo        Add site key for stronger salt!
 ./inc/classes/main/template/class_BaseTemplateEngine.php:1055:                 // @TODO This silent abort should be logged, maybe.
 ./inc/classes/main/template/class_BaseTemplateEngine.php:1063:                 // @TODO Old behaviour, will become obsolete!
 ./inc/classes/main/rng/class_RandomNumberGenerator.php:83:      * @todo        Add site key for stronger salt!
 ./inc/classes/main/template/class_BaseTemplateEngine.php:1055:                 // @TODO This silent abort should be logged, maybe.
 ./inc/classes/main/template/class_BaseTemplateEngine.php:1063:                 // @TODO Old behaviour, will become obsolete!
 ./inc/classes/main/template/class_BaseTemplateEngine.php:961:   * @todo        Unfinished work or don't die here.
 ./inc/classes/main/template/class_BaseTemplateEngine.php:978:                          // @TODO Non-string found so we need some deeper analysis...
 ./inc/classes/main/template/console/class_ConsoleTemplateEngine.php:10: * @todo                This template engine does not make use of setTemplateType()
 ./inc/classes/main/template/class_BaseTemplateEngine.php:961:   * @todo        Unfinished work or don't die here.
 ./inc/classes/main/template/class_BaseTemplateEngine.php:978:                          // @TODO Non-string found so we need some deeper analysis...
 ./inc/classes/main/template/console/class_ConsoleTemplateEngine.php:10: * @todo                This template engine does not make use of setTemplateType()
-./inc/classes/main/template/image/class_ImageTemplateEngine.php:213:    * @todo        Find something usefull with this!
-./inc/classes/main/template/image/class_ImageTemplateEngine.php:233:    * @todo        Add cache creation here
+./inc/classes/main/template/image/class_ImageTemplateEngine.php:215:    * @todo        Find something usefull with this!
+./inc/classes/main/template/image/class_ImageTemplateEngine.php:235:    * @todo        Add cache creation here
 ./inc/classes/main/template/mail/class_MailTemplateEngine.php:10: * @todo              This template engine does not make use of setTemplateType()
 ./inc/classes/main/template/mail/class_MailTemplateEngine.php:10: * @todo              This template engine does not make use of setTemplateType()
-./inc/classes/main/template/mail/class_MailTemplateEngine.php:226:      * @todo        Add cache creation here
-./inc/classes/main/template/mail/class_MailTemplateEngine.php:236:      * @todo        Should we call back the mailer class here?
-./inc/classes/main/template/mail/class_MailTemplateEngine.php:317:      * @todo        0% done
-./inc/classes/main/template/menu/class_MenuTemplateEngine.php:265:      * @todo        Find something useful with this!
-./inc/classes/main/template/menu/class_MenuTemplateEngine.php:311:      * @todo        Add cache creation here
+./inc/classes/main/template/mail/class_MailTemplateEngine.php:228:      * @todo        Add cache creation here
+./inc/classes/main/template/mail/class_MailTemplateEngine.php:238:      * @todo        Should we call back the mailer class here?
+./inc/classes/main/template/mail/class_MailTemplateEngine.php:319:      * @todo        0% done
+./inc/classes/main/template/menu/class_MenuTemplateEngine.php:267:      * @todo        Find something useful with this!
+./inc/classes/main/template/menu/class_MenuTemplateEngine.php:313:      * @todo        Add cache creation here
 ./inc/classes/main/user/class_BaseUser.php:308:         * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
 ./inc/classes/main/user/class_BaseUser.php:80:  * @todo        Find a way of casting here. "(int)" might destroy the user id > 32766
 ./inc/classes/main/user/member/class_Member.php:84:     * @todo        Add more ways over creating user classes
 ./inc/classes/main/user/class_BaseUser.php:308:         * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
 ./inc/classes/main/user/class_BaseUser.php:80:  * @todo        Find a way of casting here. "(int)" might destroy the user id > 32766
 ./inc/classes/main/user/member/class_Member.php:84:     * @todo        Add more ways over creating user classes
index 6cc07b23a42816073734a0df3b6d8adb36966fe4..c890cc23c0529f3c0109a00ed19e3c19f68da5f4 100644 (file)
@@ -78,6 +78,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $rngInstance = null;
 
         */
        private $rngInstance = null;
 
+       /**
+        * Instance of a crypto helper
+        */
+       private $cryptoInstance = null;
+
        /**
         * Instance of an Iterator class
         */
        /**
         * Instance of an Iterator class
         */
@@ -219,9 +224,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Set real class
                $this->setRealClass($className);
 
                // Set real class
                $this->setRealClass($className);
 
-               // Set configuration instance if no registry
+               // Set configuration instance if no registry ...
                if (!$this instanceof Register) {
                if (!$this instanceof Register) {
-                       // Because registries doesn't need to be configured
+                       // ... because registries doesn't need to be configured
                        $this->setConfigInstance(FrameworkConfiguration::getInstance());
                } // END - if
        }
                        $this->setConfigInstance(FrameworkConfiguration::getInstance());
                } // END - if
        }
@@ -230,7 +235,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * Destructor reached...
         *
         * @return      void
         * Destructor reached...
         *
         * @return      void
-        * @todo        This is old code. Do we still need this old lost code?
         */
        public function __destruct() {
                // Flush any updated entries to the database
         */
        public function __destruct() {
                // Flush any updated entries to the database
@@ -250,8 +254,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        }
 
        /**
        }
 
        /**
-        * The call method where all non-implemented methods end up
+        * The __call() method where all non-implemented methods end up
         *
         *
+        * @param       $methodName             Name of the missing method
+        * @args        $args                   Arguments passed to the method
         * @return      void
         */
        public final function __call ($methodName, $args) {
         * @return      void
         */
        public final function __call ($methodName, $args) {
@@ -267,7 +273,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                                $argsString .= $this->replaceControlCharacters($arg) . ' (' . gettype($arg);
 
                                // Add length if type is string
                                $argsString .= $this->replaceControlCharacters($arg) . ' (' . gettype($arg);
 
                                // Add length if type is string
-                               if (gettype($arg) == 'string') $argsString .= ', '.strlen($arg);
+                               if (is_string($arg)) {
+                                       $argsString .= ', '.strlen($arg);
+                               } // END - if
 
                                // Closing bracket
                                $argsString .= '), ';
 
                                // Closing bracket
                                $argsString .= '), ';
@@ -293,6 +301,15 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return null;
        }
 
                return null;
        }
 
+       /**
+        * Getter for $realClass
+        *
+        * @return      $realClass The name of the real class (not BaseFrameworkSystem)
+        */
+       public function __toString () {
+               return $this->realClass;
+       }
+
        /**
         * Setter for database result instance
         *
        /**
         * Setter for database result instance
         *
@@ -554,15 +571,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $this->responseInstance;
        }
 
                return $this->responseInstance;
        }
 
-       /**
-        * Getter for $realClass
-        *
-        * @return      $realClass The name of the real class (not BaseFrameworkSystem)
-        */
-       public function __toString () {
-               return $this->realClass;
-       }
-
        /**
         * Setter for the real class name
         *
        /**
         * Setter for the real class name
         *
@@ -1182,6 +1190,25 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $this->rngInstance;
        }
 
                return $this->rngInstance;
        }
 
+       /**
+        * Setter for Cryptable instance
+        *
+        * @param       $cryptoInstance An instance of a Cryptable class
+        * @return      void
+        */
+       protected final function setCryptoInstance (Cryptable $cryptoInstance) {
+               $this->cryptoInstance = $cryptoInstance;
+       }
+
+       /**
+        * Getter for Cryptable instance
+        *
+        * @return      $cryptoInstance An instance of a Cryptable class
+        */
+       public final function getCryptoInstance () {
+               return $this->cryptoInstance;
+       }
+
        /**
         * Setter for Iterator instance
         *
        /**
         * Setter for Iterator instance
         *
index 5e40560622673b8b4d4e6d83a300eb14e7f3eb86..f377a575a1af45ce8e22804dc81547a973b6b6dc 100644 (file)
@@ -31,11 +31,6 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
         */
        private static $selfInstance = null;
 
         */
        private static $selfInstance = null;
 
-       /**
-        * Instance of the random number generator
-        */
-       private $rngInstance = null;
-
        /**
         * Instance of the crypto stream
         */
        /**
         * Instance of the crypto stream
         */