Home > Flash Platform, Zend_Amf > ZF 1.8.4 breaks addDirectory()

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.

== 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.

Flash Platform, Zend_Amf

  1. sideDoor
    July 7th, 2009 at 17:12 | #1

    I was having severe problems with this bug…Reverting to 1.8.3 solved the issue…

    Thanks!

  2. July 11th, 2009 at 11:12 | #2

    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!

  3. noon
    July 13th, 2009 at 08:49 | #3

    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.

  4. PatrickG
    July 24th, 2009 at 04:09 | #4

    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.

  5. July 27th, 2009 at 19:25 | #5

    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!

  6. leef
    August 5th, 2009 at 15:21 | #6

    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.

  7. leef
    August 5th, 2009 at 15:39 | #7

    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.

  8. Paulo Azevedo
    August 13th, 2009 at 05:23 | #8

    In version 1.9.1 the problem still persists.

  9. Chief
    August 19th, 2009 at 09:50 | #9

    I can confirm the problem exist yet again in 1.9.1

  10. Chief
    August 19th, 2009 at 09:58 | #10

    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

  11. Chief
    August 19th, 2009 at 14:35 | #11

    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

  12. August 21st, 2009 at 13:45 | #12

    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.

  13. leef
    October 9th, 2009 at 18:06 | #13

    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/

  14. Arend
    February 8th, 2010 at 03:53 | #14

    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.

  1. July 8th, 2009 at 11:49 | #1