ZF-6286: Zend_Application_Resource_Modules is not creating a Zend_Application_Module_Autoloader instance


The documentation mentions that Zend_Application_Resource_Modules will create a Zend_Application_Module_Autoloader instance, and likewise, it is what I would expect it to do, but it isn't. The only thing that I can see it doing is instansiating the module bootstrap if it exists. Are we supposed to create the Zend_Application_Module_Autoloader instance in the module bootstrap? If so, the documentation such be modified to state this.



Can you provide some reproduce code? A zip with a minimal directory structure showing the issue would help.

I've been able to independently reproduce.

Actually... I can't confirm this.

I created the following directory structure:


My application.ini had the following directives:

resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" = "Bar" ; to ensure modules resource is loaded

My application/modules/foo/Bootstrap.php file had the following:

class Foo_Bootstrap extends Zend_Application_Module_Bootstrap

application/modules/foo/models/User.php had the following:

class Foo_Model_User

I then created a test.php file at the same level as application/ with these contents:

define('APPLICATION_PATH', dirname(__FILE__) . '/application');

/** Zend_Application */
require_once 'Zend/Application.php';  

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_PATH . '/configs/application.ini'

$model = new Foo_Model_User();

This worked exactly as expected -- autoloading for the Foo module was enabled, and I was able to load that class.

Hi Matthew,

Sorry, I should have supplied such an archive with my original submission. I will next time. I'm glad you were able to replicate it though.

Here is what I ended up doing to work around the issue: ... It is mostly based on how the actual Resource Modules class works.

Let me know if you need anything else.

Thank you very much! Jamal Fanaian

Alright, let me try to see if I can replicate the issue individually. Maybe I just made a mistake somewhere. I hope I'm not wasting your time though.

BTW, I was using the standard Modules resource available on trunk. Test against that when you attempt to reproduce. If you can reproduce it, re-open the issue.

Well I was able to actually get it working in a new project. So apparently I am doing something wrong. I'm using the same exact ZF library for both projects though (releases-1.8.0PR). Thanks for the help, I'll just keep working on it since it looks like it is an issue on my end. Sorry that I wasted your time with this issue.

No worries -- I'd rather find out about a possible bug than have it go unreported and later confirmed. :)

Glad you were able to get it working, and I hope you figure out the issue in the original app.

Why does Zend_Application_Resource_Modules not not bootstrap the Default module?

Because the assumption at the time of coding was that the application bootstrap would be from the default module. Several people have since indicated this is not the case, and we plan to accomodate separate application/default module bootstraps later in the 1.8 series.