Rewrite continued:
[core.git] / framework / main / classes / database / backend / class_CachedLocalFileDatabase.php
index a2f65b40110774aa5a1b2b2bb312b0e2ec1ea9ac..2efa187e04662eb14b58a28baa2983aeab1a3f81 100644 (file)
@@ -58,7 +58,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
        /**
         * Whether the "connection is already up
         */
-       private $alreadyConnected = FALSE;
+       private $alreadyConnected = false;
 
        /**
         * Table information array
@@ -189,11 +189,11 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                $serializedData = $this->getCompressorChannel()->getCompressor()->decompressStream($compressedData);
 
                // Unserialize it
-               $dataArray = json_decode($serializedData, TRUE);
+               $dataArray = json_decode($serializedData, true);
 
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Read ' . count($dataArray) . ' elements from database file ' . $fqfn . '.');
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, true));
 
                // Finally return it
                return $dataArray;
@@ -209,7 +209,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
        private function writeDataArrayToFqfn ($fqfn, array $dataArray) {
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Flushing ' . count($dataArray) . ' elements to database file ' . $fqfn . ' ...');
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, true));
 
                // Serialize and compress it
                $compressedData = $this->getCompressorChannel()->getCompressor()->compressStream(json_encode($dataArray));
@@ -319,7 +319,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                $infoArray = $this->getContentsFromTableInfoFile($dataSetInstance);
 
                // Is the primary key there?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: tableInfo=' . print_r($this->tableInfo, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: tableInfo=' . print_r($this->tableInfo, true));
                if (!isset($this->tableInfo[$tableName]['primary'])) {
                        // Then create the info file
                        $this->createTableInfoFile($dataSetInstance);
@@ -393,12 +393,12 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
 
                                // Read the file
                                $dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, TRUE));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, true));
 
                                // Is this an array?
                                if (is_array($dataArray)) {
                                        // Default is nothing found
-                                       $isFound = TRUE;
+                                       $isFound = true;
 
                                        // Search in the criteria with FMFW (First Matches, First Wins)
                                        foreach ($dataArray as $key => $value) {
@@ -406,13 +406,13 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                                assert(!is_bool($value));
 
                                                // Found one entry?
-                                               $isFound = (($isFound === TRUE) && ($searchInstance->isCriteriaMatching($key, $value)));
+                                               $isFound = (($isFound === true) && ($searchInstance->isCriteriaMatching($key, $value)));
                                                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: key=' . $key . ',value=' . $value . ',isFound=' . intval($isFound));
                                        } // END - foreach
 
                                        // Is all found?
                                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: isFound=' . intval($isFound) . ',limitFound=' . $limitFound . ',limit=' . $searchInstance->getLimit());
-                                       if ($isFound === TRUE) {
+                                       if ($isFound === true) {
                                                // Shall we skip this entry?
                                                if ($searchInstance->getSkip() > 0) {
                                                        // We shall skip some entries
@@ -427,7 +427,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                                $dataArray[$this->getIndexKey()] = $idx;
 
                                                // Entry found!
-                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: indexKey=' . $this->getIndexKey() . ',idx=' . $idx . ',dataArray=' . print_r($dataArray, TRUE));
+                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: indexKey=' . $this->getIndexKey() . ',idx=' . $idx . ',dataArray=' . print_r($dataArray, true));
                                                array_push($resultData[BaseDatabaseBackend::RESULT_INDEX_ROWS], $dataArray);
 
                                                // Count found entries up
@@ -531,12 +531,12 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
 
                                // Open this file for reading
                                $dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, TRUE));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, true));
 
                                // Is this an array?
                                if (is_array($dataArray)) {
                                        // Default is nothing found
-                                       $isFound = TRUE;
+                                       $isFound = true;
 
                                        // Search in the criteria with FMFW (First Matches, First Wins)
                                        foreach ($dataArray as $key => $value) {
@@ -544,12 +544,12 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                                assert(!is_bool($value));
 
                                                // Found one entry?
-                                               $isFound = (($isFound === TRUE) && ($searchInstance->isCriteriaMatching($key, $value)));
+                                               $isFound = (($isFound === true) && ($searchInstance->isCriteriaMatching($key, $value)));
                                        } // END - foreach
 
                                        // Is all found?
                                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: isFound=' . intval($isFound));
-                                       if ($isFound === TRUE) {
+                                       if ($isFound === true) {
                                                // Shall we skip this entry?
                                                if ($searchInstance->getSkip() > 0) {
                                                        // We shall skip some entries
@@ -632,7 +632,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                unset($data[$this->indexKey]);
 
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: data[' . gettype($data) . ']='.print_r($data, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: data[' . gettype($data) . ']='.print_r($data, true));
                return $data;
        }