]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 26 Oct 2020 11:22:00 +0000 (12:22 +0100)
committerRoland Häder <roland@mxchange.org>
Mon, 26 Oct 2020 11:22:00 +0000 (12:22 +0100)
- added more debug lines

Signed-off-by: Roland Häder <roland@mxchange.org>
framework/main/classes/class_BaseFrameworkSystem.php
framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php
framework/main/classes/database/class_BaseDatabaseWrapper.php

index 084d2371593572b90ca246d11e8a223b9d799165..a0c0e9053087e8c8bc77fd4c353b965756aa5ae2 100644 (file)
@@ -2339,13 +2339,14 @@ Loaded includes:
         */
        protected function getCacheKeyByCriteria (Criteria $criteriaInstance, array $onlyKeys = array()) {
                // 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($this->__toString() . ': cacheKey=' . $cacheKey);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRAMEWORK-SYSTEM: cacheKey=' . $cacheKey . ' - EXIT!');
                return $cacheKey;
        }
 
index e4ed238dc3c65db9b25c255596001d9e5156d717..f916af8e55f3a5e7227483ccae1b40b64ef959c1 100644 (file)
@@ -215,10 +215,8 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                // Serialize and compress it
                $compressedData = $this->getCompressorChannel()->getCompressor()->compressStream(json_encode($dataArray));
 
-               // Write data
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Writing ' . strlen($compressedData) . ' bytes ...');
-
                // Write this data BASE64 encoded to the file
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Writing ' . strlen($compressedData) . ' bytes ...');
                $this->getFileIoInstance()->saveStreamToFile($infoInstance, $compressedData, $this);
 
                // Debug message
@@ -473,6 +471,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         */
        public function queryInsertDataSet (StoreableCriteria $dataSetInstance) {
                // Try to save the request away
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DATABASE: dataSetInstance=%s - CALLED!', $dataSetInstance->__toString()));
                try {
                        // Create full path name
                        $infoInstance = $this->generateFileFromDataSet($dataSetInstance, md5($dataSetInstance->getUniqueValue()));
@@ -498,6 +497,9 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                self::EXCEPTION_SQL_QUERY
                        );
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: EXIT!');
        }
 
        /**
index 3643bb5735fed694a3c17c384d95d8baf6040adc..d20190e5cec156f6165c5a2528ef90f776b746d6 100644 (file)
@@ -97,6 +97,7 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem {
         */
        protected function queryInsertDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = array()) {
                // Default cache key is NULL
+               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: dataSetInstance=%s,onlyKeys()=%d - CALLED!', $dataSetInstance->__toString(), count($onlyKeys)));
                $cacheKey = NULL;
 
                // Is cache enabled?
@@ -107,13 +108,18 @@ abstract class BaseDatabaseWrapper extends BaseFrameworkSystem {
                } // END - if
 
                // 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))) {
                        // Purge the cache
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: Calling this->cacheInstance->purgeOffset(%s) ...', $cacheKey));
                        $this->cacheInstance->purgeOffset($cacheKey);
                } // END - if
 
                // Handle it over to the middleware
                FrameworkBootstrap::getDatabaseInstance()->queryInsertDataSet($dataSetInstance);
+
+               // Trace message
+               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: EXIT!');
        }
 
        /**