File: README

package info (click to toggle)
libphp-serialization-perl 0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 156 kB
  • sloc: perl: 387; makefile: 2
file content (90 lines) | stat: -rw-r--r-- 3,125 bytes parent folder | download | duplicates (2)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
NAME
    PHP::Serialization - simple flexible means of converting the output of
    PHP's serialize() into the equivalent Perl memory structure, and vice
    versa.

SYNOPSIS
        use PHP::Serialization qw(serialize unserialize);
        my $encoded = serialize({ a => 1, b => 2});
        my $hashref = unserialize($encoded);

DESCRIPTION
    Provides a simple, quick means of serializing perl memory structures
    (including object data!) into a format that PHP can deserialize() and
    access, and vice versa.

    NOTE: Converts PHP arrays into Perl Arrays when the PHP array used
    exclusively numeric indexes, and into Perl Hashes then the PHP array did
    not.

FUNCTIONS
    Exportable functions..

  serialize($var,[optional $asString,[optional $sortHashes]])
    Serializes the memory structure pointed to by $var, and returns a scalar
    value of encoded data.

    If the optional $asString is true, $var will be encoded as string if it
    is double or float.

    If the optional $sortHashes is true, all hashes will be sorted before
    serialization.

    NOTE: Will recursively encode objects, hashes, arrays, etc.

    SEE ALSO: ->encode()

  unserialize($encoded,[optional CLASS])
    Deserializes the encoded data in $encoded, and returns a value (be it a
    hashref, arrayref, scalar, etc) representing the data structure
    serialized in $encoded_string.

    If the optional CLASS is specified, any objects are blessed into
    CLASS::$serialized_class. Otherwise, O bjects are blessed into
    PHP::Serialization::Object::$serialized_class. (which has no methods)

    SEE ALSO: ->decode()

METHODS
    Functionality available if using the object interface..

  decode($encoded_string,[optional CLASS])
    Deserializes the encoded data in $encoded, and returns a value (be it a
    hashref, arrayref, scalar, etc) representing the data structure
    serialized in $encoded_string.

    If the optional CLASS is specified, any objects are blessed into
    CLASS::$serialized_class. Otherwise, Objects are blessed into
    PHP::Serialization::Object::$serialized_class. (which has no methods)

    SEE ALSO: unserialize()

  encode($reference,[optional $asString,[optional $sortHashes]])
    Serializes the memory structure pointed to by $reference, and returns a
    scalar value of encoded data.

    If the optional $asString is true, $reference will be encoded as string
    if it is double or float.

    If the optional $sortHashes is true, all hashes will be sorted before
    serialization.

    NOTE: Will recursively encode objects, hashes, arrays, etc.

    SEE ALSO: serialize()

TODO
    Support diffrent object types

AUTHOR INFORMATION
    Copyright (c) 2003 Jesse Brown <jbrown@cpan.org>. All rights reserved.
    This program is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

    Various patches contributed by assorted authors on rt.cpan.org (as
    detailed in Changes file).

    Currently maintained by Tomas Doran <bobtfish@bobtfish.net>.

    Rewritten to solve all known bugs by Bjørn-Olav Strand <bolav@cpan.org>