From 85fe3f2476cfda01bedb9240efe5784792d78d60 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 17 Feb 2023 21:06:03 +0100 Subject: [PATCH] Continued: - arrays can be serialized and stored in files (ops) - added debug line --- .../classes/file_directories/binary/stack/class_StackFile.php | 2 +- framework/main/classes/stacker/file/class_BaseFileStack.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/main/classes/file_directories/binary/stack/class_StackFile.php b/framework/main/classes/file_directories/binary/stack/class_StackFile.php index 5d3f4c94..460d236e 100644 --- a/framework/main/classes/file_directories/binary/stack/class_StackFile.php +++ b/framework/main/classes/file_directories/binary/stack/class_StackFile.php @@ -208,7 +208,7 @@ class StackFile extends BaseBinaryFile implements FileStacker { if (empty($stackName)) { // Throw IAE throw new InvalidArgumentException('Parameter "stackName" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT); - } elseif (is_array($value) || is_object($value) || is_resource($value)) { + } elseif (is_object($value) || is_resource($value)) { // Not wanted here throw new InvalidArgumentException(sprintf('value[]=%s is not stackable in files', gettype($value))); } diff --git a/framework/main/classes/stacker/file/class_BaseFileStack.php b/framework/main/classes/stacker/file/class_BaseFileStack.php index 4eb59431..c36b1e96 100644 --- a/framework/main/classes/stacker/file/class_BaseFileStack.php +++ b/framework/main/classes/stacker/file/class_BaseFileStack.php @@ -332,6 +332,7 @@ abstract class BaseFileStack extends BaseStacker { * Now add the value to the file stack which returns gap position, a * hash and length of the raw data. */ + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-STACK: Invoking this->iteratorInstance->binaryFileInstance->writeValueToFile(%s,value[]=%s) ...', $stackerName, gettype($value))); $data = $this->getIteratorInstance()->getBinaryFileInstance()->writeValueToFile($stackerName, $value); // Add the hash and gap position to the index -- 2.39.5