In Zend Framework basically request is handled as follows:
1. Application bootstrapping
2. Routing
3. Dispatch
"Bootstrapping" was handled by Zend_Application after that the route(module, controller, and action were requested) was identified in "Routing". .
In general bootstrapping creates a single entry point for our whole application so it makes our application at the start itself "getting it ready to execute". It'll load all our necessary files as soon as the routing & dispatch is done.
For modules, before routing and dispatch we need some things set up:
FYI: I have come across one good PDF which explains all about ZF dispatch process - zenddispatch_en.pdf
Here is the exaple for config.ini file.
1. Application bootstrapping
2. Routing
3. Dispatch
"Bootstrapping" was handled by Zend_Application after that the route(module, controller, and action were requested) was identified in "Routing". .
In general bootstrapping creates a single entry point for our whole application so it makes our application at the start itself "getting it ready to execute". It'll load all our necessary files as soon as the routing & dispatch is done.
For modules, before routing and dispatch we need some things set up:
- Autoloading support for module resources( view helpers, access to models, access to forms, etc. ) and it'll be enabled by default.
- Setting up module-specific routes. During bootstrapping and before routing occurs this will be specified.
- Module-specific navigation elements. This usually goes hand-in-hand with your routes (most Zend_Navigation pages utilize named routes).
- Setting up module-specific plugins. If there is functionality your module may be needing to enable as part of the routing/dispatch cycle, set this up in plugins and attach them to the front controller.
FYI: I have come across one good PDF which explains all about ZF dispatch process - zenddispatch_en.pdf
Here is the exaple for config.ini file.
[production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" autoloaderNamespaces[] = "Plugin" autoloaderNamespaces[] = "Helpers" autoloaderNamespaces[] = "Validator" resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" resources.frontController.params.displayExceptions = 1 resources.frontController.params.prefixDefaultModule = "1" resources.frontController.actionhelperpaths.Helper_Action = APPLICATION_PATH "/../library/Helpers/Action" resources.modules[] = resources.view[] = resources.view.helperPath.Helper_View = APPLICATION_PATH "/../library/Helpers/View" resources.db.adapter = "pdo_mysql" resources.db.params.host = "localhost" resources.db.params.username = "username" resources.db.params.password = "password" resources.db.params.dbname = "database_name" resources.db.params.charset = "utf8" resources.db.params.driver_options.1002 = "SET NAMES utf8" resources.db.isDefaultTableAdapter = true resources.layout.layout = "layout" resources.layout.layoutPath = APPLICATION_PATH "/layouts" [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1
can u please explain with some example for bootstrapping
ReplyDeleteSure i'll add a sample bootstrap file along with example soon and thanks....
ReplyDelete