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

  • Home
  • SEARCH
  • 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 8468359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:54:30+00:00 2026-06-10T15:54:30+00:00

In Zend Framework ,Zend_Application object has a bootstrap object to bootstrap or configure the

  • 0

In Zend Framework ,Zend_Application object has a bootstrap object to bootstrap or configure
the components.Bootstrap class in turn have access to zend_application object to access configuration parameters.
My Question is that what kind of pattern is this or is it a code smell because of circular dependency.

  • 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-06-10T15:54:32+00:00Added an answer on June 10, 2026 at 3:54 pm

    Zend Framework 1 is bloated, that’s for sure.

    The reason for that $_application property representing a bi-directional relation is due to the module’s independent bootstrap files.

    It’s strange, I think, because when dealing with modules, instead of having the Zend_Aplication set you’ll have the main bootstrap instead:

    /**
     * Set application/parent bootstrap
     *
     * @param  Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application
     * @return Zend_Application_Bootstrap_BootstrapAbstract
     */
    public function setApplication($application)
    {
        if (($application instanceof Zend_Application)
            || ($application instanceof Zend_Application_Bootstrap_Bootstrapper)
        ) {
            if ($application === $this) {
                throw new Zend_Application_Bootstrap_Exception('Cannot set application to same object; creates recursion');
            }
            $this->_application = $application;
        } else {
            throw new Zend_Application_Bootstrap_Exception('Invalid application provided to bootstrap constructor (received "' . get_class($application) . '" instance)');
        }
        return $this;
    }
    

    There’s a lot of code smell too:

    /**
     * Constructor
     *
     * Sets application object, initializes options, and prepares list of
     * initializer methods.
     *
     * @param  Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application
     * @return void
     * @throws Zend_Application_Bootstrap_Exception When invalid application is provided
     */
    public function __construct($application)
    {
        $this->setApplication($application);
        $options = $application->getOptions();
        $this->setOptions($options);
    }
    

    The boostrap file need the options, so instead of asking for the options, it expects the Zend_Application to then get the options:

    $options = $application->getOptions();
    $this->setOptions($options);
    

    It seems like they simply ignore the type of interface expected by the setApplication() method and it can be one of the followings:

    • Zend_Application
    • Zend_Application_Bootstrap_Bootstrapper
    • Zend_Application_Bootstrap_ResourceBootstrapper

    I would give up trying to understand this mess and switch to ZF 2, though 😉

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

Sidebar

Related Questions

Hy Somebody! I have a question I want to solve in Zend Framework. The
Hi Need to confirm Zend Framework Hierarchy of Objects , Zend_Application has a Property
I am using Zend Framework 1.6 hence I'm not utilizing Zend_Application. I have a
I have a PHP MVC application using Zend Framework. As presented in the quickstart,
I have an application developed in Zend Framework 1.11. I use Zend_OpenId to create
I have a problem with setting up my Zend Framework application on live server.
hello all its my first application using Zend Framework i have followed tutorial it
I have a Zend Framework application whose sole purpose is to serve as an
I'm working on an application developed using Zend Framework. I have defined relationships in
I am using Doctrine 2 and Zend Framework 1.11. I have set up my

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.