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 8092835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:22:16+00:00 2026-06-05T20:22:16+00:00

I’m reading Zend Framework manual and cannot understand how bootstrapping works particularly in ZF

  • 0

I’m reading Zend Framework manual and cannot understand how bootstrapping works particularly in ZF and in general.
They write:

Your Bootstrap class defines what resources and components to
initialize.

Ok. It means that the Bootstrap class should be instantiated the first of all.
But then then they write about the configuration ini file. And there are directives about the Bootstrap class itself in it:

1.  bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
2.  bootstrap.class = "Bootstrap"

So as I understand it means that it is not the Bootstarp class that is instantiated the first of all. The first of all something has to read the configuration file, get the info about the Bootstrap class and having that info to instantiate. Otherwise there is no need to have info about the Bootstrap class in configuration file. Because I can just do this:

require_once(/application/bootstrap.php) 
$b = new Bootstrap();

and Bootstrap is instantiated.

But they say nothing about the one that reads the config file and then makes an instance of the Bootstrap.

  1. How the Bootstrap really works?
  2. Who instantiates it and on which stage?
  3. They say that the APPLICATION_PATH is a constant. A constant has to be defined somewhere before it can be used. Where may it be defined if it is used in Bootstrap class?

Thank you.

  • 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-05T20:22:17+00:00Added an answer on June 5, 2026 at 8:22 pm

    If you look at the index.php file that ships with ZF, this should answer most of those questions.

    The APPLICATION_PATH constant is defined in index.php, and that is also where the Zend_Application object is created which simply bootstraps the application, and then runs it.

    There are 2 ways to tell your Zend_Application where your bootstrap is located in ZF1.

    First way (explicitly set):

    $application = new Zend_Application(
        APPLICATION_ENV,
        array(
            'bootstrap' => array(
                'class' => 'Bootstrap',
                'path' => APPLICATION_PATH . '/Bootstrap.php',
            ),
            'config' => APPLICATION_PATH . '/configs/application.ini',
        )
    );
    

    In the above example, the bootstrap class and the bootstrap script are passed as part of the $options directly to Zend_Application‘s constructor, along with the application.ini file.

    If you put the bootstrap class and script in your application.ini file, then you can initialize Zend_Application like so:

    $application = new Zend_Application(
        APPLICATION_ENV,
        array('config' => APPLICATION_PATH . '/configs/application.ini')
    );
    

    Zend_Application will process the application.ini file and gather the Bootstrap information from there.

    You can then call $application->bootstrap()->run(); to run the application.

    To directly answer your questions:

    1. The bootstrap sets up your application. After processing your ini file, it is the first thing take takes place. This sets up all the required components for your ZF application (e.g. Front Controller, Zend_View, Layouts, DB connection etc).
    2. index.php instantiates it pretty much at the very beginning.
    3. APPLICATION_PATH is defined immediately in index.php
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't understand what is rendering a view. I'm reading Zend Framework manual and
i am reading zend framework docs on zend view partials If your model is
Reading the section Zend_Application_Resource_Modules in the docs here: http://framework.zend.com/manual/1.10/en/zend.application.available-resources.html I noticed this: You can
I'm reading through the Zend Framework coding standards , where they state that curly
After reading some articles about XSS I have incorporated HTMLPurifier into my zend framework
I have been reading up on multiple PHP frameworks, especially the Zend Framework but
I'm learning by reading this tutorial: Link Here's the code: <?php require_once 'Zend/Loader.php'; class
i was reading Zend Framework Book: Survive the Deep End about resource methods. it
I'm reading the manual here: http://zendframework.com/manual/en/zend.view.helpers.html but I'm still confused. I have a script
As mentioned in the Zend Framework manual , I created a base controller. Subclassing

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.