phpxmlapache-flexamfphpweborb

Best method for Flex to PHP communication?


What is the best method for communication between Flex and PHP?

In the past, we used AMFPHP with AS2, and it worked great for the most part (advantage of AMFPHP is that it also has a JSON mode that can let you seamlessly use the same remote PHP with either Javascript or Actionscript frontends).

However, it seems like AMFPHP isn't realy maintained anymore. So what do people recommend to replace it? So far, what I've found is:

  1. Zend_AMF (looks too complex for us, we're not using the Zend framework otherwise)
  2. AMFPHP (there were some updated made to support Flex, and it seems fairly stable, but not sure on long-term support)
  3. XML (AS3 has nice XML handling routines, but it's more of a pain on the PHP side)
  4. WebORB (I have no experience with this)
  5. Roll-our-own using JSON or some other data-to-text serialization system (php's serialize(), XML, etc etc)

Mostly I'm leaning towards AMFPHP, even because of the downsides, since that's what I'm used to. Any reason I should consider switching to something else?


Solution

  • If you want to have fast and efficient communication, I highly recommend sticking with an AMF protocol instead of a REST or JSON custom format.

    ZendAMF is actually not very confusing. Watch the introduction tutorial on GotoAndLearn, it's quite simple.

    And just so you know, some of the developers from AMFPHP moved to work on ZendAMF. So in a sense, ZendAMF is the continuation of AMFPHP.