forked from neoxic/php-amf3
-
Notifications
You must be signed in to change notification settings - Fork 0
PHP AMF3 extension
License
HeyRatFans/php-amf3
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
AMF3 encoding/decoding extension for PHP ======================================== Description ----------- The PHP AMF3 extension provides two functions to use in PHP scripts: string amf3_encode(mixed $value [, $options = 0 ]) - Encodes $value into an AMF3 byte-stream. - On success, returns an AMF3 representation of the value. - On error, returns FALSE and issues a warning message (the only error case is wrong argument count). - The $options argument is a bitmask of options. The following bit constants are available in a PHP script: AMF3_FORCE_OBJECT Force encoding non-indexed arrays as anonymous objects. mixed amf3_decode(string $amf3 [, int &$count [, $options = 0 ]]) - Decodes $amf3 (AMF3 byte-stream) into a PHP value. - On success, returns a resulting PHP value. - On error, returns NULL and issues a warning message. - If $count is provided, the number of bytes actually read from the string will be stored in it (the value of -1 indicates an error). - The $options argument is a bitmask of options. The following bit constants are available in a PHP script: AMF3_CLASS_MAP Enable class mapping (see the usage constrains below). AMF3_CLASS_AUTOLOAD Enable the PHP class autoloading mechanism in the class mapping mode. AMF3_CLASS_CONSTRUCT Call the default constructor of a decoded object's class in the class mapping mode. WARNING! Class mapping should be used with great care since it can potentially lead to a breach in security. Installation ------------ To install the extension, type the following in the source directory: phpize ./configure make make install This should install the extension to your default PHP extension directory. If it doesn't work as expected, manually put the target amf3.so library to what the 'extension_dir' variable in your php.ini points to. Add the following line to the corresponding extension section in your php.ini: extension=amf3.so To run tests, type: make test Usage constraints ----------------- - PHP NULL, boolean, integer, float (double), string, array, and object values are fully convertible back and forth to their corresponding AMF3 types. - AMF3 Date becomes a float value whereas XML, XMLDocument, and ByteArray become strings. - In a special case, PHP integers are converted into AMF3 doubles according to the specification (see the link below). - A PHP array is encoded as an indexed array when it has ascending integer keys that start with zero and have no gaps. An empty array adheres to this rule. In all other cases, an array is considered non-indexed and encoded as a purely associative array to avoid ambiguity. - When class mapping is disabled (the default), AMF3 objects are returned as associative arrays; otherwise, they are returned as objects. Links ----- Project homepage: http://neoxic.me/php-amf3/ Official Adobe AMF3 specification: http://www.adobe.com/go/amfspec History ------- Version 1.2.3 [2014-10-19] + Support for previously unsupported AMF3 types + Error reporting fixes Version 1.2.2 [2013-08-31] + Minor error reporting fixes Version 1.2.1 [2013-03-18] + Important security fixes + Minor fixes (build files, tests, README) Version 1.2.0 [2013-03-03] + Option to force encoding non-dense arrays as anonymous objects. + Option to perform automatic class mapping in the decoder. Version 1.1.0 [2013-02-20] + Support for previously unsupported AMF3 types. + Major code revision. + License changed from GPL to MIT. Version 1.0.0 [2010-02-03] + Encoding/decoding of basic PHP/AMF3 values.
About
PHP AMF3 extension
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published
Languages
- C 81.4%
- PHP 18.6%