diff --git a/.gitignore b/.gitignore index 4e78ae36..433789ff 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .cache .project .settings +.vscode nbproject/ *~ .#* diff --git a/lib/Horde/Imap/Client/Base.php b/lib/Horde/Imap/Client/Base.php index 6f20a46e..f6eb80ee 100644 --- a/lib/Horde/Imap/Client/Base.php +++ b/lib/Horde/Imap/Client/Base.php @@ -402,30 +402,6 @@ public function __unserialize(array $data) $this->_initOb(); } - /** - * @return array - */ - public function __serialize() - { - return array( - 'i' => $this->_init, - 'p' => $this->_params, - 'v' => self::VERSION - ); - } - - public function __unserialize(array $data) - { - if (empty($data['v']) || $data['v'] != self::VERSION) { - throw new Exception('Cache version change'); - } - - $this->_init = $data['i']; - $this->_params = $data['p']; - - $this->_initOb(); - } - /** */ public function __get($name) diff --git a/lib/Horde/Imap/Client/Data/Acl.php b/lib/Horde/Imap/Client/Data/Acl.php index bfd6455d..dd71c9fe 100644 --- a/lib/Horde/Imap/Client/Data/Acl.php +++ b/lib/Horde/Imap/Client/Data/Acl.php @@ -170,22 +170,7 @@ public function unserialize($data) $this->__unserialize($data); } - /** - * @return array - */ - public function __serialize() - { - return array( - 'rights' => $this->_rights - ); - } - - public function __unserialize(array $data) - { - $this->_rights = $data['rights']; - } - - /** + /** * @return array */ public function __serialize() diff --git a/lib/Horde/Imap/Client/Data/AclRights.php b/lib/Horde/Imap/Client/Data/AclRights.php index 0eb1fa69..3a5e3b25 100644 --- a/lib/Horde/Imap/Client/Data/AclRights.php +++ b/lib/Horde/Imap/Client/Data/AclRights.php @@ -215,19 +215,6 @@ public function unserialize($data) $this->__unserialize($data); } - /** - * @return array - */ - public function __serialize() - { - return [$this->_required, $this->_optional]; - } - - public function __unserialize(array $data) - { - list($this->_required, $this->_optional) = $data; - } - /** * @return array */ diff --git a/lib/Horde/Imap/Client/Data/Capability.php b/lib/Horde/Imap/Client/Data/Capability.php index d13fa278..c1e18eb3 100644 --- a/lib/Horde/Imap/Client/Data/Capability.php +++ b/lib/Horde/Imap/Client/Data/Capability.php @@ -215,20 +215,7 @@ public function unserialize($data) if (!is_array($data)) { throw new Exception('Cache version change.'); } - $this->__unserialize(); - } - - /** - * @return array - */ - public function __serialize() - { - return $this->_data; - } - - public function __unserialize(array $data) - { - $this->_data = $data; + $this->__unserialize($data); } /** diff --git a/lib/Horde/Imap/Client/Data/Envelope.php b/lib/Horde/Imap/Client/Data/Envelope.php index cbec4dfb..098b2e4d 100644 --- a/lib/Horde/Imap/Client/Data/Envelope.php +++ b/lib/Horde/Imap/Client/Data/Envelope.php @@ -235,24 +235,4 @@ public function __unserialize(array $data) $this->_data = $data['d']; } - /** - * @return array - */ - public function __serialize() - { - return array( - 'd' => $this->_data, - 'v' => self::VERSION, - ); - } - - public function __unserialize(array $data) - { - if (empty($data['v']) || $data['v'] != self::VERSION) { - throw new Exception('Cache version change'); - } - - $this->_data = $data['d']; - } - } diff --git a/lib/Horde/Imap/Client/Data/Namespace.php b/lib/Horde/Imap/Client/Data/Namespace.php index fdce7c3a..61e3f35f 100644 --- a/lib/Horde/Imap/Client/Data/Namespace.php +++ b/lib/Horde/Imap/Client/Data/Namespace.php @@ -157,17 +157,4 @@ public function __unserialize(array $data) $this->_data = $data; } - /** - * @return array - */ - public function __serialize() - { - return $this->_data; - } - - public function __unserialize(array $data) - { - $this->_data = $data; - } - } diff --git a/lib/Horde/Imap/Client/Data/SearchCharset.php b/lib/Horde/Imap/Client/Data/SearchCharset.php index f542e7f8..181c285f 100644 --- a/lib/Horde/Imap/Client/Data/SearchCharset.php +++ b/lib/Horde/Imap/Client/Data/SearchCharset.php @@ -195,17 +195,4 @@ public function __unserialize(array $data) $this->_charsets = $data; } - /** - * @return array - */ - public function __serialize() - { - return $this->_charsets; - } - - public function __unserialize(array $data) - { - $this->_charsets = $data; - } - } diff --git a/lib/Horde/Imap/Client/Data/Thread.php b/lib/Horde/Imap/Client/Data/Thread.php index 4e204a79..69fc6c48 100644 --- a/lib/Horde/Imap/Client/Data/Thread.php +++ b/lib/Horde/Imap/Client/Data/Thread.php @@ -197,19 +197,6 @@ public function unserialize($data) $this->__unserialize($data); } - /** - * @return array - */ - public function __serialize() - { - return [$this->_thread, $this->_type]; - } - - public function __unserialize(array $data) - { - list($this->_thread, $this->_type) = $data; - } - /** * @return array */ diff --git a/lib/Horde/Imap/Client/Ids.php b/lib/Horde/Imap/Client/Ids.php index 2bd4350d..b75eeba3 100644 --- a/lib/Horde/Imap/Client/Ids.php +++ b/lib/Horde/Imap/Client/Ids.php @@ -450,64 +450,6 @@ public function unserialize($data) $this->__unserialize($data); } - /** - */ - public function __serialize() - { - $save = array(); - - if ($this->duplicates) { - $save['d'] = 1; - } - - if ($this->_sequence) { - $save['s'] = 1; - } - - if ($this->_sorted) { - $save['is'] = 1; - } - - switch ($this->_ids) { - case self::ALL: - $save['a'] = true; - break; - - case self::LARGEST: - $save['l'] = true; - break; - - case self::SEARCH_RES: - $save['sr'] = true; - break; - - default: - $save['i'] = strval($this); - break; - } - - return $save; - } - - /** - */ - public function __unserialize($data) - { - $this->duplicates = !empty($data['d']); - $this->_sequence = !empty($data['s']); - $this->_sorted = !empty($data['is']); - - if (isset($data['a'])) { - $this->_ids = self::ALL; - } elseif (isset($data['l'])) { - $this->_ids = self::LARGEST; - } elseif (isset($data['sr'])) { - $this->_ids = self::SEARCH_RES; - } elseif (isset($data['i'])) { - $this->add($data['i']); - } - } - /** * @return array */ diff --git a/lib/Horde/Imap/Client/Ids/Map.php b/lib/Horde/Imap/Client/Ids/Map.php index 46ff201a..675c477d 100644 --- a/lib/Horde/Imap/Client/Ids/Map.php +++ b/lib/Horde/Imap/Client/Ids/Map.php @@ -228,31 +228,6 @@ public function unserialize($data) $this->__unserialize($data); } - /** - */ - public function __serialize() - { - /* Sort before storing; provides more compressible representation. */ - $this->sort(); - - return [ - strval(new Horde_Imap_Client_Ids(array_keys($this->_ids))), - strval(new Horde_Imap_Client_Ids(array_values($this->_ids))) - ]; - } - - /** - */ - public function __unserialize($data) - { - $keys = new Horde_Imap_Client_Ids($data[0]); - $vals = new Horde_Imap_Client_Ids($data[1]); - $this->_ids = array_combine($keys->ids, $vals->ids); - - /* Guaranteed to be sorted if unserializing. */ - $this->_sorted = true; - } - /** * @return array */ diff --git a/lib/Horde/Imap/Client/Mailbox.php b/lib/Horde/Imap/Client/Mailbox.php index d146002c..8f941753 100644 --- a/lib/Horde/Imap/Client/Mailbox.php +++ b/lib/Horde/Imap/Client/Mailbox.php @@ -148,19 +148,6 @@ public function unserialize($data) $this->__unserialize($data); } - /** - * @return array - */ - public function __serialize() - { - return [$this->_utf7imap, $this->_utf8]; - } - - public function __unserialize(array $data) - { - list($this->_utf7imap, $this->_utf8) = $data; - } - /** * @return array */ diff --git a/lib/Horde/Imap/Client/Search/Query.php b/lib/Horde/Imap/Client/Search/Query.php index b968d6ec..aa05eafa 100644 --- a/lib/Horde/Imap/Client/Search/Query.php +++ b/lib/Horde/Imap/Client/Search/Query.php @@ -874,47 +874,6 @@ public function unserialize($data) $this->__unserialize($data); } - /** - * Serialization. - * - * @return string Serialized data. - */ - public function __serialize() - { - $data = array( - // Serialized data ID. - self::VERSION, - $this->_search - ); - - if (!is_null($this->_charset)) { - $data[] = $this->_charset; - } - - return $data; - } - - /** - * Unserialization. - * - * @param string $data Serialized data. - * - * @throws Exception - */ - public function __unserialize($data) - { - if (!is_array($data) || - !isset($data[0]) || - ($data[0] != self::VERSION)) { - throw new Exception('Cache version change'); - } - - $this->_search = $data[1]; - if (isset($data[2])) { - $this->_charset = $data[2]; - } - } - /** * @return array */ diff --git a/lib/Horde/Imap/Client/Url.php b/lib/Horde/Imap/Client/Url.php index f27e0296..d0205275 100644 --- a/lib/Horde/Imap/Client/Url.php +++ b/lib/Horde/Imap/Client/Url.php @@ -303,19 +303,6 @@ public function unserialize($data) $this->__unserialize($data); } - /** - * @return array - */ - public function __serialize() - { - return array((string)$this); - } - - public function __unserialize(array $data) - { - $this->_parse($data[0]); - } - /** * @return array */ diff --git a/lib/Horde/Imap/Client/Url/Base.php b/lib/Horde/Imap/Client/Url/Base.php index 97c05bb3..d2a7fdad 100644 --- a/lib/Horde/Imap/Client/Url/Base.php +++ b/lib/Horde/Imap/Client/Url/Base.php @@ -174,19 +174,6 @@ public function unserialize($data) $this->__unserialize($data); } - /** - * @return array - */ - public function __serialize() - { - return array((string)$this); - } - - public function __unserialize(array $data) - { - $this->_parse($data[0]); - } - /** * @return array */