views:

99

answers:

2

Hi guys, I'm working my way through some tutorials. I see the Zendcasts tutorials have me setting up a lot of things in the bootstrap.php file, while with the quickstart and other tutorials, don't even touch that file and do a lot of changes in the application.ini file.

What is the difference between the two and why use one over the other?

Thanks!

+1  A: 

Application.ini is intended for configuring application to some extent, that original authors intended to be available to developer, and that developer could find useful most of the time.

In other hand, using Bootstrap.php allows for some pretty advanced modifications that ZF authors didn't think of, like Configuring your Zend Framework application for multiple host.

So, it depends what you want to accomplish, but mostly things that have to happen very early during request would have to work with Bootstrap.php.

Hope it helps.

mr.b
Cool. I understand. Thanks!!
Joel
You may configure app for multiple hosts with sections of the application.ini as well. Or use different localconfig.php for each host, excluded from SCM. No need for more tweaks.
takeshin
A: 

You don't have to use application.ini at all. You may pass the settings as an array to the application object.

However, application settings may differ (eg. for staging or production server), and Boostrap is processed for each request with the same code.

It's easier to use config file with specific sections, than write a Bootstrap file and manage the conditions manually.

takeshin