forked from sag/php-serialize
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
34 lines (21 loc) · 1006 Bytes
/
README
File metadata and controls
34 lines (21 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Ruby PHP Serializer
===================
This module provides two methods: PHP.serialize() and PHP.unserialize(), both
of which should be compatible with the similarly named functions in PHP.
Basic usage:
require 'php_serialize'
in = {'foo' => 'bar'}
php = PHP.serialize(in)
# pass string to PHP unserialize() to get array('foo' => 'bar')
out = PHP.unserialize(php) # => {'foo' => 'bar'}
PHP.unserialize can also read PHP sessions, which are collections of named
serialized objects. These can be reserialized using PHP.serialize_session(),
which has the same semantics as PHP.serialize(), but which only supports
Hash and associative Arrays for the root object.
Acknowledgements
================
TJ Vanderpoel, initial PHP serialized session support.
Philip Hallstrom, fix for self-generated Structs on unserialization.
Edward Speyer, fix for assoc serialization in nested structures.
Author: Thomas Hurst <tom@hur.st>, http://hur.st/
WWW: http://www.aagh.net/projects/ruby-php-serialize