[SabreAMF] Bugfixes and upcoming release

Evert | Rooftop evert at rooftopsolutions.nl
Wed Jan 10 15:22:53 EST 2007


Hi,

Edwin Koster found a pretty serious bug related to AMF3 object decoding.
I actually heard about this before from Patrick Mineault, but I didn't 
have time to work on it back then (it was right before my vacation)..

So, thanks for that =)

Anyways, it's fixed now on Subversion.. you can checkout using the url:

http://svn.filemobile.com/main/sabreamf/trunk

This new version includes full support of Externalized objects and also 
an ArrayCollection implementation. (so there's a chance stuff has 
changed a little bit for people using AMF3 and the ArrayCollection).

You can check out the Externalized interface here:
http://www.rooftopsolutions.nl/code/?p=SabreAMF&a=s&file=/SabreAMF/Externalized.php

And the ArrayCollection class here:
http://www.rooftopsolutions.nl/code/?p=SabreAMF&a=s&file=/SabreAMF/ArrayCollection.php

For people who don't know PHP5's SPL objects too well, the 
ArrayCollection implements IteratorAggregate, Countable and 
ArrayAccess.. in practice this means you can do most general Array stuff 
on this object..

<?php

  $data = array();
  $data[] = array('property1'=>'yo','property2'=>'test2');
  $data[] = array('property1'=>'foo','property2'=>'bar');

  $arrayCollection = new SabreAMF_ArrayCollection($data);

  foreach($arrayCollection as $row) {
 
     // So yea, you can just loop through it like a normal array (done 
through IteratorAggregate)

  }

  // Or get values straight from a certain row (done through ArrayAccess)
  echo($arrayCollection[0]['property1']);

  // Or get the total number of rows (done through countable)

  echo(count($arrayCollection));

  // In the case you need a normal array, based on the ArrayAccess class
 
  $normalArray = iterator_to_array($arrayCollection);

?>

Be sure to download the update from subversion and test it out.. For 
people using AMF3 this is highly recommended!
An official (0.6) will follow shortly.. If there are any other much-used 
flex classes which might be useful to have a default implementation for 
in SabreAMF, let me know..

Hopefully we will see some proper documentation soon.. There were people 
who offered to set up a wiki, so we might see this not too far in the 
future.

Thanks all!
Evert



More information about the sabreamf mailing list