// Read the file
$dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, TRUE));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, TRUE));
// Is this an array?
if (is_array($dataArray)) {
// Search in the criteria with FMFW (First Matches, First Wins)
foreach ($dataArray as $key => $value) {
+ // Make sure value is not bool
+ assert(!is_bool($value));
+
// Found one entry?
$isFound = (($isFound === TRUE) && ($searchInstance->isCriteriaMatching($key, $value)));
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: key=' . $key . ',value=' . $value . ',isFound=' . intval($isFound));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: key=' . $key . ',value=' . $value . ',isFound=' . intval($isFound));
} // END - foreach
// Is all found?
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: isFound=' . intval($isFound) . ',limitFound=' . $limitFound . ',limit=' . $searchInstance->getLimit());
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: isFound=' . intval($isFound) . ',limitFound=' . $limitFound . ',limit=' . $searchInstance->getLimit());
if ($isFound === TRUE) {
// Shall we skip this entry?
if ($searchInstance->getSkip() > 0) {
// Search in the criteria with FMFW (First Matches, First Wins)
foreach ($dataArray as $key => $value) {
+ // Make sure value is not bool
+ assert(!is_bool($value));
+
// Found one entry?
$isFound = (($isFound === TRUE) && ($searchInstance->isCriteriaMatching($key, $value)));
} // END - foreach
// Entry found, so update it
foreach ($searchArray as $searchKey => $searchValue) {
+ // Make sure the value is not bool again
+ assert(!is_bool($searchValue));
+
+ // Debug message + add/update it
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: criteriaKey=' . $searchKey . ',criteriaValue=' . $searchValue);
$dataArray[$searchKey] = $searchValue;
} // END - foreach