Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php defined('SYSPATH') or die('No direct script access.');
- /**
- *
- * RPC Object Module for Kohana 3.2
- * JSON RPC Object that allows us to serialize and deserialize JSON data
- *
- * @author bagnz0r (http://bagnohax.pl)
- * @package RpcObject
- *
- */
- class RpcJson implements RpcObject {
- /**
- * A variable to hold our object (all the data and deserialized data)
- * @var object
- */
- public $data;
- /**
- * (non-PHPdoc)
- * @see RpcObject::getSerialized()
- */
- public function getSerialized()
- {
- return json_encode($data);
- }
- /**
- * (non-PHPdoc)
- * @see RpcObject::deserializeString()
- */
- public function deserializeString($string)
- {
- $this->data = (object)json_decode($string, true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement