ZF 1.8.4 breaks addDirectory()

June 27th, 2009

Looks like a bug was introduced in 1.8.4 that breaks class loading from the addDiretory() method. If  you use require_once with setClass or just use the 1.8.3 Zend_Amf_Server class file it will work. Unfortunitly I didn’t write the affected change but hope to have

=== Update July 1st 2009 ===

For some reason in 1.8.4 package there’s an old version of Zend/Loader/PluginLoader.php.

Take the new one here:

http://framework.zend.com/svn/framework/standard/branches/release-1.8/library/Zend/Loader/PluginLoader.php

It should work with it and the Zend Framework team is going to patch the 1.8.4 release on June 2nd to resolve this release issue.

Flash Platform, Zend_Amf

Major Zend Amf updates for 1.8.4 release

June 23rd, 2009

Lots of changes made to Zend Amf made there way into Zend Frameworks next mini release for 1.8.4. I thought that I would run through the major changes. Special thanks to Stefan Klug for all of the patches that he produced! Absolutely grateful sir! This is probably the biggest update to the system since the first release. Please make sure that you test 1.8.4 before you push it into your production environment. Why? Well if your like me you probably built a couple work arounds for some of these bugs. Those work arounds may no longer work once the bug is fixed!

Major Changes

ZF-6641 Shared references are duplicated
ZF-6205 Serializer does not support cyclic references
ZF-6393 Wrong Amf0_Amf3 reference counting
ZF-5382 Multiple calls seems to break the deserializer.
ZF-6625 Zend Amf can load any instantiated PHP class. Security

Minor but significant changes

ZF-6975
Adobe Flash Builder 4 wizard now supports data types for introspection.
ZF-6992 Negative integers on 64 bit system is resolved.
ZF-6775 Unable to send Array’s from Blaze DS.

The 1.8.4 release has already been tagged and should come out sometime today 6/23/2009

AMFPHP, Flash Platform, Zend_Amf

ArrayCollection beta update in Zend Amf: thoughts?

June 15th, 2009

I started working on a project this week that extensively uses ArrayCollection’s and I found that ZendAmf could use a couple additions in order to have some utilities for working with ArrayCollections in PHP. The new feature relies heavily on PHP’s SPL and specifically Countable, ArrayAccess, and IteratorAggregate all of which require PHP 5.2.3 or greater.

The following file can be added to your Zend Amf project to play with some of these features. Please let me know if there is anything else that I should add before it is added in the next release. Please post feedback to the blog or directly to the Zend Framework feature request.

Alpha Zend_Amf_Value_Messaging_ArrayCollection

To create an ArrayCollection

$this->_data[] = array('foo' => 'foo1', 'bar' => 'bar1');
$this->_data[] = array('foo' => 'foo2', 'bar' => 'bar2');
$this->_arrayCollection = new Zend_Amf_Value_Messaging_ArrayCollectionTwo($this->_data);

To Create an ArrayCollection from a Zend_Db_Table_row

$table = new Bugs();

$select = $table->select();
$select->where('bug_status = ?', 'NEW');

$rows = $table->fetchAll($select);
$this->_arrayCollection = new Zend_Amf_Value_Messaging_ArrayCollectionTwo($rows);

To alter an element of an ArrayCollection

$this->_arrayCollection = new Zend_Amf_Value_Messaging_ArrayCollection($this->_data);
$total = count($this->_arrayCollection);
echo($total); // outputs 2

To get the size of the array collection


to iterate through the ArrayCollection

$count = 0;
foreach($this->_arrayCollection as $row) {
    $count++;
}
$this->assertEquals(2, $count);

To manipulate an ArrayCollection based on keys.

$this->_arrayCollection = new Zend_Amf_Value_Messaging_ArrayCollection($this->_data);

// See if the offset key exists
$boolean = $this->_arrayCollection->offsetExists(1);

// Alter or add the row at they key offset of 1
$data = array('fooSet' => 'fooSet2', 'barSet' => 'barSet2');
$this->_arrayCollection->offsetSet(1,$data);

// Remove the row at the offset key of 3
$this->_arrayCollection->offsetUnset(3);

// Get the row at the offset 6
$row = $this->_arrayCollection->offsetGet(6);

To change an ArrayCollection to an Array

$standardArray = iterator_to_array($this->_arrayCollection);

To append another row to an ArrayCollection

$this->_arrayCollection->append(array('kung' => 'foo', 'Bruce' => 'Lee'));

– Update –
From a PHP developers perspective this makes little since. I am asking that you comment why you like the new ArrayCollection. I am creating something that can already be done with an array in PHP and then just wrap it into a stub ArrayCollection class. The two things that action script does not do with an array is:

it can not handle sparse array’s. {1=> one, 2=>two, 4=>four} this is a sparse array and Action Script will try and pad the array or just make it an object.

Actionscript can not use strings as the key in the array so it just uses an object. If you want a numerically keyed array of objects they call it an ArrayCollection.

Both of these concepts are handled in PHP as just an Array. So there is no reason that you could not use the Array and then pass the array into a simple ArrayCollection class for it to be parsed back to flex. So when you see the new ArrayCollection class what are the use cases that you feel you would use the class for? Is it just a convenience tool or does it add complexity that does not need to exists?

ActionScript 3, Flash Platform, Zend_Amf

Adobe Flash Builder 4 Beta for PHP developers

June 9th, 2009

I am giving a couple e-seminars about some of the new  features exposed in Flash Builder 4. The examples are all going to be PHP but it the majority of the talk is on tooling. Come check it out and ask questions. It’s still beta so if you want something changed now is the time to ask!

Adobe® Flash Builder 4 Beta (formerly Flex Builder) for PHP developers
Tuesday, June 9, 2009 12:00 PM PT
Thursday, July 16, 2009 11:00 AM PT

Learn about the new improvements with Adobe Flex 4 Beta and how developers working with Flex and PHP are boosting their productivity by combining it use with Zend. This demonstration will show you how you can create a combined project with Flex components and PHP natures and reap the benefit of coding in both languages.

Flash Platform, Zend_Amf

Video response to getMicrophone().com

May 7th, 2009

If you have not been to getMicrophone() go check it out. It’s an initiative to have raw access to the audio stream that is coming off the getMicrophone() method; clever url!. The project is similar to the MAKE SOME NOISE initiative. All the wonderful things that we want in the player asap! Go vote on some of these feature requests so we can see this in the next player release!

Open Microphone Object in Flash Player

Acoustic Echo Cancellation support

Raw WebCam greater resolution than 320×240 ok you got me I just want this fixed too!

Flash Platform, microphone

Speaking at PHP | tek Chicago

May 5th, 2009

I am giving a presentation with Lee Brimelow about using Flex and PHP. Looks like it is going to be a great presentation. ;-)

php|tek 2009 PHP Conference - Chicago, May 19-22, 2009

I submitted an unconfrence hands on session. This requires a vote so GO VOTE if you find it interesting. If you want me to address anything in either talk just let me know.

Flex + AMF+ PHP = Data Visualization
http://joind.in/event/view/41

Looking to build your first Flex application or are just curios about it’s complexity? Most people are attracted to Flex in order visualize complex data. Learn the technical details for setting up your first visualization application with charting, maps, and lazy loaded data sets. For even more fun we will use some real time data from #tek09 with the help from Zend Framework.

Flash Platform, Speaking, Zend_Amf

Adobe looking for developers to join early access program for Flex Builder

April 3rd, 2009

From Andi Gutmans

Adobe is currently building the next generation of Flex Builder, the Eclipse based IDE for creating cross-platform rich Internet applications.  In this upcoming version, a significant new set of features are being introduced to accelerate creation of data-centric applications with PHP on the server-side leveraging Zend Framework and Zend AMF.  Prior to the public Beta later in the year, Adobe would like to invite a select group of PHP developers into a private pre-release program for Flex Builder. You’ll get to work with the new data-centric development features, interact with members of the product team, provide feedback, and generally help shape the future of the product.  No prior experience with Flex is necessary; in fact feedback from new users would be particularly helpful.  There is a brief survey here - please complete it and Adobe will send an invitation to you shortly.

Flash Platform, Zend_Amf

GZip compression is not part of AMF!

April 3rd, 2009

I have read a couple ranting emails, tweets, and blog posts about why Zend Amf does not have gzip compression; “Wade what a waste!” is my favorite one. The reality is that the AMF protocol does not have gzip compression, there is no DEFLATE call, and if you read the protocol you can find no mention of such a thing. When AMFPHP added AMF3 support it also added a php based gzip support in the same release. Hence AMFPHP now with AMF3 and Gzip compression; mutually exclusive rumor started. The compression of HTTP which is the envelop that that AMF data is transported through does not mean that AMF is compressed. This is no different than the plethora of other http service end points such as Soap, JSON, REST, XMLRPC, etc which all benefit from a properly configured web server. 

If you run apache check out mod_deflate.  With this approach, you tell the server what content types should be compressed, and the server does it transparently to your application. Apache is a heck of a lot faster at doing the compression than adding PHP code that uses gzcompress.

Hope this helps… and please no dirty names for someone that’s just trying to give you some free code. Go get Live Cycle DS dude!

Flash Platform, Zend_Amf

Don’t miss part 2 of our free webinar on Flex & PHP

April 3rd, 2009

Friday, April 3, 2009 1:00 PM - 2:00 PM EDT

Signup!
A three part series on how PHP developers can develop applications with the Adobe Flash Platform.  Lee Brimelow, a technical evangelist for Adobe, will go over the pieces of the Flash Platform and how PHP developers can use technologies like Adobe Flex and Adobe AIR in combination with PHP to build rich applications that work consistently across browsers in Flash Player and on the desktop using Adobe AIR.

Flash Platform, Zend_Amf

SWFCAMP is April 6th - come and learn!

March 31st, 2009

mnswfcamplogoI am really excited to be showcasing Zend Framework and the work that I have been doing on Zend Amf, maybe some FB 4 sneaks, at SWFCAMP Monday the 6th in Minneapolis. There are great speakers lined up for only $40 dollars of all day training. That’s pretty slick! This mini conference is run better than most major conference because people like Danny Patterson and Dave Shroeder, FlashBelt, make sure it is executed flawlessly. The cool thing about the day is that all of the speakers will be adding onto the same project throughout the entire day. This means that we get to cover a larger application than normal. Little will be repeated and the individual speakers get to focus on their specific topic. It should be lots of fun. Last year we had a turn out well over 100 people, great facility, and the sushi and drinks for the after party were fantastic! If you have ever attended a Flash Camp before this is the next level. 

More about the application we are building:

Jason Grey is building an product comparison application where the user can add products from Amazon or eBay and compare them.  Danny Paterson is  going to be adding peer-to-peer collaboration to the application in his session.  This will allow two users to shop and compare together. To do peer-to-peer in Flash Player 10 we must use the new Stratus beta from Adobe to get unique ids.  These ids need to be registered along with the user’s name in a common place.  So the service we need is a backend that can store current user sessions. Enter Wade Arnold’s talk on using ZendAmf for integration with PHP and MySQL.

This will be fun! I am sure there are more details but you will just have to come in order to find them all out! Check out the main site for more infomation and sign up right now!

 http://www.mnswf.org/camp/index.cfm

Flash Platform, Speaking, Zend_Amf