]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 17 Feb 2023 18:44:10 +0000 (19:44 +0100)
committerRoland Häder <roland@mxchange.org>
Fri, 17 Feb 2023 18:44:10 +0000 (19:44 +0100)
- renamed getPrimaryKeyValue() to generatePrimaryKey()
- added more debug lines
- added more checks for parameter

16 files changed:
framework/loader/class_ClassLoader.php
framework/main/classes/database/frontend/class_BaseDatabaseFrontend.php
framework/main/classes/file_directories/binary/index/class_IndexFile.php
framework/main/classes/file_directories/binary/stack/class_StackFile.php
framework/main/classes/file_directories/class_BaseFileIo.php
framework/main/classes/file_directories/io/class_FrameworkFileInputOutputPointer.php
framework/main/classes/index/file/class_BaseFileIndex.php
framework/main/classes/index/file/stack/class_FileStackIndex.php
framework/main/classes/stacker/class_BaseStacker.php
framework/main/classes/stacker/fifo/class_FiFoStacker.php
framework/main/classes/stacker/file/class_BaseFileStack.php
framework/main/classes/stacker/file/fifo/class_FiFoFileStack.php
framework/main/classes/stacker/filo/class_FiLoStacker.php
framework/main/classes/user/class_BaseUser.php
framework/main/interfaces/database/frontend/class_DatabaseFrontend.php
framework/main/middleware/database/class_DatabaseConnection.php

index 07dfd8420b77bfbbd01441bb9bac0ffb3f40ddec..a9de4ee00e4ca35afe128b7f3a4d4d7267028d41 100644 (file)
@@ -399,7 +399,7 @@ final class ClassLoader {
                }
 
                // Try to include this class
-               //* NOISY-DEBUG: */ printf('[%s:%d]: Calling self->loadClassFile(%s) ...' . PHP_EOL, __METHOD__, __LINE__, $className);
+               //* NOISY-DEBUG: */ printf('[%s:%d]: Invoking self->loadClassFile(%s) ...' . PHP_EOL, __METHOD__, __LINE__, $className);
                self::getSelfInstance()->loadClassFile($className);
 
                // Trace message
index 2f4320ccf46da12e605b45d8b1c422f0d65a610e..23de87b3c3f7248a24bb9c69ec90519bff7f803c 100644 (file)
@@ -12,6 +12,9 @@ use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Result\Database\BaseDatabaseResult;
 use Org\Mxchange\CoreFramework\Traits\Cache\CacheableTrait;
 
+// Import SPL stuff
+use \InvalidArgumentException;
+
 /**
  * A generic database frontend
  *
@@ -55,10 +58,14 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        protected function __construct (string $className) {
                // Call parent constructor
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATABASE-FRONTEND: CONSTRUCTED!');
                parent::__construct($className);
 
                // Initialize the cache instance
                $this->initCacheInstance();
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATABASE-FRONTEND: EXIT!');
        }
 
        /**
@@ -68,13 +75,18 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        private final function initCacheInstance () {
                // Set "cache" attributes
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATABASE-FRONTEND: CALLED!');
                $this->databaseCacheEnabled = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled');
 
                // Is the cache enabled?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d', intval($this->databaseCacheEnabled)));
                if ($this->databaseCacheEnabled === true) {
                        // Set the new instance
                        $this->setCacheInstance(ObjectFactory::createObjectByConfiguredName('cache_class'));
                }
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATABASE-FRONTEND: EXIT!');
        }
 
        /**
@@ -105,7 +117,7 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        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!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: criteriaInstance=%s,onlyKeys()=%d - CALLED!', $criteriaInstance->__toString(), count($onlyKeys)));
                $cacheKey = sprintf('%s@%s',
                        $this->__toString(),
                        $criteriaInstance->getCacheKey($onlyKeys)
@@ -125,21 +137,22 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        protected function queryInsertDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = []) {
                // Default cache key is NULL
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: dataSetInstance=%s,onlyKeys()=%d - CALLED!', $dataSetInstance->__toString(), count($onlyKeys)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: dataSetInstance=%s,onlyKeys()=%d - CALLED!', $dataSetInstance->__toString(), count($onlyKeys)));
                $cacheKey = NULL;
 
                // Is cache enabled?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d', intval($this->databaseCacheEnabled)));
                if ($this->databaseCacheEnabled === 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-FRONTEND: Using cache key ' . $cacheKey . ' for purging ...');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: Using cache key %s for purging ...', $cacheKey));
                }
 
                // Does this key exists in cache?
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: cacheKey[%s]=%s', gettype($cacheKey), $cacheKey));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d,cacheKey[%s]=%s', intval($this->databaseCacheEnabled), gettype($cacheKey), $cacheKey));
                if (($this->databaseCacheEnabled === true) && ($this->getCacheInstance()->offsetExists($cacheKey))) {
                        // Purge the cache
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: Calling this->cacheInstance->purgeOffset(%s) ...', $cacheKey));
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: Invoking this->cacheInstance->purgeOffset(%s) ...', $cacheKey));
                        $this->getCacheInstance()->purgeOffset($cacheKey);
                }
 
@@ -147,7 +160,7 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
                FrameworkBootstrap::getDatabaseInstance()->queryInsertDataSet($dataSetInstance);
 
                // Trace message
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRONTEND: EXIT!');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATABASE-FRONTEND: EXIT!');
        }
 
        /**
@@ -159,16 +172,19 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        protected function queryUpdateDataSet (StoreableCriteria $dataSetInstance, array $onlyKeys = []) {
                // Init cache key
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: dataSetInstance=%s,onlyKeys()=%d - CALLED!', $dataSetInstance->__toString(), count($onlyKeys)));
                $cacheKey = NULL;
 
                // Is cache enabled?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d', intval($this->databaseCacheEnabled)));
                if ($this->databaseCacheEnabled === 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-FRONTEND: Using cache key ' . $cacheKey . ' for purging ...');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATABASE-FRONTEND: Using cache key ' . $cacheKey . ' for purging ...');
                }
 
                // Does this key exists in cache?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d,cacheKey=%s', intval($this->databaseCacheEnabled), $cacheKey));
                if (($this->databaseCacheEnabled === true) && ($this->getCacheInstance()->offsetExists($cacheKey))) {
                        // Purge the cache
                        $this->getCacheInstance()->purgeOffset($cacheKey);
@@ -176,6 +192,9 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
 
                // Handle it over to the middleware
                FrameworkBootstrap::getDatabaseInstance()->queryUpdateDataSet($dataSetInstance);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATABASE-FRONTEND: EXIT!');
        }
 
        /**
@@ -184,6 +203,7 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         * @return      $indexKey       Index key
         */
        public final function getIndexKey () {
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATABASE-FRONTEND: CALLED!');
                return FrameworkBootstrap::getDatabaseInstance()->getIndexKey();
        }
 
@@ -193,6 +213,7 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         * @return      $lastException  Last exception or NULL if none occured
         */
        public final function getLastException () {
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATABASE-FRONTEND: CALLED!');
                return FrameworkBootstrap::getDatabaseInstance()->getLastException();
        }
 
@@ -206,34 +227,36 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        public function doSelectByCriteria (Criteria $criteriaInstance, array $onlyKeys = []) {
                // Default cache key if cache is not enabled
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: criteriaInstance=%s,onlyKeys()=%d - CALLED!', $criteriaInstance->__toString(), count($onlyKeys)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: criteriaInstance=%s,onlyKeys()=%d - CALLED!', $criteriaInstance->__toString(), count($onlyKeys)));
                $cacheKey = NULL;
                $result = [];
 
                // Is the cache enabled?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d', intval($this->databaseCacheEnabled)));
                if ($this->databaseCacheEnabled === true) {
                        // First get a key suitable for our cache and extend it with this class name
                        $cacheKey = $this->getCacheKeyByCriteria($criteriaInstance, $onlyKeys);
                }
 
                // Does this key exists in cache?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: cacheKey[%s]=%s', gettype($cacheKey), $cacheKey));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d,cacheKey[%s]=%s', intval($this->databaseCacheEnabled), gettype($cacheKey), $cacheKey));
                if (($this->databaseCacheEnabled === true) && ($this->getCacheInstance()->offsetExists($cacheKey, BaseDatabaseResult::RESULT_NAME_ROWS, 1))) {
                        // Then use this result
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: Cache used for cacheKey=%s', $cacheKey));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: Cache used for cacheKey=%s', $cacheKey));
                        $result = $this->getCacheInstance()->offsetGet($cacheKey);
                } else {
                        // Now it's time to ask the database layer for this select statement
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: Quering database, cacheKey=%s ...', $cacheKey));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: Quering database, cacheKey=%s ...', $cacheKey));
                        $result = FrameworkBootstrap::getDatabaseInstance()->doSelectByTableCriteria($this->getTableName(), $criteriaInstance);
 
                        // Cache the result if not null
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: result[]=%s', gettype($result)));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: result[]=%s', gettype($result)));
                        if (!is_null($result)) {
                                // Is cache enabled?
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: this->databaseCacheEnabled=%d', intval($this->databaseCacheEnabled)));
                                if ($this->databaseCacheEnabled === true) {
                                        // A valid result has returned from the database layer
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: Setting cacheKey=%s with result()=%d entries', $cacheKey, count($result)));
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: Setting cacheKey=%s with result()=%d entries', $cacheKey, count($result)));
                                        $this->getCacheInstance()->offsetSet($cacheKey, $result);
                                }
                        } else {
@@ -247,11 +270,11 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
 
                // Create an instance of a CachedDatabaseResult class with the given result
                // @TODO Minor: Update above comment to e.g. BaseDatabaseResult
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: result[%s]=%s,result[%s]?=%d,result[%s]?=%d', BaseDatabaseResult::RESULT_NAME_STATUS, $result[BaseDatabaseResult::RESULT_NAME_STATUS], BaseDatabaseResult::RESULT_NAME_ROWS, isset($result[BaseDatabaseResult::RESULT_NAME_ROWS]), BaseDatabaseResult::RESULT_NAME_EXCEPTION, isset($result[BaseDatabaseResult::RESULT_NAME_EXCEPTION])));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: result[%s]=%s,result[%s]?=%d,result[%s]?=%d', BaseDatabaseResult::RESULT_NAME_STATUS, $result[BaseDatabaseResult::RESULT_NAME_STATUS], BaseDatabaseResult::RESULT_NAME_ROWS, isset($result[BaseDatabaseResult::RESULT_NAME_ROWS]), BaseDatabaseResult::RESULT_NAME_EXCEPTION, isset($result[BaseDatabaseResult::RESULT_NAME_EXCEPTION])));
                $resultInstance = ObjectFactory::createObjectByConfiguredName('database_result_class', array($result));
 
                // And return the instance
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FRONTEND: resultInstance=%s - EXIT!', $resultInstance->__toString()));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: resultInstance=%s - EXIT!', $resultInstance->__toString()));
                return $resultInstance;
        }
 
@@ -264,34 +287,36 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        public function doSelectCountByCriteria (Criteria $criteriaInstance, array $onlyKeys = []) {
                // Total numbers is -1 so we can distinglish between failed and valid queries
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: criteriaInstance=%s,onlyKeys()=%d - CALLED!', $criteriaInstance->__toString(), count($onlyKeys)));
                $numRows = 0;
 
                // Get the result from above method
                $resultInstance = $this->doSelectByCriteria($criteriaInstance, $onlyKeys);
 
                // Was that query fine?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: resultInstance->ifStatusIsOkay()=%d', $resultInstance->ifStatusIsOkay()));
                if ($resultInstance->ifStatusIsOkay()) {
                        // Then get the number of rows
                        $numRows = $resultInstance->getAffectedRows();
-
-                       // Debug message
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FRONTEND: numRows=' . $numRows);
                }
 
                // Return the result
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: numRows=%d - EXIT!', $numRows));
                return $numRows;
        }
 
        /**
-        * Getter for primary key used in wrapped table
+        * Generates a primary key for this database frontend
         *
         * @return      $primaryKey             Primary key used in wrapped table
         */
-       public final function getPrimaryKeyValue () {
+       public final function generatePrimaryKey () {
                // Get the table name and a database instance and ask for it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATABASE-FRONTEND: CALLED!');
                $primaryKey = FrameworkBootstrap::getDatabaseInstance()->getPrimaryKeyOfTable($this->getTableName());
 
                // Return value
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: primaryKey=%s - EXIT!', $primaryKey));
                return $primaryKey;
        }
 
@@ -302,9 +327,11 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         */
        public final function countTotalRows () {
                // Get the table name and a database instance and ask for it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-DATABASE-FRONTEND: CALLED!');
                $count = FrameworkBootstrap::getDatabaseInstance()->countTotalRows($this->getTableName());
 
                // Return value
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: count=%d - EXIT!', $count));
                return $count;
        }
 
@@ -313,12 +340,21 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem {
         *
         * @param       $data   An array with possible non-public data that needs to be removed.
         * @return      $data   A cleaned up array with only public data.
+        * @throws      InvalidArgumentException        If a parameter has an invalid value
         */
        public function removeNonPublicDataFromArray (array $data) {
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('WRAPPER[' . $this->__toString() . ']: Calling FrameworkBootstrap::getDatabaseInstance()->removeNonPublicDataFromArray(data) ...');
+               // Check parameter
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: data()=%d - CALLED!', count($data)));
+               if (count($data) == 0) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "data" is an empty array', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               }
+
+               // Remove non-public data (aka. sensitive)
                $data = FrameworkBootstrap::getDatabaseInstance()->removeNonPublicDataFromArray($data);
 
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('WRAPPER[' . $this->__toString() . ']: data[]=' . gettype($data));
+               // Return cleaned array
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-DATABASE-FRONTEND: data()=%d - EXIT!', count($data)));
                return $data;
        }
 
index 78dac38ed79defa7dc6fe5d949ac6415d7dfeba6..99a56a6c3e5debe044672b213af25a63040ee5d6 100644 (file)
@@ -93,7 +93,7 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
                }
 
                // Call block instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: Calling this->indexInstance->flushFileHeader() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: Invoking this->indexInstance->flushFileHeader() ...');
                $this->getIndexInstance()->flushFileHeader();
 
                // Trace message
@@ -126,6 +126,7 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
                $minimumBlockLength = $this->getIndexInstance()->calculateMinimumBlockLength();
 
                // Call protected method
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: Invoking this->preAllocateFileByTypeLength(%s,%d) ...', $type, $minimumBlockLength));
                $this->preAllocateFileByTypeLength($type, $minimumBlockLength);
 
                // Trace message
@@ -149,11 +150,11 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
                }
 
                // Get length from index
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: Calling this->indexInstance->calculateMinimumBlockLength() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: Invoking this->indexInstance->calculateMinimumBlockLength() ...');
                $length = $this->getIndexInstance()->calculateMinimumBlockLength();
 
                // Call protected method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: Calling this->isValidByLength(%d) ...', $length));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: Invoking this->isValidByLength(%d) ...', $length));
                $isValid = $this->isValidByLength($length);
 
                // Return result
@@ -174,7 +175,7 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
                $length = $this->getIndexInstance()->calculateMinimumBlockLength();
 
                // Call protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: Calling parent::readNextBlockByLength(%d) ...', $length));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: Invoking parent::readNextBlockByLength(%d) ...', $length));
                parent::readNextBlockByLength($length);
 
                // Trace message
@@ -188,7 +189,7 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
         */
        public function readFileHeader () {
                // Call index class' method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: Calling this->indexInstance->readIndexHeader() - CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: Invoking this->indexInstance->readIndexHeader() - CALLED!');
                $this->getIndexInstance()->readIndexHeader();
 
                // Trace message
@@ -219,10 +220,11 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
                }
 
                // Encode/convert the value into a "binary format"
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: Invoking StringUtils::encodeData(value[]=%s) ...', gettype($value)));
                $encoded = StringUtils::encodeData($value);
 
                // Get a strong hash for the "encoded" data
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: encoded=%s', $encoded));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: encoded(%d)=%s', strlen($encoded), $encoded));
                $hash = CryptoUtils::hash($encoded);
 
                // Then write it to the next free gap
index f93dd76953b3f43f7984fcba3d10b3b8fad9568b..5d3f4c94e82367bed8c8c294c35ae99ff309298b 100644 (file)
@@ -91,7 +91,7 @@ class StackFile extends BaseBinaryFile implements FileStacker {
                }
 
                // Call block instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: Calling this->indexInstance->flushFileHeader() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: Invoking this->indexInstance->flushFileHeader() ...');
                $this->getStackInstance()->flushFileHeader();
 
                // Trace message
@@ -147,11 +147,11 @@ class StackFile extends BaseBinaryFile implements FileStacker {
                }
 
                // Get length from index
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: Calling this->stackInstance->calculateMinimumBlockLength() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: Invoking this->stackInstance->calculateMinimumBlockLength() ...');
                $length = $this->getStackInstance()->calculateMinimumBlockLength();
 
                // Call protected method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Calling this->isValidByLength(%d) ...', $length));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Invoking this->isValidByLength(%d) ...', $length));
                $isValid = $this->isValidByLength($length);
 
                // Return result
@@ -167,7 +167,7 @@ class StackFile extends BaseBinaryFile implements FileStacker {
         */
        public function readFileHeader () {
                // Call stacke instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: Calling this->stackInstance->readStackHeader() - CALLED!');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: Invoking this->stackInstance->readStackHeader() - CALLED!');
                $this->getStackInstance()->readStackHeader();
 
                // Trace message
@@ -187,7 +187,7 @@ class StackFile extends BaseBinaryFile implements FileStacker {
                $length = $this->getStackInstance()->calculateMinimumBlockLength();
 
                // Call protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Calling parent::readNextBlockByLength(%d) ...', $length));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Invoking parent::readNextBlockByLength(%d) ...', $length));
                parent::readNextBlockByLength($length);
 
                // Trace message
@@ -208,21 +208,21 @@ class StackFile extends BaseBinaryFile implements FileStacker {
                if (empty($stackName)) {
                        // Throw IAE
                        throw new InvalidArgumentException('Parameter "stackName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
-               } elseif (is_object($value) || is_resource($value)) {
+               } elseif (is_array($value) || is_object($value) || is_resource($value)) {
                        // Not wanted here
                        throw new InvalidArgumentException(sprintf('value[]=%s is not stackable in files', gettype($value)));
                }
 
                // Encode/convert the value into a "binary format"
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Calling StringUtils::encodeData(value[]=%s) ...', gettype($value)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Invoking StringUtils::encodeData(value[]=%s) ...', gettype($value)));
                $encoded = StringUtils::encodeData($value);
 
                // Get a strong hash for the "encoded" data
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Calling CryptoUtils::hash(%s) ...', $encoded));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Invoking CryptoUtils::hash(%s) ...', $encoded));
                $hash = CryptoUtils::hash($encoded);
 
                // Then write it to the next free gap
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Calling this->stackInstance->writeDataToFreeGap(%s,%s,%s) ...', $stackName, $hash, $encoded));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: Invoking this->stackInstance->writeDataToFreeGap(%s,%s,%s) ...', $stackName, $hash, $encoded));
                $data = $this->getStackInstance()->writeDataToFreeGap($stackName, $hash, $encoded);
 
                // Return info
index 05098d0b0d25aeae391a49e8d3cbc3c2fe21e489..3dfab5b62ed2dd3f0d5f9403e9a0e314ca548d41 100644 (file)
@@ -61,7 +61,7 @@ abstract class BaseFileIo extends BaseFrameworkSystem implements FilePointer, Cl
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-IO: this->fileObject[]=%s - DESTRUCTOR!', gettype($this->getFileObject())));
                if (is_object($this->getFileObject())) {
                        // Try to close a file
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-IO: Calling this->closeFile() ...');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-IO: Invoking this->closeFile() ...');
                        $this->closeFile();
                }
 
index 54a18ac783717024406547b7940a995443b19950..b0086c98157a764b77c8bedc6b007b30a2bff82d 100644 (file)
@@ -136,7 +136,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
                $length = strlen($dataStream);
 
                // Write data to the file pointer and return written bytes
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: Calling this->fileObject->fwrite(%s,%d) ...', $dataStream, $length));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: Invoking this->fileObject->fwrite(%s,%d) ...', $dataStream, $length));
                $status = $this->getFileObject()->fwrite($dataStream, $length);
 
                // Return status
@@ -168,7 +168,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
                }
 
                // Then write the data at that position
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: Calling this->writeToFile(%s) ...', $dataStream));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-INPUT-OUTPUT-POINTER: Invoking this->writeToFile(%s) ...', $dataStream));
                $status = $this->writeToFile($dataStream);
 
                // Return status
index b0a247720655139203f10310b27dead9351e14a7..21166c1253f844556090dba873c4619c82d16d47 100644 (file)
@@ -100,7 +100,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                $data = substr($data, 0, -1);
 
                // And update seek position
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->updateSeekPosition() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->updateSeekPosition() ...');
                $this->getIteratorInstance()->getBinaryFileInstance()->updateSeekPosition();
 
                /*
@@ -112,7 +112,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                $header = explode(chr(BinaryFile::SEPARATOR_HEADER_DATA), $data);
 
                // Map numeric entries to associative (alpha-numeric) elements
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Calling ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header)));
                //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: header(%d)=%s', count($header), print_r($header, true)));
                $header = ArrayUtils::mapNumericKeysToAssociative($header, [
                        BinaryFile::HEADER_NAME_MAGIC,
@@ -165,7 +165,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                );
 
                // Write it to disk (header is always at seek position 0)
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->writeAtPosition(0, header=%s) ...', $header));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(0, header=%s) ...', $header));
                $this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition(0, $header);
 
                // Trace message
@@ -203,7 +203,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                $this->getIteratorInstance()->getBinaryFileInstance()->setHeaderSize($headerSize);
 
                // Init counters and gaps array
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->initCountersGapsArray() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->initCountersGapsArray() ...');
                $this->getIteratorInstance()->getBinaryFileInstance()->initCountersGapsArray();
 
                // Default is not created
@@ -212,11 +212,11 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                // Is the file's header initialized?
                if (!$this->getIteratorInstance()->getBinaryFileInstance()->isFileHeaderInitialized()) {
                        // First pre-allocate a bit
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->preAllocateFile(index) ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->preAllocateFile(index) ...');
                        $this->getIteratorInstance()->getBinaryFileInstance()->preAllocateFile('index');
 
                        // Then write file header
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->createFileHeader() ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->createFileHeader() ...');
                        $this->getIteratorInstance()->getBinaryFileInstance()->createFileHeader();
 
                        // Mark as freshly created
@@ -224,14 +224,14 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                }
 
                // Load the file header
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->readIndexHeader() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->readIndexHeader() ...');
                $this->readIndexHeader();
 
                // Freshly created?
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: created=%d', intval($created)));
                if (!$created) {
                        // Analyze file structure
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->analyzeFileStructure() ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->analyzeFileStructure() ...');
                        $this->getIteratorInstance()->getBinaryFileInstance()->analyzeFileStructure();
                }
 
@@ -320,7 +320,7 @@ abstract class BaseFileIndex extends BaseIndex implements FileIndexer {
                }
 
                // Call iterated object's method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Calling this->iteratorInstance->binaryFileInstance->writeAtPosition(%d, %s) ...', $seekPosition, $dataStream));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeAtPosition(%d, %s) ...', $seekPosition, $dataStream));
                $status = $this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition($seekPosition, $dataStream);
 
                // Return status
index 6cf2742f9e024179751b7ef1dfe750b201d89eea..621508d0380461b4493abef3bc8f535087ce16fd 100644 (file)
@@ -109,7 +109,7 @@ class FileStackIndex extends BaseFileIndex implements IndexableStack, Registerab
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,rawData(%d)=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), strlen($rawData), $rawData));
 
                // Search for next free gap
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Calling this->iteratorInstance->binaryFileInstance->searchNextGap(%d) ...', strlen($rawData)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->searchNextGap(%d) ...', strlen($rawData)));
                $gapPosition = $this->getIteratorInstance()->getBinaryFileInstance()->searchNextGap(strlen($rawData));
 
                // Gap position cannot be smaller or equal than header length
@@ -120,7 +120,7 @@ class FileStackIndex extends BaseFileIndex implements IndexableStack, Registerab
                }
 
                // Then write the data at that gap
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Calling this->iteratorInstance->binaryFileInstance->writeData(%d,%s) ...', $gapPosition, $rawData));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: Invoking this->iteratorInstance->binaryFileInstance->writeData(%d,%s) ...', $gapPosition, $rawData));
                $this->getIteratorInstance()->getBinaryFileInstance()->writeData($gapPosition, $rawData);
 
                // Trace message
index 6526f0a46aaf7d61bb730cb168d55ea847c5ccca..3480ddb7b616f8a9c3ec0f2384f3ab03d4c700fd 100644 (file)
@@ -102,7 +102,7 @@ abstract class BaseStacker extends BaseFrameworkSystem {
                // "Walk" through all (more will be added as needed
                foreach ($stacks as $stackerName) {
                        // Init this stack
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Calling this->initStack(%s,%d) ...', $stackerName, intval($forceReInit)));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Invoking this->initStack(%s,%d) ...', $stackerName, intval($forceReInit)));
                        $this->initStack($stackerName, $forceReInit);
                }
 
index 32574ee72f306e66ac75ad5aad5b254bb88565be..cf590a76e9b959a0ed614045ca42bb5e2514ba58 100644 (file)
@@ -72,10 +72,13 @@ class FiFoStacker extends BaseStacker implements Stackable {
                if (empty($stackerName)) {
                        // No empty stack name
                        throw new InvalidArgumentException('Parameter "stackerName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+               } elseif (is_resource($value) || is_array($value) || is_object($value)) {
+                       // Unsupported variable type
+                       throw new InvalidArgumentException(sprintf('value[]=%s is not supported', gettype($value)), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
                }
 
                // Call the protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Calling parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Invoking parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
                parent::addValueToStack($stackerName, $value);
 
                // Trace message
@@ -100,11 +103,11 @@ class FiFoStacker extends BaseStacker implements Stackable {
                }
 
                // Get the value
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Calling this->getNamed(%s) ...', $stackerName));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Invoking this->getNamed(%s) ...', $stackerName));
                $value = $this->getNamed($stackerName);
 
                // Call the protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Calling parent::popFirst(%s) ...', $stackerName));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Invoking parent::popFirst(%s) ...', $stackerName));
                parent::popFirst($stackerName);
 
                // Return the value
@@ -130,7 +133,7 @@ class FiFoStacker extends BaseStacker implements Stackable {
                }
 
                // Call the protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Calling parent::getFirstValue(%s) ...', $stackerName));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-STACKER: Invoking parent::getFirstValue(%s) ...', $stackerName));
                $value = parent::getFirstValue($stackerName);
 
                // Return value
index e5f1ce72c1e1369b57f5510dba0b93b6dafa395b..4eb594316daa753a95cb3421e1657c90873620ee 100644 (file)
@@ -115,7 +115,7 @@ abstract class BaseFileStack extends BaseStacker {
                $data = substr($data, 0, -1);
 
                // And update seek position
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->iteratorInstance->binaryFileInstance->updateSeekPosition() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->iteratorInstance->binaryFileInstance->updateSeekPosition() ...');
                $this->getIteratorInstance()->getBinaryFileInstance()->updateSeekPosition();
 
                /*
@@ -128,7 +128,7 @@ abstract class BaseFileStack extends BaseStacker {
                $header = explode(chr(BinaryFile::SEPARATOR_HEADER_DATA), $data);
 
                // Map numeric indexes to associative indexes
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Calling ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Invoking ArrayUtils::mapNumericKeysToAssociative(%d) ...', count($header)));
                $header = ArrayUtils::mapNumericKeysToAssociative($header, [
                        BinaryFile::HEADER_NAME_MAGIC,
                        BinaryFile::HEADER_NAME_TOTAL_ENTRIES,
@@ -206,7 +206,7 @@ abstract class BaseFileStack extends BaseStacker {
                );
 
                // Write it to disk (header is always at seek position 0)
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Calling this->iteratorInstance->writeAtPosition(0, header=%s) ...', $header));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Invoking this->iteratorInstance->writeAtPosition(0, header=%s) ...', $header));
                $this->getIteratorInstance()->getBinaryFileInstance()->writeAtPosition(0, $header);
 
                // Trace message
@@ -254,7 +254,7 @@ abstract class BaseFileStack extends BaseStacker {
                $this->getIteratorInstance()->getBinaryFileInstance()->setHeaderSize($headerSize);
 
                // Init counters and gaps array
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->iteratorInstance->initCountersGapsArray() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->iteratorInstance->initCountersGapsArray() ...');
                $this->getIteratorInstance()->getBinaryFileInstance()->initCountersGapsArray();
 
                /*
@@ -271,7 +271,7 @@ abstract class BaseFileStack extends BaseStacker {
                // Is the file's header initialized?
                if (!$this->getIteratorInstance()->getBinaryFileInstance()->isFileHeaderInitialized()) {
                        // First pre-allocate a bit
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->iteratorInstance->preAllocateFile(file_stack) ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->iteratorInstance->preAllocateFile(file_stack) ...');
                        $this->getIteratorInstance()->getBinaryFileInstance()->preAllocateFile('file_stack');
 
                        // Then create file header
@@ -280,22 +280,22 @@ abstract class BaseFileStack extends BaseStacker {
                }
 
                // Load the file header
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->readStackHeader() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->readStackHeader() ...');
                $this->readStackHeader();
 
                // Is the index loaded correctly, e.g. the stack file is just created?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->indexInstance->isIndexLoaded() ...');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->indexInstance->isIndexLoaded() ...');
                if (!$this->getIndexInstance()->isIndexLoaded()) {
                        /*
                         * Something horrible has happened to the index as it should be
                         * loaded at this point. The stack's file structure then needs to
                         * be analyzed and the index rebuild.
                         */
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Calling this->iteratorInstance->analyzeFileStructure() ...');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Invoking this->iteratorInstance->analyzeFileStructure() ...');
                        $this->getIteratorInstance()->getBinaryFileInstance()->analyzeFileStructure();
 
                        // Rebuild index from file
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Calling this->iteratorInstance->rebuildIndexFromStack(%s) ...', $this->__toString()));
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Invoking this->iteratorInstance->rebuildIndexFromStack(%s) ...', $this->__toString()));
                        $this->getIndexInstance()->rebuildIndexFromStack($this);
                }
 
@@ -336,7 +336,7 @@ abstract class BaseFileStack extends BaseStacker {
 
                // Add the hash and gap position to the index
                //* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: data=%s', print_r($data, true));
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Calling this->indexInstance->addHashedDataToIndex(%s,data()=%d) ...', $stackerName, count($data)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Invoking this->indexInstance->addHashedDataToIndex(%s,data()=%d) ...', $stackerName, count($data)));
                $this->getIndexInstance()->addHashedDataToIndex($stackerName, $data);
 
                // Trace message
index 15723e286ea7fd829b793b2335361c8191ba8634..30344ab8433d7854eab88f2a3f092b3c25c86cb0 100644 (file)
@@ -67,7 +67,7 @@ class FiFoFileStack extends BaseFileStack implements StackableFile, Calculatable
                $stackInstance = new FiFoFileStack();
 
                // Init this stack
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: Calling stackInstance->initFileStack([%s]=%s,%s) ...', get_class($fileInfoInstance), $fileInfoInstance, $type));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: Invoking stackInstance->initFileStack([%s]=%s,%s) ...', get_class($fileInfoInstance), $fileInfoInstance, $type));
                $stackInstance->initFileStack($fileInfoInstance, $type);
 
                // Return the prepared instance
@@ -96,7 +96,7 @@ class FiFoFileStack extends BaseFileStack implements StackableFile, Calculatable
                }
 
                // Call the protected method
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: Calling parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: Invoking parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
                parent::addValueToStack($stackerName, $value);
 
                // Trace message
index d27c1c200437451c85595b44d5f666b2ef7612d8..79db994417a977ba3bfd70ad76f41b536a570c2e 100644 (file)
@@ -74,7 +74,7 @@ class FiLoStacker extends BaseStacker implements Stackable {
                }
 
                // Call the protected method
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILO-FILE-STACK: Calling parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILO-FILE-STACK: Invoking parent::addValueToStack(%s,%s) ...', $stackerName, gettype($value)));
                parent::addValueToStack($stackerName, $value);
 
                // Trace message
index 023ba4b6a793d8d54ad6d4cebf9b47984c8d9de5..4b6514d341f7a99cdce81a0527a3a76550e15d90 100644 (file)
@@ -307,7 +307,7 @@ abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
                $frontendInstance = ObjectFactory::createObjectByConfiguredName('user_db_frontend_class');
 
                // Get the primary key back from the frontend
-               $primaryKey = $frontendInstance->getPrimaryKeyValue();
+               $primaryKey = $frontendInstance->generatePrimaryKey();
 
                // Get that field
                $primaryValue = $this->getField($primaryKey);
index aa3a625ea84ca6269ba5af6bf4bb8c36b62be86b..3303a4d709dd7851e59c8584b89eacfed113fe41 100644 (file)
@@ -63,11 +63,11 @@ interface DatabaseFrontend extends FrameworkInterface {
        function doSelectCountByCriteria (Criteria $criteriaInstance, array $onlyKeys = []);
 
        /**
-        * Getter for primary key used in wrapped table
+        * Generates primary key for this database frontend
         *
         * @return      $primaryKey             Primary key used in wrapped table
         */
-       function getPrimaryKeyValue ();
+       function generatePrimaryKey ();
 
        /**
         * Counts total rows of this table
index 1f99803dce2bd766570020a3aab1b527a6b225a7..77aa81cdbdaf9f20c901a67ddb6e625e9bbb6383 100644 (file)
@@ -240,7 +240,7 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
                $this->backendInstance->connectToDatabase();
 
                // Call database backend
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DB-CONNECTION[' . $this->__toString() . ']: Calling this->backendInstance->removeNonPublicDataFromArray(data) ...');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DB-CONNECTION[' . $this->__toString() . ']: Invoking this->backendInstance->removeNonPublicDataFromArray(data) ...');
                $data = $this->backendInstance->removeNonPublicDataFromArray($data);
 
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DB-CONNECTION[' . $this->__toString() . ']: data[]=' . gettype($data));