SabreAMF 1.3 release

9 months after the 1.2 release, I just published a long overdue release of the SabreAMF library.

The package mainly contains bugfixes. Upgrading is highly recommended.

Download

ChangeLog

Special thanks to Ionut Stoica for creating a Drupal Module, and Asbjørn Sloth Tønnesen for the bugfixes and patches. Enjoy!

Zend Framework 1.7 features AMF support

It just came to my attention that Zend Framework 1.7 was released, along with AMF support.

This is good news for people looking for a solid AMF implementation for PHP, because Zend with Adobe backing will likely have a lot more eyes on it, and there's a good chance this will result in a high quality implementation.

This implementation has similar design goals as SabreAMF, which begs the question how relevant SabreAMF still is. I'm not really sure myself. I sort of feel SabreAMF served its purpose well. It (mainly AMF3) has been a reference implementation for many other projects such as PyAMF, Red5, some ruby implementation which I know forgot the name of and unless I'm mistaken also AMFPHP and this very Zend_AMF.

Note that these guys never actually gave any credit ;), so I might very well be lying here.. I mainly just overheard this in the various mailing lists and from different people.

So yea, my personal goal has been to be the first open source AMF3 implementation, and build a very clean implementation people can easily drop into existing business logic. I feel I've achieved this, and its been a fun couple of years working on this, not to mention that it has helped putting my name out there, just a little bit.

I'll keep actively maintaining for the people that placed their bets on SabreAMF, recently Asbjørn Sloth Tønnesen has been helping a lot with this as well, but I'll probably start directing people to the Zend implementation for future setups.

Let me know what you guys think. Is there still value in keeping SabreAMF growing, or should it fully go to maintenance mode? Also, thanks a lot to all the people out there that submitted bug reports, patches, blogged about it or simply used it in production! This was my first open source project (hopefully not the last), and it has been a lot of fun :).

SabreAMF 1.2

Just posted a new SabreAMF version to googlecode, containing mostly bugfixes and a few enhancements. (download). Updating is highly recommended, this release was supposed to get out a bit earlier, but I wanted to test it in a live environment for a bit first.

Changes:

  • We're now throwing an SabreAMF_InvalidAMFException instead of a generic Exception in the event on a corrupt/incorrect AMF request. (contribution by: Asbjørn Sloth Tønnesen.)
  • Fixed a bug in the standard Recordset object (identified by 'datafirm').
  • Fixed string reference problem occuring with multiple AMF3 bodies, identified by sylvinus and fixed with help from the PyAMF team. Thanks guys!
  • Fixed a bug in AMF3 integer encoding. For some small ranges you would end up with the wrong integers in PHP. The integer decoder is also a lot faster now (Fixed by Kevin Martin).
  • SabreAMF_Server now allows alternative inputs than php://input (patch by Asbjørn).

Thanks guys!

SabreAMF 1.1 release

A new SabreAMF release is up for grabs at the Google Code site.

This is a bugfix-only release, fixing a few issues:

  • The AMF0 and AMF3 serializers did a check with is_numeric to find out if a variable is a number, this would cause problems for numeric-strings, as this function returns true there too. This has been changed to use is_float and is_int.
  • There was a bug with the serialization of integers in AMF3 within certain ranges. The algorithm has been fixed by Kevin Martin.. Also, the current implementation is faster. (thanks kevin! get a site, so I can link you..).
  • When onGetRemoteClass returns an incorrect value (something else than false or a string) an incorrect exception would be thrown, this is fixed as well.
  • Coding standards tid-bits

SabreAMF now on gentoo portage

Just came across a Gentoo package for SabreAMF.

I don't have any experience with gentoo, but I think this means if you want to install SabreAMF on a gentoo box, you can simply hit:

  1. emerge SabreAMF

sweet =)

Introduction to using SabreAMF with Flex

Wil wrote a pretty good introduction to using SabreAMF with flex. He's making use of the Zend autoloader to load the classes. If you're new to SabreAMF, this might be a good starting point.

He also mentions its best to set display_errors to 0, to suppress PHP errors. I personally prefer re-throw all PHP errors as exceptions using the following class:

  1. <?php
  2.  
  3.     /**
  4.      * This is a default exception wrapper for PHP errors.
  5.      * This allows you to deal with PHP errors as exceptions (using try..catch blocks etc..)
  6.      *
  7.      * @uses Exception
  8.      * @package Sabre
  9.      * @subpackage PHP
  10.      * @version $Id: Exception.php 733 2007-05-15 22:04:52Z evert $
  11.      * @copyright Copyright (C) 2007 Rooftop Solutions. All rights reserved.
  12.      * @author Evert Pot (http://www.rooftopsolutions.nl)
  13.      */
  14.     class Sabre_PHP_Exception extends Exception {
  15.  
  16.         /**
  17.          * __construct
  18.          *
  19.          * @param string $message
  20.          * @param string $code
  21.          * @param string $file
  22.          * @param int $line
  23.          * @return void
  24.          */
  25.         function __construct($message,$code=false,$file=false,$line=false) {
  26.  
  27.             parent::__construct($message,$code);
  28.             $this->file = $file;
  29.             $this->line = $line;
  30.  
  31.         }
  32.  
  33.         /**
  34.          * Register this class as an error handler
  35.          *
  36.          * @return void
  37.          */
  38.         static function register() {
  39.        
  40.             set_error_handler(array('Sabre_PHP_Exception','handleError'));
  41.            
  42.         }
  43.  
  44.         static function unregister() {
  45.  
  46.             restore_error_handler();
  47.  
  48.         }
  49.  
  50.         /**
  51.          * handleError
  52.          *
  53.          * @param string $code
  54.          * @param string $message
  55.          * @param string $file
  56.          * @param int $line
  57.          * @return void
  58.          */
  59.         static function handleError($code,$message,$file,$line) {
  60.            
  61.             if (!$code) return;
  62.             throw new self($message,$code,$file,$line);
  63.  
  64.         }
  65.  
  66.     }
  67.  
  68. ?>

Simply call Sabre_PHP_Exception::register();, and you're off..

Adobe publishes AMF3 spec

Adobe open-sourced their FDS (Flex Data Services) product today, and along with it published the AMF3 spec (this time without NDA!).

FDS, re-branded as BlazeDS is available under a LGPL v3 license. In their press release they also mention AMFPHP a couple of times, which is great news for the PHP community, because it implies they are backing the open source implementations.

I wanted to make sure the AMF implementation in SabreAMF is correct, by checking out the official spec. The spec is not really helpful though. It only covers AMF3, and missing some of the details. I guess I'm going to have to reverse engineer the 122MB behemoth that is BlazeDS.

SabreAMF 1.0 release

SabreAMF is now considered stable.. It has been tested for over a year, and no problems have been reported for a while.

I'm not totally sure where to go from here though; The original design goals have been met, documentation is written and it is well tested. Adding features for the sake of adding features doesn't seem like a good idea; so I guess this is where the project sort of halts..

I'll stick around to support and maintain it though.

Get it here. If you are running 1.0-beta4, don't bother (it's the same)

SabreAMF 1.0-beta4

Just posted a new release candidate for SabreAMF. SabreAMF was missing proper handling of arrays with mixed string and numeric keys in the AMF3 serializer.

Google Code download page

SabreAMF 1.0-beta3

Some bugs were found in encoding integers using AMF3 (thanks Kevin Martin).

These should now be resolved. A new download is up on Google Code.

 1 2 Next →

About

My name is Evert, and I've been writing semi-regularly on this blog since 2006.

I'm currently available for contract work.

more info.

Subscribe

Dropbox

Dropbox is a simple cross-platform online backup and sync application. The first 2GB of space is free, and both you and me get an extra 250MB extra space if you sign up through this link.