ZF-6286: Zend_Application_Resource_Modules is not creating a Zend_Application_Module_Autoloader instance

Issue Type: Bug Created: 2009-04-13T09:11:08.000+0000 Last Updated: 2009-05-04T11:33:15.000+0000 Status: Resolved Fix version(s): Reporter: Jamal Fanaian (jamal) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Application

Related issues: Attachments:


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.



Posted by Matthew Weier O'Phinney (matthew) on 2009-04-17T06:11:49.000+0000

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

Posted by Matthew Weier O'Phinney (matthew) on 2009-04-17T07:43:03.000+0000

I've been able to independently reproduce.

Posted by Matthew Weier O'Phinney (matthew) on 2009-04-17T08:30:15.000+0000

Actually... I can't confirm this.

I created the following directory structure:

<pre class="highlight">

My application.ini had the following directives:

<pre class="highlight">

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:

<pre class="highlight">
class Foo_Bootstrap extends Zend_Application_Module_Bootstrap

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

<pre class="highlight">
class Foo_Model_User

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

<pre class="highlight">
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.

Posted by Jamal Fanaian (jamal) on 2009-04-17T08:30:38.000+0000

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

Posted by Jamal Fanaian (jamal) on 2009-04-17T08:33:31.000+0000

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.

Posted by Matthew Weier O'Phinney (matthew) on 2009-04-17T08:48:53.000+0000

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.

Posted by Jamal Fanaian (jamal) on 2009-04-17T09:11:48.000+0000

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.

Posted by Matthew Weier O'Phinney (matthew) on 2009-04-17T09:46:59.000+0000

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.

Posted by Joe Conigliaro (joe-w3design) on 2009-05-04T09:52:33.000+0000

Why does Zend_Application_Resource_Modules not not bootstrap the Default module?

Posted by Matthew Weier O'Phinney (matthew) on 2009-05-04T11:33:12.000+0000

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.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.