]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/database/class_BaseDatabaseWrapper.php
Continued:
[core.git] / framework / main / classes / database / class_BaseDatabaseWrapper.php
index 7a55a482c90cd17d1ce955972b4914c02d885af0..f9414067b473f2974c41651eceea26401d7a9796 100644 (file)
@@ -63,7 +63,7 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem {
         */
        private final function initCacheInstance () {
                // Is the cache enabled?
-               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
+               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) {
                        // Set the new instance
                        $this->cacheInstance = CacheFactory::getFactory()->createConfiguredCache();
                } // END - if
@@ -101,7 +101,7 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem {
                $cacheKey = NULL;
 
                // Is cache enabled?
-               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
+               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) {
                        // First get a key suitable for our cache and extend it with this class name
                        $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
@@ -109,7 +109,7 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem {
 
                // Does this key exists in cache?
                //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: cacheKey[%s]=%s', gettype($cacheKey), $cacheKey));
-               if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) {
+               if ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) {
                        // Purge the cache
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: Calling this->cacheInstance->purgeOffset(%s) ...', $cacheKey));
                        $this->cacheInstance->purgeOffset($cacheKey);
@@ -134,14 +134,14 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem {
                $cacheKey = NULL;
 
                // Is cache enabled?
-               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
+               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) {
                        // First get a key suitable for our cache and extend it with this class name
                        $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
                } // END - if
 
                // Does this key exists in cache?
-               if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) {
+               if ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) {
                        // Purge the cache
                        $this->cacheInstance->purgeOffset($cacheKey);
                } // END - if
@@ -183,14 +183,14 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem {
                $result = array();
 
                // Is the cache enabled?
-               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
+               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) {
                        // First get a key suitable for our cache and extend it with this class name
                        $cacheKey = $this->getCacheKeyByCriteria($criteriaInstance, $onlyKeys);
                } // END - if
 
                // Does this key exists in cache?
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: cacheKey[%s]=%s', gettype($cacheKey), $cacheKey));
-               if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) {
+               if ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) {
                        // Then use this result
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: Cache used for cacheKey=%s', $cacheKey));
                        $result = $this->cacheInstance->offsetGet($cacheKey);
@@ -203,7 +203,7 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem {
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: result[]=%s', gettype($result)));
                        if (!is_null($result)) {
                                // Is cache enabled?
-                               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
+                               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) {
                                        // A valid result has returned from the database layer
                                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: Setting cacheKey=%s with result()=%d entries', $cacheKey, count($result)));
                                        $this->cacheInstance->offsetSet($cacheKey, $result);