From b4d42594f7eb8c7f254a14901743ffdef168e84f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 26 Oct 2020 12:22:00 +0100 Subject: [PATCH] Continued: - added more debug lines MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- framework/main/classes/class_BaseFrameworkSystem.php | 3 ++- .../backend/lfdb_legacy/class_CachedLocalFileDatabase.php | 8 +++++--- .../main/classes/database/class_BaseDatabaseWrapper.php | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/framework/main/classes/class_BaseFrameworkSystem.php b/framework/main/classes/class_BaseFrameworkSystem.php index 084d2371..a0c0e905 100644 --- a/framework/main/classes/class_BaseFrameworkSystem.php +++ b/framework/main/classes/class_BaseFrameworkSystem.php @@ -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; } diff --git a/framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php b/framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php index e4ed238d..f916af8e 100644 --- a/framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php +++ b/framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php @@ -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!'); } /** diff --git a/framework/main/classes/database/class_BaseDatabaseWrapper.php b/framework/main/classes/database/class_BaseDatabaseWrapper.php index 3643bb57..d20190e5 100644 --- a/framework/main/classes/database/class_BaseDatabaseWrapper.php +++ b/framework/main/classes/database/class_BaseDatabaseWrapper.php @@ -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!'); } /** -- 2.39.2