amfPHP 2 alpha1

Posted by
|

The alpha for amfPHP 2 is finally here! It’s not ready for production use yet, but it should be of interest to many of you amfPHP users out there.

What’s new:

  • The core system has been stripped to the basics and refactored/rewritten. That means deserializing an AMF packet, making the RPC call, and serializing the answer. It makes for a much cleaner and more extendible codebase.
  • The plugin system. It’s basic, it’s not yet documented, but it works. Basic versions of plugins for logging, authentication, charset conversion, custom class mapping, flex messaging are also included. The idea is that the community can enhance these and contribute some of their own.
  • unit tests everywhere. There were absolutely no tests for 1.9, but now there’s a growing body of tests to make sure that any change to the codebase doesn’t create a regression.
  • PHP 4 is no longer supported.
  • support for PHP 5.3. A lot of the 1.9 code was written a long time ago and just didn’t cut it by PHP 5.3 standards. This should no longer be the case.
  • some changes in serializing/deserializing objects. Anonymous objects are deserialized as objects, not arrays. Typed objects use a very simple convention: The type found when deserializing is set to « _explicitType » on the PHP Object. And if you want to serialize an object with a type, all you have to do is make sure its « _explicitType » field is set. The Custom Class Mapping helps you do things the old way, but if you want to do things differently, you can.
  • A new workflow using amfPHP as a library. The old workflow where you put your service classes in the « services » folder is still supported, but you can just as easily keep amfPHP completely separate from your project and add various service classes to it through configuration.
  • a generated phpDoc

What’s missing for a stable release:

  • there’s a couple of serialization/deserialization handed over from the old codebase that haven’t yet been fixed.
  • Not much has been done to optimize the code, so it could probably be sped up
  • documentation
  • whatever issues you find, that’s the point of this release!

Who is this for:

  • Advanced users and developers who would like to take advantage of the new features such as the plugin system, library work flow etc.
  • Anyone who has issues with the old version, such as problems with PHP 5.3

Who should stick to 1.9:

  • if 1.9 is ok for you and you just want to get stuff done, stay with it for the moment
  • users of the service browser, as it’s not integrated in v2 yet

So here it is! Download here.

Comments

  1. Leonardo França

    22 Fév 11

    great job! especially in the « Anonymous deserialized objects are the objects, not arrays. »

  2. ariels

    13 Avr 11

    no it’s not, but we’ll fix it for v2. Thanks for pointing it out!

  3. Leng

    3 Mai 11

    Hi ariels, great job on amfphp. I wonder how would you use the old Flex service browser with AMFPHP API in version 2?

  4. ariels

    3 Mai 11

    @leng:
    The way I see it it should be made into a plugin, and it could catch calls to its DiscoveryService class using the FILTER_SERVICE_OBJECT in the service browser. I just took a look the hook would need a bit of tweaking though. If you want to take a crack let me know!

Comments are closed

News letter

Evénements Silex Labs sur Paris et sa région: Inscrivez vous à la Newsletter mensuelle

Silex Labs community Tweets

Facebook page