Karthik Karthik - 2 months ago 33
PHP Question

What is the purpose of bootstrap in zend?

I am wondering what is the real purpose of bootstrap in Zend Framework.

What are the methods that go into the Bootstrap class?

Any tutorial links could be helpful... please forgive me if the question is so vague. I am trying to learn Zend but the tutorials and books are skipping steps and they are not so clear in the framework website. All I can learn from the quick start is that it helps to start the session.

Am I right in thinking that the bootstrap runs first before any controller loads? Can I write any methods in bootstrap which I need to load from the beginning? How do I access those bootstrap methods in controller?


From Wikipedia:

In computing, bootstrapping (from an old expression "to pull oneself up by one's bootstraps") is a technique by which a simple computer program activates a more complicated system of programs. In the start up process of a computer system, a small program (such as BIOS) initializes and tests that a basic requirement of hardware, peripherals and external memory devices are connected. It then loads a program from one of them and passes control to it, thus allowing the loading of larger programs (such as an operating system).

In Zend Framework, bootstrapping is the process that loads your application. This includes, but is not limited to the Session. Any resources needed by your application to process the request (the dispatch) to the application is bootstrapped/loaded/initialized before the request is fulfilled, e.g. before the controller delegates any input to the model and creates a response that is send back to the client.

Additional information: http://framework.zend.com/manual/1.12/en/zend.application.theory-of-operation.html