Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Release 0.9.4 - 25/08/2008

Release 0.9.3 - 25/08/2008

Release 0.9.2 - 25/08/2008

sfAmfPlugin

Overview

The sfAmfPlugin provides you with all you need to write symfony backends for Flex clients.
The communication is done via Adobes AMF protocol. On serverside the SabreAMF library is used
to encode/decode the AMF streams. For parsing the annotations the Addendum library use used

Installation

The easiest way to install the plugin is to use the plugin:install command of symfony.

$ php symfony plugin:install sfAmfPlugin

If you preffer you can use the current development version from the subversion repository
(http://svn.symfony-project.com/plugins/sfAmfPlugin) instead. Copy the checked out version to the plugins folder of
your project and execute the command

$ symfony cc

That's it

Usage

AMF-Client Requests are try to execute Services on the backend. Therefore you have to create a RemoteObject in
Flex that has a Symfony-URL (i.e http://flextest/Test/amf).

All your services you can call will need to be saved under lib/services in your project folder. There you can
add as many subfolders as you need/want. Services on Flex-Side can use package names like
org.company.project.Servicename. You can use this with symfony too. All you need to do is to save this
Service under lib/services/org/company/project/Servicename.php. That's it!

ORM-Support

The sfAmfPlugin supports both ORM-Layers of Symfony (Propel and Doctrine). So you are able to return
Doctrine_Recordset, Doctrine_Collection and Propel-Objects from your service. The plugin is doing
the conversion to AMF for you.

Annotations

You can control the behaviour of the Service via setting annotations in the DocBlock comments of the function.

AmfIgnore

By default every public funtion is accessable via a AMF-Request. With the @AmfIgnore Annotation you can set
a public function to inaccessable. If you try to access this function you get an error message.

/**
* @AmfIgnore
*/publicfunction getValues(){
...
}

AmfClassMapping

AMF has a nice feature called class mapping. In this case your result of the PHP will be automatically mapped
to a ActionScript class on the Flex client side.
Cause Flex can not do this without some informations you have to define the ActionScript class before returning
the values from PHP. With the sfAmfPlugin you can use the AmfClassMapping annotation to define this class name.

ByteArray

Sometimes it can be useful to transfer byte array data (i.e. images) from PHP to Flex. Therefore you can set the
returning data type of a service method to ByteArray. This is done via the @AmfReturnType annotation