AMF for Symfony2
PHP
Latest commit 233e44c Jun 11, 2012 @tecbot Merge pull request #5 from benjamindulau/composer
Added composer definition
Permalink
Failed to load latest commit information.
Amf
Annotation
Controller removed the kernel and added controller stuff Jun 30, 2011
DependencyInjection
Event added an event to handles exceptions Dec 1, 2011
HttpFoundation removed the kernel and added controller stuff Jun 30, 2011
Logger/Handler
Metadata
Resources added logging and add it to the amf response (only for flex) Oct 12, 2011
Serializer fixed error with custom property handler Sep 2, 2011
Test updated Test Client May 30, 2011
Client.php
README.md fixed markup Oct 4, 2011
TecbotAMFBundle.php
composer.json

README.md

======== Overview

This bundle allows you to use AMF with the Symfony2 Framework. Main features include:

  • handle incoming AMF requests and routing it to the configured services.
  • serializer to convert classes to virtual objects with the JMSSerializerBundle

Installation

Checkout a copy of the code::

git submodule add https://github.com/tecbot/AMFBundle.git src/Tecbot/AMFBundle

Then register the bundle with your kernel:

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new JMS\AMFBundle\TecbotAMFBundle(),
    // ...
);

Make sure that you also register the namespaces with the autoloader:

// app/autoload.php
$loader->registerNamespaces(array(
    // ...
    'Tecbot'              => __DIR__.'/../vendor/bundles',
    // ...
));

Note: The serializer needs the JMSSerializerBundle.

Configuration

Below is the default configuration, you don't need to change it unless it doesn't suit your needs:

tecbot_amf:
    use_serialization: false

Usage

  • All mapped services must be added to the folder "Amf" in your bundle (e.g Foo\BarBundle\Amf\FooService).
  • All public methods wich you want to access from Amf needs the "Action" suffix like controllers.

Configuring services and class mappings

tecbot_amf:
    services: # Services
        FooService: FooBarBundle:Foo # Map FooService (Actionscript alias) to Foo\BarBundle\Amf\Foo class
    mapping: # Class mapping. Map FooClassVO (Actionscript alias) to Foo\BarBundle\VO\FooClassVO
        FooClassVO: Foo\BarBundle\VO\FooClassVO

Add routing to the gateway controller

# path is "/gateway"
_tecbot_amf:
    resource: "@TecbotAMFBundle/Resources/config/routing.yml"

# or when you want a another path
amf:
    pattern: /amf
    defaults: { _controller: tecbot_amf.controller.gateway:gatewayAction }

Example App

See AMFBundle-sandbox