示例#1
0
文件: Amf3.php 项目: heiglandreas/zf2
 /**
  * Deserialize an AMF3 value to PHP
  * 
  * @param  mixed $value 
  * @param  array $opts 
  * @return string
  * @throws \Zend\Serializer\Exception
  */
 public function unserialize($value, array $opts = array())
 {
     try {
         $stream = new AMFParser\InputStream($value);
         $deserializer = new AMFParser\Amf3\Deserializer($stream);
         return $deserializer->readTypeMarker();
     } catch (\Exception $e) {
         throw new SerializationException('Unserialization failed by previous error', 0, $e);
     }
 }
示例#2
0
 /**
  * AMF3 data type encountered load AMF3 Deserializer to handle
  * type markers.
  *
  * @return string
  */
 public function readAmf3TypeMarker()
 {
     $deserializer = new Amf\Parser\Amf3\Deserializer($this->_stream);
     $this->_objectEncoding = Amf\Constants::AMF3_OBJECT_ENCODING;
     return $deserializer->readTypeMarker();
 }