Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2020-02-18 01:18 GMT
Find Nodes?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?

    Results (74 votes). Check out past polls.