Table of contents:
- What's new
- Installing Remoting components
- Installing AMFPHP
- Testing AMFPHP
- 10,000 foot view of Remoting
- Creating Remoting methods
- Method table reference
- Helper classes
- NetDebug
- Authenticate
- DateWrapper
- Datatypes
- Class mapping
- Security
- Authentication
- Sending recordsets
- Manual recordsets
- Pageable recordsets
- Consuming web services (SOAP)
- Other platforms
- FAME
- Flex
- FlashCom
- The service browser
- Debugging
- Debugging primer
- NetConnection debugger
- Debugging proxies
- NetDebug::trace and exceptions
- Common confusing errors
- Deploying
- Credits
What's new in AMFPHP 1.2
Amfphp 1.2 builds on amfphp 1.0 and the short-lived 1.1 with the following new features:
Enhanced service browser
The service browser can now be used to simulate requests on the client side. The means that you don't need Flash installed to test out your services, meaning it's much easier to mwork with amfphp in multidisciplinary teams. Testing is also a lot faster inside the service browser. Code generation has been enhanced with support for the ARP framework and automatic saving.
New folder structure
The new folder structure is less cluttered and easier to navigate and migrate between different versions of amfphp
Enhanced class mapping
Amfphp now features complete class mapping options from the gateway.
What's new in AMFPHP 1.0
A lot has changed since AMFPHP’s last version 0.9b. We’ve switched to a better engine, which allows us to add some much-wanted functionality. Here’s an outline of what’s new:
New engine
The core of the new engine was written by Justin Watkins, and was created to be 100% object oriented, secure, and reliable. Each step of the interpretation of AMF messages is carried through two chains: filters and actions. Expanding the capabilities of AMFPHP is as simple of creating a new filter or action, and modifying the chain in the right spot.
Enhanced support for different charsets
Flash uses Unicode, while PHP natively uses latin1 (ISO-8859-1). We’ve solved the babel tower by adding transparent support for charset transcoding using iconv, meaning you can work in your native language and charset, by calling the appropriate method in your gateway.php file.
Faster serialization
AMFPHP is renowned to be fast, and we’ve made it even faster by squeezing every bit of power from PHP in this new release. We’ve tightened the serializer and tweaked it for large resultsets; sending a resultset with 5 fields and 400 rows takes about 80% less time it used to. We’ve also tamed its memory usage, meaning it can be easily deployed on high-traffic servers.
Less NetConnection.Call.BadVersion error
The new loose mode sets up an output buffer to suppress echo, print and other calls to functions that output to the client to protect you from yourself. This should eliminate a good half of the common causes for the dreaded NetConnection.BadVersion error.
Remote tracing
We’ve added a new NetDebug::trace static method which does the same thing as the Action script NetDebug.trace function, but works remotely. It is available from any custom service class.
Pageable recordsets
Pageable recordsets allow you to send back SQL resultsets in chunks. On the Flash side of things, Macromedia’s classes handle synchronization between the client and server and the functionality is already plugged into the data grid, meaning it is easy to work with large recordsets.
Class mapping
AMFPHP now allows mapping objects in method arguments to custom PHP classes. To use this feature all you need to do is set the type under the arguments in the method table.
Tighter integration into the service browser panel
The new version is compatible with both Macromedia’s service browser, and Muzak's new (and better) panel. We’d like to thank Muzak who furnished the technical details on how we could achieve this.
HTML-based service browser
We’ve created our own HTML-based browser that features, in addition to service description, automatic Actionscript generation (scaffolding). That’s right, save time by browsing to your service and copy-pasting the code generated for you in Flash. Both AS2 (using the Service class) and AS1 (using NetServices.as) are generated. With a little bit of JavaDoc you can get it to generate your methodTable as well.
Tighter integration into the NetConnection Debugger
We’ve added support for new events in the NetConnection debugger, which means more verbose debugging output, which should help you figure what is going on between Flash and PHP.
Cookieless sessions
AMFPHP automatically handles sessions for you and sends back a header to Flash with a redirect to the gateway with the PHPSESSID appended to the query, meaning cookieless sessions are supported.
Authentication
Well, not really new, but it works more smoothly now because of the aforementioned cookie less sessions.
PHP5 compatibility
We’ve fixed incompatibility issues with PHP5 caused by its new pass-by-ref mechanism for class instances.
PHP5 exception support
You can now throw your own exceptions inside of your services and they will be sent back to Flash automatically in the onStatus handler.
Soap Client support
The native PHP5 SOAP extension is supported for web services, and it is much faster than NuSOAP and PEAR::SOAP alternatives.
More databases supported
SQLite, MySQLi, Oracle (oci8), Frontbase, Pear::db and PDO added to the roster of AMFPHP-compatible databases.
Transparent client header support
You can now use the Headers::getHeader($key) function anywhere in your services to get a client header by key.
FlashComm and SSL support
New headers are being sent by AMFPHP for compatibility with FlashComm and SSL.
New return types supported
Returns can be typed as binary, raw, arrayof, structof, and much more for specialized applications. Also a new methodTable option, fastArray is implemented for faster array handling for large multi-dimensional arrays.
New gateway options for deployment
disableStandalonePlayer(), disableServiceDescription(), disableTrace() and disableDebug() methods available for more secure deployement.
Easy installation and better documentation
We believe that AMFPHP is so good that it deserves to be spread to the world. The new documentation and simpler installation procedure should help you get started in a cinch.
A bunch of bug fixes
We’ve searched high and low and corrected FlashComm compatibility issues, authentication issues, problems with corrupted AMF messages and more.
