public function unserialize($data)
{
$data = @unserialize($data);
if (!is_array($data) || !isset($data[0]) || $data[0] != self::VERSION) {
switch ($data[0]) {
case 1:
$convert = new Horde_Mime_Part_Upgrade_V1($data);
$data = $convert->data;
break;
default:
$data = null;
break;
}
if (is_null($data)) {
throw new Exception('Cache version change');
}
}
$key = 0;
$this->_bytes = $data[++$key];
$this->_eol = $data[++$key];
$this->_hdrCharset = $data[++$key];
$this->_headers = $data[++$key];
$this->_metadata = $data[++$key];
$this->_mimeid = $data[++$key];
$this->_parts = $data[++$key];
$this->_status = $data[++$key];
$this->_transferEncoding = $data[++$key];
if (isset($data[++$key])) {
$this->setContents($data[$key]);
}
}