AMFPHP 1.9 changes and future plans

Recently Patrick released a new testing version of AMFPHP which supports the Flex2 AMF3 object encoding.

Some changes:

$this->methodTable is DEAD. All methods in /services are now considered remotely accessible, unless you set them to protected or private (PHP5) or start the method name with an (_)
– Returning a mysql_query will now return either an Array or an ArrayCollection depending on the setting in gateway.php
– browser now brings up the brand spanking new Flex 2-based service browser

This is a testing version since it has still a lot of limitations and it has been tested only on PHP5. I see the post today and I haven’t tested yet…
You can read here for a detailed list of changes

Moreover Patrick plans to add to amfphp the Flex Data Services (read what they are). In this post he got a brief explanation about flash player/FDS communication and ask for developers to help him with the developement of FDS in amfphp (you might need a copy of charles).

AMFPHP 1.0 milestone 2 alpha

Today Patrick released a new milestone of amfphp: Chnages in this alpha release:

  • Added new methodTable option (per method) “fastArray” => true|false for fast array serializing on return (will only make a difference for large multidimensional nested voodoo arrays)
  • Added new method Headers::getHeader($key) available from all services, also HeadersFilter.php added
  • Added FrontBase support
  • Added Pear::db support
  • Added CSV-based recordsets support
  • Renamed sql folder to adapters to fit with the CSV recordsets
  • Various bugfixes for PHP4 MethodTable class
  • Major overhaul of service browser, should work much better now
  • New actionscript template system for service browser, see browser/templates/ for examples
  • Added new return type binary that will write the value as a string but without charsetHandling
  • Added new return type raw that will write to the output stream directly (careful)
  • SSL with ie hopefully works now

Some new methods included recently, which you can use in the gateway.php file (for production env): – disableStandalonePlayer() Disables the standalone player by filtering out its User-Agent string – disableServiceDescription() Disable service description from Macromedia’s service browser – disableTrace() Disables remote tracing – disableDebug() Stops debug info from being sent (independant of remote trace setting)

amfphp project page

AMFPHP, method table automation

Christophe Herreman created a very nice PHP class in order to automate the method table creation inside your AMFPHP class.
In this way, using his class, you can instead of writing every time you create a new PHP class, or just editing it, the code like:

$this->methodTable = array(
"getParkTypes" => array(
"description" => "Returns list of park types",
"access" => "remote",
"arguments" => array ("arg1")
),
"getParksList" => array(
"description" => "Shows list of parks given a park type",
"access" => "remote",
"arguments" => array ("parkType")
),
"getParkDetails" => array(
"description" => "Return details on a park give the parkname",
"access" => "remote",
"arguments" => array ("parkName")
)
);

You can just use this code:

require_once("MethodTable.php");
$this->methodTable = MethodTable::create($this);

The only problem for most of us is that this requires PHP5
Link: http://cherreman.blogspot.com/…automation.html