Updates to ZendAmf in ZF 1.7.8 mini release
Lot’s of bug fixes have been added to the next release of the zend framework. I have listed all of the jira tickets below. A lot of these issues have been fixed in the trunk for months but have not made it to a mini release because i didn’t know that I was suppose to merge them! Now I know and this mini release is going to be very significant. Please update when it is released so you can help me find any other issues.
Monday the 30th we should see the 1.7.8 mini release of zend framework.
ZF-5388 Zend_Amf_Server handles arguments wrong
ZF-5831 Zend_Amf_Server getDirectory returns the wrong variable
ZF-5816 Wrongly capitalized class name in Zend_Amf_Request initialize method
ZF-5710 Multiple object with transient _explicitType loose are not type cast
ZF-5040 Impossible to set same method name in two differents services
ZF-5393 Error when passing Zend_Amf_Server::setClass() an object instead of a string
ZF-5346 AMF3 Messages with Object as first param fails with badVersion
ZF-5381 Create session management of subsequent AMF calls.
ZF-5707 Using addDirectory does not enforce names spaces


Hi Wade,
First of all thank you for all the hard work on Zend AMF it looks great.
One question. Trying to switch from AMFPHP to ZendAMF and having a bit of problem converting my scripts.
Following works fine:
$num_rows[0], “result” => “hello”);
}
}
I get array returned in flash and values are traced nicely.
But if I try to return following where $t is associated array result from database:
return array(“numRows” => $num_rows[0], “result” => $t);
I get this error in flash:
Error #2044: Unhandled NetStatusEvent:. level=error, code=Client.Data.UnderFlow
I’m debugging with Charles and getting following AMF error:
AMF data not complete
AMF detail view error:
Failed to parse data(java.io.EOFException)
RAW response:
HTTP/1.1 200 OK
Date: Mon, 30 Mar 2009 14:07:41 GMT
Server: Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2
X-Powered-By: PHP/5.2.6
Content-Length: 159
Connection: close
Content-Type: application/x-amf
Sorry part of my code got cut somehow this is the part with:
Following works fine:
public function getTest($page, $limit)
{
$temp = mysql_query(“SELECT SQL_CALC_FOUND_ROWS * FROM mealtype LIMIT 1″);
$result = mysql_query(“SELECT FOUND_ROWS()”);
$num_rows = mysql_fetch_row($result);
$offset = $page * $limit;
$sql = “SELECT * FROM mealtype ORDER by title LIMIT $offset,$limit”;
$result = mysql_query($sql);
$t = array();
while($row = mysql_fetch_assoc($result))
{
array_push($t, $row);
}
return array(“numRows” => $num_rows[0], “result” => “hello);
}
Cheers,
Eddie
a bit of cutoff RAW response:
hi
first of all – thx for your great work!
after the update to version 1.7.8 all my old projects didn’t work any longer because of a missing class name (i just call the method by name without the name of the class to which it belongs). would it be possible to keep the old behavior of the server in the case that $source isn’t defined instead of throwing an exception?
thx&br
Riw, I sent you an email asking for files. I’ll get this update right away.. That was not a knew feature!
Thanks with the latest update my problem is resolved
Hi,
First I must say I love zend_amf and the whole zend_framework. It’s really that great!
However, I’m experiencing a problem with class mapping. When I have a array of VO’s within a another VO the VO’s in the array do not get mapped in Flex. Like this:
BussVO (OK)
- BussdriverVO (OK)
- passengerArray
– passengerVO (NO)
– passengerVO (NO)
I’ve checked with Charles and the mapping of the VO’s in the array looks ok but not when I check the result event in flex. I’m using the setClassMap method for my mappings.
Any ideas?
Regards Morgan
Hi Wade and all – I love Zend AMF, but am having a small problem. I have a PHP class called Test where I have 2 public methods that get and set an array passed in from flash. Trouble is I always get null passed back from the getArray() method, even when set with the setArray! The setArray works perfectly. What am I doing wrong? I posted this on 2 other places but Zend AMF is so new that no one responded to me. Here is my PHP code below. Can Zend AMF only return results to Flash from a single PHP method, and won’t save data in properties?
class Test
{
private $_a;
public function setArray($a)
{
$this->_a = $a;
return $this->_a; // for debugging purposes (traces)
}
public function getArray()
{
return $this->_a; // always returns null (traces: null)
}
}
Thank you for all your work, of course!
I’m not sure where else to post this (is there a Zendamf forum?), so:
There seems to be an issue passing special character values via Zendamf. I’ve written an application that deals with multiple languages. While querying a database that returns data including French-text characters (ie: Québec), the result returned from Zendamf is not handling the special characters (ie: instead of Québec, we receive Qu�c).
I’ve checked the output of the data via Php: the issue is not with the database result – the characters are returned correctly from the database to the Php result-set – I am able to print these characters correctly before they are sent through Zendamf, either by rendering them in HTML or by writing them to a log file.
However, once I plug the SQL result into an object and pass it to Zendamf, the special characters get mangled. Using Charles Web Debugging Proxy, I can see that the result values are mangled before they are passed back to my AS3 application.
Any ideas here? Thanks so much!
I’ll try to log a bug at Zend about this, too, I suppose…
@ my comment above:
This is not an issue with Zendamf, but rather Zend_Db, and to resolve the issue I enforced the character set of the persistent db connection to UTF-8 by using the following statement in the Zend_Db::factory parameters:
‘driver_options’ => array(PDO::MYSQL_ATTR_INIT_COMMAND => ‘SET NAMES utf8′)
If anyone is having such issues, make this alteration to your db connection in your bootstrap (index.php) file.
Thanks again!
@Morgan
Hi Morgan, have you resolved your problem with VO’s array in VO. I have the same problem and it can’t find bug report in the zend_amf project. Any idea except to make manual mapping in Flex for this VOs?