I must admit that I do not have a clue what you're trying to do (perhaps due to a lack of knowledge regarding Thrift and HBase), but if I understood your question correctly, you're trying to write some PHP data structure (array in this case) to a storage media. To achieve this you have to serialize your data somehow. That could be using a custom XML serialization, a custom binary serialization or, perhaps the most simple solution, the PHP internal serialization mechanism provided by serialize()
and the corresponding unserialize()
.
If you strive for inter-language-interoperability you should use a custom serialization or you have to write a unserialization function that unserializes the PHP serialization format in your target language.
Just a quick example - I don't know where you'd have to put this code, as I don't know exactly what you're doing:
$mutations = array(
new Mutation(array(
'column' => 'entry:num',
'value' => array('a','b','c')
)),
);
$data = serialize($mutations); // $data now is a string
// write $data to storage
// read $readData from storage
$readMutations = unserialize($readData);
// $readMutations == $mutations
// (but the Mutation instances are not the same instances any more)
Please seee