]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/class_BaseFrameworkSystem.php
Continued:
[core.git] / framework / main / classes / class_BaseFrameworkSystem.php
index 5a7b75370e47108df98262c384130cc57bc10f48..38a45f3de6487ae05416f5e7fbff5ab4508723ec 100644 (file)
@@ -4,7 +4,6 @@ namespace Org\Mxchange\CoreFramework\Object;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
-use Org\Mxchange\CoreFramework\Criteria\Criteria;
 use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
 use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filesystem\PathWriteProtectedException;
@@ -19,7 +18,7 @@ use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Result\Database\CachedDatabaseResult;
 use Org\Mxchange\CoreFramework\State\Stateable;
 use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
-use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
+use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
 // Import SPL stuff
 use \stdClass;
@@ -51,11 +50,6 @@ use \SplFileInfo;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 abstract class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
-       /**
-        * Length of output from hash()
-        */
-       private static $hashLength = NULL;
-
        /**
         * Self-referencing instance
         */
@@ -971,26 +965,6 @@ Loaded includes:
                return $isBase64;
        }
 
-       /**
-        * Gets a cache key from Criteria instance
-        *
-        * @param       $criteriaInstance       An instance of a Criteria class
-        * @param       $onlyKeys                       Only use these keys for a cache key
-        * @return      $cacheKey                       A cache key suitable for lookup/storage purposes
-        */
-       protected function getCacheKeyByCriteria (Criteria $criteriaInstance, array $onlyKeys = []) {
-               // Generate it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRAMEWORK-SYSTEM: criteriaInstance=' . $criteriaInstance->__toString() . ',onlyKeys()=' . count($onlyKeys) . ' - CALLED!');
-               $cacheKey = sprintf('%s@%s',
-                       $this->__toString(),
-                       $criteriaInstance->getCacheKey($onlyKeys)
-               );
-
-               // And return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRAMEWORK-SYSTEM: cacheKey=' . $cacheKey . ' - EXIT!');
-               return $cacheKey;
-       }
-
        /**
         * Getter for startup time in miliseconds
         *
@@ -1013,38 +987,6 @@ Loaded includes:
                return $executionTime;
        }
 
-       /**
-        * Hashes a given string with a simple but stronger hash function (no salt)
-        * and hex-encode it.
-        *
-        * @param       $str    The string to be hashed
-        * @return      $hash   The hash from string $str
-        */
-       public static final function hash (string $str) {
-               // Hash given string with (better secure) hasher
-               $hash = bin2hex(mhash(MHASH_SHA256, $str));
-
-               // Return it
-               return $hash;
-       }
-
-       /**
-        * "Getter" for length of hash() output. This will be "cached" to speed up
-        * things.
-        *
-        * @return      $length         Length of hash() output
-        */
-       public static final function getHashLength () {
-               // Is it cashed?
-               if (is_null(self::$hashLength)) {
-                       // No, then hash a string and save its length.
-                       self::$hashLength = strlen(self::hash('abc123'));
-               }
-
-               // Return it
-               return self::$hashLength;
-       }
-
        /**
         * Determines if an element is set in the generic array
         *
@@ -1055,10 +997,8 @@ Loaded includes:
         * @return      $isset          Whether the given key is set
         */
        protected final function isGenericArrayElementSet (string $keyGroup, string $subGroup, $key, $element) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element);
-
                // Is it there?
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element);
                $isset = isset($this->genericArray[$keyGroup][$subGroup][$key][$element]);
 
                // Return it
@@ -1073,10 +1013,8 @@ Loaded includes:
         * @return      $isset          Whether the given key is set
         */
        protected final function isGenericArrayKeySet (string $keyGroup, string $subGroup, $key) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
-
                // Is it there?
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
                $isset = isset($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Return it
@@ -1092,10 +1030,8 @@ Loaded includes:
         * @return      $isset          Whether the given group is set
         */
        protected final function isGenericArrayGroupSet (string $keyGroup, string $subGroup) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup);
-
                // Is it there?
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup);
                $isset = isset($this->genericArray[$keyGroup][$subGroup]);
 
                // Return it
@@ -1117,10 +1053,8 @@ Loaded includes:
                        exit;
                }
 
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',value=' . print_r($this->genericArray[$keyGroup][$subGroup], true));
-
                // Return it
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',value=' . print_r($this->genericArray[$keyGroup][$subGroup], true));
                return $this->genericArray[$keyGroup][$subGroup];
        }
 
@@ -1133,10 +1067,8 @@ Loaded includes:
         * @return      void
         */
        protected final function unsetGenericArrayKey (string $keyGroup, string $subGroup, $key) {
-               // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
-
                // Remove it
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key);
                unset($this->genericArray[$keyGroup][$subGroup][$key]);
        }