Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- /admin/Bootstrap.php -->
- <?php
- class Admin_Bootstrap extends Zend_Application_Bootstrap_Bootstrap
- {
- protected function _initAutoload()
- {
- $autoloader = new Zend_Application_Module_Autoloader(array(
- 'namespace' => 'Admin',
- 'basePath' => dirname(__FILE__)
- ));
- return $autoloader;
- }
- }
- <!-- Bootstrap.php -->
- <?php
- class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
- {
- protected function _initAutoload()
- {
- $view = $this->bootstrap('view')->getResource('view')->addHelperPath(APPLICATION_PATH . '/views/helpers');
- $autoloader = new Zend_Application_Module_Autoloader(array(
- 'namespace' => 'My',
- 'basePath' => dirname(__FILE__),
- ));
- // var_dump($autoloader->getDefaultResourceType());
- return $autoloader;
- }
- protected function _initDoctype()
- {
- $this->bootstrap('view');
- $view = $this->getResource('view');
- $view->headTitle()->setSeparator(' - ')
- ->append('Retrodoc ' . APPLICATION_ENV);
- $view->headMeta()->appendHttpEquiv('Content-Type', 'application/xhtml+xml; charset=utf-8');
- $view->doctype('XHTML1_STRICT');
- ZendX_JQuery::enableView($view);
- $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
- $viewRenderer->setView($view);
- Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
- }
- protected function _initAuth()
- {
- $auth = Zend_Auth::getInstance();
- }
- protected function _initNavigation()
- {
- $view = $this->bootstrap('layout')->getResource('layout')->getView();
- $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
- $view->navigation(new Zend_Navigation($config));
- }
- protected function _initUserInformations() {
- $session = new Zend_Session_Namespace('User');
- // $session->id =
- }
- protected function _initPlugins() {
- // register plugins
- $frontController = Zend_Controller_Front::getInstance();
- $dbAdapter = Zend_Registry::get('dbAdapter');
- // $pluginDebug = new My_Plugin_Debug(array('database_adapter' => $dbAdapter, 'memory_usage' => true, 'collect_view_vars' => true));
- }
- protected function _initFireBugPhp() {
- $writer = new Zend_Log_Writer_Firebug();
- $logger = new Zend_Log($writer);
- Zend_Registry::set('logger',$logger);
- }
- }
- <!-- application.ini -->
- ; application/configs/application.ini
- [production]
- ; PHP settings we want to initialize
- phpSettings.display_startup_errors = 0
- phpSettings.display_errors = 0
- includePaths.library = APPLICATION_PATH "/../library"
- bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
- bootstrap.class = "Bootstrap"
- ; frontcontroller resources
- resources.frontController.plugins.access = "My_Plugin_Access"
- resources.frontController.plugins.layout = "My_Plugin_Layout"
- resources.frontController.throwException = true;
- resources.view[] =
- resources.frontController.controllerDirectory.default = APPLICATION_PATH "/modules/default/controllers"
- resources.frontController.controllerDirectory.admin = APPLICATION_PATH "/modules/admin/controllers"
- resources.frontController.controllerDirectory.xml = APPLICATION_PATH "/modules/xml/controllers"
- resources.frontController.controllerDirectory.note = APPLICATION_PATH "/modules/note/controllers"
- resources.modules[] = ""
- ; so auto-loading will find our classes in library/App
- autoloaderNamespaces[] = "My_"
- ; set our language
- resources.translate.registry_key = "Zend_Translate"
- resources.translate.adapter = "array"
- resources.translate.options.scan = "directory"
- resources.translate.data = APPLICATION_PATH "/lang/"
- ; layout
- resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
- ; initialize database
- resources.db.adapter = "PDO_MYSQL"
- resources.db.params.host = "localhost"
- resources.db.params.username = "root"
- resources.db.params.password = "root"
- resources.db.params.dbname = "retrodoc_prod"
- [staging : production]
- [testing : production]
- phpSettings.display_startup_errors = 1
- phpSettings.display_errors = 1
- resources.db.params.dbname = APPLICATION_PATH "/../data/db/guestbook-testing.db"
- [development : production]
- phpSettings.display_startup_errors = 1
- phpSettings.display_errors = 1
- resources.db.params.dbname = APPLICATION_PATH "/../data/db/guestbook-dev.db"
- resources.db.params.dbname = "retrodoc_dev"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement