All Projects → neoxic → php-amf3

neoxic / php-amf3

Licence: other
PHP AMF3 extension

Programming Languages

c
50402 projects - #5 most used programming language
PHP
23972 projects - #3 most used programming language
M4
1887 projects

Projects that are alternatives of or similar to php-amf3

php-rar
PECL rar extension
Stars: ✭ 35 (-35.19%)
Mutual labels:  php8
php-mime-detector
Detect a file's mime type using magic numbers.
Stars: ✭ 20 (-62.96%)
Mutual labels:  php8
WCMP
WCMP是基于Windows x64平台下的Caddy2 + PHP + MySQL便携软件包。
Stars: ✭ 17 (-68.52%)
Mutual labels:  php8
SimplePets
🐕‍🦺 An Ultimate Pets plugin for PocketMine-MP.
Stars: ✭ 20 (-62.96%)
Mutual labels:  php8
oas
ระบบบัญชีออนไลน์ Online Accounting System (OAS)
Stars: ✭ 51 (-5.56%)
Mutual labels:  php8
engine
A pragmatic approach to templating for PHP 7.x+
Stars: ✭ 31 (-42.59%)
Mutual labels:  php8
php-simple-benchmark-script
Очень простой скрипт тестирования быстродействия PHP | Very simple script for testing of PHP operations speed (rusoft repo mirror)
Stars: ✭ 50 (-7.41%)
Mutual labels:  php8
vin
Simple VIN decoder for PHP 7.1+ (incl. PHP 8) based on ISO-3779
Stars: ✭ 39 (-27.78%)
Mutual labels:  php8
ResidenceCMS
Open Source Property Management System based on Symfony 6
Stars: ✭ 75 (+38.89%)
Mutual labels:  php8
lua-amf3
AMF3 encoding/decoding module for Lua
Stars: ✭ 32 (-40.74%)
Mutual labels:  amf3
framework
FEAST Framework
Stars: ✭ 66 (+22.22%)
Mutual labels:  php8
database
Aplus Framework Database Library
Stars: ✭ 147 (+172.22%)
Mutual labels:  php8
php-json-schema-model-generator
Creates (immutable) PHP model classes from JSON-Schema files including all validation rules as PHP code
Stars: ✭ 36 (-33.33%)
Mutual labels:  php8
email
Aplus Framework Email Library
Stars: ✭ 127 (+135.19%)
Mutual labels:  php8
php-design-patterns
Learn how to implement the most important Design Patterns into your PHP application. This project uses PHP 8.1. it has examples for each Pattern and an Article explaining how to use them step by step, their advantages, and disadvantages.
Stars: ✭ 151 (+179.63%)
Mutual labels:  php8
pthreads
Fork of https://github.com/krakjoe/pthreads with various improvements, including PHP 7.4+ support
Stars: ✭ 45 (-16.67%)
Mutual labels:  php8
validation
Aplus Framework Validation Library
Stars: ✭ 99 (+83.33%)
Mutual labels:  php8
livego
直播服务器 hls stream online RTMP AMF HLS HTTP-FLV
Stars: ✭ 30 (-44.44%)
Mutual labels:  amf
booking
PHP Room meeting script โปรแกรมจองห้องประชุม PHP
Stars: ✭ 18 (-66.67%)
Mutual labels:  php8
cli
Aplus Framework CLI Library
Stars: ✭ 104 (+92.59%)
Mutual labels:  php8

AMF3 encoding/decoding extension for PHP

PHP-AMF3 extension provides the following API:

amf3_encode(mixed $value [, int $opts = 0 ])

Returns a binary string containing an AMF3 representation of $value. On error, returns FALSE and issues a warning message. The $opts argument is a bitmask of the following bit constants:

  • AMF3_FORCE_OBJECT: force encoding non-indexed arrays as anonymous objects;

Objects implementing AMF3Serializable interface can customize their AMF3 representation:

class MyClass implements AMF3Serializable {
    ...
    public function __toAMF3() {
        return [
            'foo' => $this->getFoo(),
            'bar' => $this->bar,
        ];
    }
}

amf3_decode(string $data [, int &$pos [, int $opts = 0 ]])

Returns the value encoded in $data. Optional $pos marks where to start reading in $data (default is 0). Upon return, it contains the index of the first unread byte (-1 indicates an error). The $opts argument is a bitmask of the following bit constants:

  • AMF3_CLASS_MAP: enable class mapping mode (see the usage constrains below);
  • AMF3_CLASS_AUTOLOAD: enable the PHP class autoloading mechanism in class mapping mode;
  • AMF3_CLASS_CONSTRUCT: call the default constructor for every new object in class mapping mode;

Installation

To install the extension, type the following in the source directory:

phpize
./configure
make
make install

This should install the extension in your default PHP extension directory. If it doesn't work as expected, manually put the target amf3.so library where the extension_dir variable in your php.ini points to. Add the following line to the corresponding 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 to/from 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 to AMF3 doubles according to the specification.
  • A PHP array is encoded as an indexed array when it has purely integer keys that start from zero and have no gaps. An empty array adheres to this rule. In all other cases, an array is encoded as as associative array to avoid ambiguity.
  • When class mapping is disabled (the default), AMF3 objects are returned as associative PHP arrays. Otherwise, they are returned as PHP objects.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].