diff --git a/common/framework/storage.php b/common/framework/storage.php index 5a88429c1..0ee1f1904 100644 --- a/common/framework/storage.php +++ b/common/framework/storage.php @@ -356,15 +356,24 @@ class Storage * @param string $filename * @param mixed $data * @param string $comment (optional) + * @param bool $serialize (optional) * @return string|false */ - public static function writePHPData($filename, $data, $comment = null) + public static function writePHPData($filename, $data, $comment = null, $serialize = true) { if ($comment !== null) { $comment = "/* $comment */\n"; } - return self::write($filename, '<' . '?php ' . $comment . 'return unserialize(' . var_export(serialize($data), true) . ');'); + if ($serialize) + { + $content = '<' . '?php ' . $comment . 'return unserialize(' . var_export(serialize($data), true) . ');'; + } + else + { + $content = '<' . '?php ' . $comment . 'return ' . var_export($data, true) . ';'; + } + return self::write($filename, $content); } /**