From dd8c280eca44d95378f91118fce54025dd32077f Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 24 Nov 2010 14:44:16 -0700 Subject: [PATCH] JSON encode prefs scope object when serializing. Another advantage of requiring UTF-8 input to prefs - JSON encoding provides ~12% storage advantage (in my limited testing) over serialize(). --- framework/Prefs/lib/Horde/Prefs/Scope.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/Prefs/lib/Horde/Prefs/Scope.php b/framework/Prefs/lib/Horde/Prefs/Scope.php index 0bf1c2756..8a9359fd1 100644 --- a/framework/Prefs/lib/Horde/Prefs/Scope.php +++ b/framework/Prefs/lib/Horde/Prefs/Scope.php @@ -255,7 +255,7 @@ class Horde_Prefs_Scope implements Serializable */ public function serialize() { - return serialize(array( + return json_encode(array( $this->scope, $this->_prefs )); @@ -265,7 +265,7 @@ class Horde_Prefs_Scope implements Serializable */ public function unserialize($data) { - list($this->scope, $this->_prefs) = unserialize($data); + list($this->scope, $this->_prefs) = json_decode($data, true); } } -- 2.11.0