ZF 1.8.4 breaks addDirectory()
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:
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.
== Update July 7th 2009 ==
http://devzone.zend.com/article/4808-Zend-Framework-1.8.4pl1-Now-Available
This patch-level version corrects a missing patch for Zend_Loader_PluginLoader that provided some critical functionality for Zend_Amf users. If you utilize that component, you are encouraged to upgrade immediately; for all other uses, the release tarball remains the same as the 1.8.4 version, and upgrading is left to your discretion.


I was having severe problems with this bug…Reverting to 1.8.3 solved the issue…
Thanks!
Hello.
Zend Amf Package available in http://framework.zend.com/download/amf does not include some dependencies as PluginLoader and the Auth. This will be resolved? Or should I add myself manually?
Thanks!
Zend 1.8.4pl1 version is still buggy. the services cannot be located, although they are namespaced under library. tried $server->addDirectory to point to the Service folder, i still get
Class “Path_To_Service_MyService” does not exist
When i go back to ZF 1.8.3 everything work fine.
any idea?
thanks.
Seems like the 1.9.0 beta release still has the same problem.
That is on linux, on my mac addDirectory seems to work fine.
(Upper/lowercase problem perhaps?) Resorting to setClass for now.
Thanks Wade, the new PluginLoader.php resolves the issue.
Question though, I’m converting a project over from AMFPHP to Zend_Amf and don’t use the Zend naming convention for my Class names on my services. For example, my Authentication class in com.domain.Authentication is not named ‘Com_Domain_Authentication’ but just ‘Authentication’. Inspecting PluginLoader.php, I noticed that on line 379 the ‘load’ function does the check ‘class_exists($className, false)’ where $className in my case ends up being ‘Com_domain_Authentication’ because I have in my ActionScript the RemoteObject source=’com.domain.Authentication’. As a result, I get the ‘Class not found error’. Any suggestions that don’t involve renaming service classes to conform to Zend naming conventions?
Thanks!
Hey Wade, I’m noticing that ZendAMF is taking far longer to return results to Flash than AMFPHP. I’ve setup my bootstrap similar to Lee Brimelow’s tutorial.
The PHP & as3 remoting code is exactly the same, and if instead of returning the large dataset, I return a small array, the response time is improved. This leads me to think perhaps the bottleneck is happening with serialization? Whatever ZendAMF is doing to prepare php objects to send back to Flash.
In version 1.9.1 the problem still persists.
I can confirm the problem exist yet again in 1.9.1
Couple of observations.
1. My services directory was application/services/com// with the file name of AccountService.php. In PluginLoader function _formatName, it does a ucfirst on the plugin name, thus was expecting “Com” instead of “com”. Now, this could be related to my php settings (?), I’m not sure.
2. I had to change the class name in AccountService.php to be Com__AccountService for it to work.
Overall, I just don’t get it other than working through the issues in debug.
Wish I could help more –
Chief
Sorry to keep passing along information, but this is what seems to be working now.
AccountService.php, class name before was class name AccountService. This was working in prior versions of Zend_Amf (full framework btw).
Now, to get this to work, the file name is still AccountService.php, but the class name is com_safepost_AccountService, where the service is located (application/servicec/com/safepost/).
Hope that helps -
Chief
Hi,
I’m having a problem with zendamf where I receive the following error:
———
Class “test_Login” does not exist: Plugin by name ‘Test_Login’ was not found in the registry; used paths:
: /www/amfServices/system/application/controllers/services/
———
In my gateway file I’m using:
$server->addDirectory(‘/www/amfServices/system/application/controllers/services/’);
My folder structure where the class is looks like this:
/www/amfServices/system/application/controllers/services/test/Login.php
my NetConnection call goes like this:
—
this.service.call(‘test.Login.logmein’, responder, arguments);
—
where: test is the folder, Login is the class and logmein is the function.
What am I doing wrong here?
I thought that adding a directory to the server and calling the service like amfphp(folder.folder.class.function) would work…
Could anyone please answer me by mail or just reply here. Its really important cause I have the same Class names on different folders and I need to map the folder as I usually did with amfphp.
I found this speed comparison between AMFPHP, and ZendAMF. It validates my own experience with Zend being about 5x slower. Is this something that will be addressed and developed, or is that just the way it is with ZendAMF? 5x slower is a deal breaker with most of my applications.
http://gfxcomplex.com/video/zend-amf-vs-amph_amfphp-ftw/
I also still have this problem which keeps me from updating from 1.8.2. No matter what version I try (just tested 1.10) I still can’t get past this “Class com_example_project_class does not exist error”.
Any help would be greatly appreciated.
The problem persiste on ZendFramework 1.10
Armetiz.
@Arend
Notice that the class missed does not have the first letter with capital caps. I had the same issue but I changed the class name using the first capital letter and worked.
I was finally able to use the latest ZF build (1.11.1) by modifying Server.php inside the Zend/Amf/ build dir. I added this:
if(preg_match(‘/^your_package_com/’, $className)) {
$className = substr($className, strrpos($className,”_”)+1); // returns actual class name
}
Just before this line:
$this->getLoader()->load($className);
Inside protected function _dispatch($method, $params = null, $source = null)
This is a very poor solution to probably a misunderstanding of how to properly configure the Zend environment. But info on setting up ZendAmf (especially with full framework) are sparse or non-existent.
I forgot, this requires you to manually load all (Service) classes beforehand
Was searching again for how to fix this error and found my own comment here. It’s an ugly hack but it works. I will look into this a bit further as this issue (and bug report http://framework.zend.com/issues/browse/ZF-11446) is still alive and kicking.