Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Storable: :freeze: Can php thaw?

by bv (Friar)
on Oct 17, 2009 at 17:49 UTC ( #801774=note: print w/replies, xml ) Need Help??


in reply to Storable: :freeze: Can php thaw?

Google Says both no and yes. General consensus is that you should pick a more portable storage method such as YAML or JSON, but this guy claims to have written a PHP version of the Storable interface. Not sure whether it will actually work, but it's a place to start

print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))

Replies are listed 'Best First'.
Re^2: Storable: :freeze: Can php thaw?
by cormanaz (Chaplain) on Oct 17, 2009 at 21:00 UTC
    Well I investigated this. It only has store and retrieve methods (i.e. for data serialized to file) not freeze/thaw. I did not test the retrieve function, but it looks pretty straightforward--it parses the file and uses a php unserialize function to put it back into a data structure.

    I tried to see if I could feed the frozen object to that function, because I suppose in principle that out to work. Unfortunately it expects a string and the frozen object is binary, and I'm not enough of a php wizzard to figure out how to decode it two bytes at a time to a string--if that's even possible.

Re^2: Storable: :freeze: Can php thaw?
by cormanaz (Chaplain) on Oct 17, 2009 at 18:25 UTC
    Thanks bv. Yeah it would be better to use YAML or JSON but unfortunately the data already exists in Storable.

    I looked around on Google before I posted here, don't know how I missed that one.

    I will update once I find out if it works.

Re^2: Storable: :freeze: Can php thaw?
by stonecolddevin (Parson) on Oct 17, 2009 at 21:47 UTC

    JSON/YAML route ftw on this I think. Human readable and it's well supported on each end.

    mtfnpy

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://801774]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2019-12-12 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?