Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

php::serialization(3pm) [debian man page]

PHP::Serialization(3pm) 				User Contributed Perl Documentation				   PHP::Serialization(3pm)

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 BjA~Xrn-Olav Strand <bolav@cpan.org> perl v5.10.1 2010-03-18 PHP::Serialization(3pm)

Check Out this Related Man Page

Net::DNS::DomainName(3) 				User Contributed Perl Documentation				   Net::DNS::DomainName(3)

NAME
Net::DNS::DomainName - DNS domain name wire representation SYNOPSIS
use Net::DNS::DomainName; $object = new Net::DNS::DomainName('example.com'); $name = $object->name; $data = $object->encode; ( $object, $next ) = decode Net::DNS::DomainName( $data, $offset ); DESCRIPTION
The Net::DNS::DomainName module implements the concrete representation of DNS domain names used within DNS packets. Net::DNS::DomainName defines methods for encoding and decoding wire format octet strings as defined in RFC1035. All other behaviour, including the new() constructor, is inherited from Net::DNS::Domain. The Net::DNS::DomainName1035 and Net::DNS::DomainName2535 packages implement disjoint domain name subtypes which provide the name compression and canonicalisation specified by RFC1035 and RFC2535. These are necessary to meet the backward compatibility requirements introduced by RFC3597. METHODS
new $object = new Net::DNS::DomainName('example.com'); Creates a domain name object which identifies the domain specified by the character string argument. decode $object = decode Net::DNS::DomainName( $buffer, $offset, $hash ); ( $object, $next ) = decode Net::DNS::DomainName( $buffer, $offset, $hash ); Creates a domain name object which represents the DNS domain name identified by the wire-format data at the indicated offset within the data buffer. The argument list consists of a reference to a scalar containing the wire-format data and specified offset. The optional reference to a hash table provides improved efficiency of decoding compressed names by exploiting already cached compression pointers. The returned offset value indicates the start of the next item in the data buffer. encode $data = $object->encode; Returns the wire-format representation of the domain name suitable for inclusion in a DNS packet buffer. Net::DNS::DomainName1035 Net::DNS::DomainName1035 implements a subclass of domain name objects which are to be encoded using the compressed wire format defined in RFC1035. use Net::DNS::DomainName; $object = new Net::DNS::DomainName1035('compressible.example.com'); $data = $object->encode( $offset, $hash ); ( $object, $next ) = decode Net::DNS::DomainName1035( $data, $offset ); Note that RFC3597 implies that the RR types defined in RFC1035 section 3.3 are the only types eligible for compression. encode $data = $object->encode( $offset, $hash ); Returns the wire-format representation of the domain name suitable for inclusion in a DNS packet buffer. The optional arguments are the offset within the packet data where the domain name is to be stored and a reference to a hash table used to index compressed names within the packet. If the hash reference is undefined, encode() returns the lowercase uncompressed canonical representation defined in RFC2535(8.1). Net::DNS::DomainName2535 Net::DNS::DomainName2535 implements a subclass of domain name objects which are to be encoded using uncompressed wire format. Note that RFC3597, and latterly RFC4034, specifies that the lower case canonical encoding defined in RFC2535 is to be used for RR types defined prior to RFC3597. use Net::DNS::DomainName; $object = new Net::DNS::DomainName2535('incompressible.example.com'); $data = $object->encode( $offset, $hash ); ( $object, $next ) = decode Net::DNS::DomainName2535( $data, $offset ); encode $data = $object->encode( $offset, $hash ); Returns the uncompressed wire-format representation of the domain name suitable for inclusion in a DNS packet buffer. If the hash reference is undefined, encode() returns the lowercase canonical form defined in RFC2535(8.1). COPYRIGHT
Copyright (c)2009-2011 Dick Franks. All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
perl, Net::DNS, Net::DNS::Domain, RFC1035, RFC2535, RFC3597, RFC4034 perl v5.16.2 2012-01-27 Net::DNS::DomainName(3)
Man Page