Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 567377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:04:35+00:00 2026-05-13T13:04:35+00:00

I’ve setup my application with Zend_Application. I have an _initAutoload() method in my Bootstrap.php

  • 0

I’ve setup my application with Zend_Application. I have an _initAutoload() method in my Bootstrap.php wich looks like this:

 public function _initAutoload(){
     $this->bootstrap("frontController");
     $front = $this->frontController;

     $autoloader = Zend_Loader_Autoloader::getInstance();

     $autoloader->registerNamespace('Client_');
     $autoloader->registerNamespace('Frontend_');
     $autoloader->registerNamespace('Global_');
     $autoloader->registerNamespace('Global_Helper_');
     $autoloader->setFallbackAutoloader(true);

     $modules = $front->getControllerDirectory();
     $default = $front->getDefaultModule();

     foreach (array_keys($modules) as $module) {
         if ($module === $default) {
             continue;
         }

         $autoloader->pushAutoloader(new Zend_Application_Module_Autoloader(array(  
             "namespace" => ucwords($module),
             "basePath" => $front->getModuleDirectory($module),
         )));

     }

     return $autoloader;  
 }

I have setup FrontController to prefix the default module also (seems more logical to me) $front->setParam("prefixDefaultModule", true)

I think I have the usual directory structure.

The problem:

I’ve set up subdomains for every module that I have. Everything works fine in the main main domain (www). The main module is frontend. If frontend is the default module then stuff works :). Ok. Now. For every subdomain, I have the same index.php but theres changed the env value. For client subdomain the env value is client etc. Each env value corresponds to my application.xml section. Each application.xml subdomain section (client, api, etc) extend the main section which is called defaults (currently theres a testing section also which enables errors etc, so every subdomain extends testing and testing extends defaults).

Each subdomain section of the application.xml changes the default module name. So for section defaults its frontend, for section client its client, etc.

Now
When I access domain.com/client or domain.com/api – its fine. Both API & Client use Client_Model_NameOfTheModel and like it supposed to – it’s located application/modules/client/models/NameOfTheModel.php and the DbTable/NameOfTheModel.php
WORKS

BUT
When I access the the module from its respective subdomain (client.domain.com, api.domain.com, etc) and the default module has been changed from frontend to its respective subdomain module name – it ends working. It even doesn’t output that “stack trace”.

Warning: include(Client/Model/ContactLists.php) [function.include]: failed to open stream: No such file or directory in [heres-my-path-to-root]/library/Zend/Loader.php on line 136

Warning: include() [function.include]: Failed opening ‘Client/Model/ContactLists.php’ for inclusion (include_path='[heres-my-path-to-root]/library:.:/usr/lib/php:/usr/local/lib/php’) in [heres-my-path-to-root]/library/Zend/Loader.php on line 136

Fatal error: Class ‘Client_Model_ContactLists’ not found in [heres-my-path-to-root]/application/modules/client/controllers/ContactListsController.php on line 4

I’ve tried 2 days to get it working. It just doesn’t. It just works under the default domain and doesn’t when the application.xml changes its default module to its subdomain name. Like that. This point is very very crucial currently because I can’t continue and this app needs to be out of sandbox (in early beta) by the end of this week.

Thanks for anyone for some advice.
PS. Sorry for the poor English. It isn’t my native tongue

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:04:35+00:00Added an answer on May 13, 2026 at 1:04 pm

    This is just a cursory guess, but it looks like it might be working on default because of these lines:

     $autoloader->setFallbackAutoloader(true);
    
     $modules = $front->getControllerDirectory();
     $default = $front->getDefaultModule();
    
     foreach (array_keys($modules) as $module) {
         if ($module === $default) {
             continue;
         }
    

    Essentially, if your module is the default module it skips it, which means it falls back to the fallback autoloader i would assume, and if the default autoloader cant find your models, well theres the issue. Is the concat of the root path in the error and the path of the class its trying to load correct?

    Also, this looks like it might be wrong

             "namespace" => ucwords($module),
    

    I would think it would need to be

             "namespace" => ucwords($module) . "_",
    

    Like your other namespaces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 409k
  • Answers 409k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It seems that you already have a strongly typed list.… May 15, 2026 at 7:10 am
  • Editorial Team
    Editorial Team added an answer all script/* commands has been removed from rails 3. You… May 15, 2026 at 7:10 am
  • Editorial Team
    Editorial Team added an answer Here it is in Python because I can't be bothered… May 15, 2026 at 7:10 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.