X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=framework%2Fmain%2Fclasses%2Fdatabase%2Fclass_BaseDatabaseWrapper.php;h=ea4f3402e737005b2214de8495f21fbb994521f0;hb=cad1ab5ecb2935a6ebf678555860c3bd96b525b0;hp=edc28b9d4ff10676bb01c73faa4cc763463da03e;hpb=a7ce95074761e66fd8624ca865a5de04c1f4bd4b;p=core.git diff --git a/framework/main/classes/database/class_BaseDatabaseWrapper.php b/framework/main/classes/database/class_BaseDatabaseWrapper.php index edc28b9d..ea4f3402 100644 --- a/framework/main/classes/database/class_BaseDatabaseWrapper.php +++ b/framework/main/classes/database/class_BaseDatabaseWrapper.php @@ -1,20 +1,24 @@ * @version 0.0.0 +<<<<<<< HEAD:framework/main/classes/database/class_BaseDatabaseWrapper.php * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team +======= + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team +>>>>>>> Some updates::inc/main/classes/database/class_BaseDatabaseWrapper.php * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * @@ -31,7 +35,7 @@ use CoreFramework\Object\BaseFrameworkSystem; * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseDatabaseWrapper extends BaseFrameworkSystem { +abstract class BaseDatabaseWrapper extends BaseFrameworkSystem { /** * Cache instance */ @@ -62,7 +66,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { */ private final function initCacheInstance () { // Is the cache enabled? - if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) { + if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) { // Set the new instance $this->cacheInstance = CacheFactory::getFactory()->createConfiguredCache(); } // END - if @@ -99,14 +103,14 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { $cacheKey = NULL; // Is cache enabled? - if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) { + if ($this->getConfigInstance()->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 (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) { // Purge the cache $this->cacheInstance->purgeOffset($cacheKey); } // END - if @@ -127,14 +131,14 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { $cacheKey = NULL; // Is cache enabled? - if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) { + if ($this->getConfigInstance()->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 (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) { // Purge the cache $this->cacheInstance->purgeOffset($cacheKey); } // END - if @@ -174,15 +178,15 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { $cacheKey = NULL; // Is the cache enabled? - if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) { + if ($this->getConfigInstance()->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? - if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) { + if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Cache used for cacheKey=' . $cacheKey . ':' . print_r($this->cacheInstance->offsetGet($cacheKey), TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Cache used for cacheKey=' . $cacheKey . ':' . print_r($this->cacheInstance->offsetGet($cacheKey), true)); // Then use this result $result = $this->cacheInstance->offsetGet($cacheKey); @@ -197,7 +201,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem { // Cache the result if not null if (!is_null($result)) { // Is cache enabled? - if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) { + if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) { // A valid result has returned from the database layer $this->cacheInstance->offsetSet($cacheKey, $result); } // END - if