Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.59 KB | None | 0 0
  1. <!-- /admin/Bootstrap.php -->
  2. <?php
  3.  
  4. class Admin_Bootstrap extends Zend_Application_Bootstrap_Bootstrap
  5. {
  6. protected function _initAutoload()
  7. {
  8.  
  9. $autoloader = new Zend_Application_Module_Autoloader(array(
  10. 'namespace' => 'Admin',
  11. 'basePath' => dirname(__FILE__)
  12. ));
  13.  
  14. return $autoloader;
  15. }
  16.  
  17. }
  18.  
  19.  
  20. <!-- Bootstrap.php -->
  21. <?php
  22.  
  23. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
  24. {
  25. protected function _initAutoload()
  26. {
  27. $view = $this->bootstrap('view')->getResource('view')->addHelperPath(APPLICATION_PATH . '/views/helpers');
  28.  
  29. $autoloader = new Zend_Application_Module_Autoloader(array(
  30. 'namespace' => 'My',
  31. 'basePath' => dirname(__FILE__),
  32. ));
  33.  
  34. // var_dump($autoloader->getDefaultResourceType());
  35. return $autoloader;
  36. }
  37.  
  38. protected function _initDoctype()
  39. {
  40. $this->bootstrap('view');
  41. $view = $this->getResource('view');
  42. $view->headTitle()->setSeparator(' - ')
  43. ->append('Retrodoc ' . APPLICATION_ENV);
  44. $view->headMeta()->appendHttpEquiv('Content-Type', 'application/xhtml+xml; charset=utf-8');
  45.  
  46. $view->doctype('XHTML1_STRICT');
  47.  
  48. ZendX_JQuery::enableView($view);
  49.  
  50. $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
  51. $viewRenderer->setView($view);
  52. Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
  53.  
  54.  
  55. }
  56.  
  57. protected function _initAuth()
  58. {
  59. $auth = Zend_Auth::getInstance();
  60. }
  61.  
  62. protected function _initNavigation()
  63. {
  64. $view = $this->bootstrap('layout')->getResource('layout')->getView();
  65. $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
  66.  
  67. $view->navigation(new Zend_Navigation($config));
  68. }
  69.  
  70. protected function _initUserInformations() {
  71. $session = new Zend_Session_Namespace('User');
  72.  
  73. // $session->id =
  74. }
  75.  
  76. protected function _initPlugins() {
  77. // register plugins
  78. $frontController = Zend_Controller_Front::getInstance();
  79. $dbAdapter = Zend_Registry::get('dbAdapter');
  80.  
  81. // $pluginDebug = new My_Plugin_Debug(array('database_adapter' => $dbAdapter, 'memory_usage' => true, 'collect_view_vars' => true));
  82. }
  83.  
  84. protected function _initFireBugPhp() {
  85. $writer = new Zend_Log_Writer_Firebug();
  86. $logger = new Zend_Log($writer);
  87. Zend_Registry::set('logger',$logger);
  88. }
  89.  
  90. }
  91.  
  92. <!-- application.ini -->
  93. ; application/configs/application.ini
  94.  
  95. [production]
  96. ; PHP settings we want to initialize
  97. phpSettings.display_startup_errors = 0
  98. phpSettings.display_errors = 0
  99. includePaths.library = APPLICATION_PATH "/../library"
  100. bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
  101. bootstrap.class = "Bootstrap"
  102.  
  103. ; frontcontroller resources
  104. resources.frontController.plugins.access = "My_Plugin_Access"
  105. resources.frontController.plugins.layout = "My_Plugin_Layout"
  106. resources.frontController.throwException = true;
  107. resources.view[] =
  108. resources.frontController.controllerDirectory.default = APPLICATION_PATH "/modules/default/controllers"
  109. resources.frontController.controllerDirectory.admin = APPLICATION_PATH "/modules/admin/controllers"
  110. resources.frontController.controllerDirectory.xml = APPLICATION_PATH "/modules/xml/controllers"
  111. resources.frontController.controllerDirectory.note = APPLICATION_PATH "/modules/note/controllers"
  112. resources.modules[] = ""
  113.  
  114. ; so auto-loading will find our classes in library/App
  115. autoloaderNamespaces[] = "My_"
  116.  
  117. ; set our language
  118. resources.translate.registry_key = "Zend_Translate"
  119. resources.translate.adapter = "array"
  120. resources.translate.options.scan = "directory"
  121. resources.translate.data = APPLICATION_PATH "/lang/"
  122.  
  123. ; layout
  124. resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
  125.  
  126. ; initialize database
  127. resources.db.adapter = "PDO_MYSQL"
  128. resources.db.params.host = "localhost"
  129. resources.db.params.username = "root"
  130. resources.db.params.password = "root"
  131. resources.db.params.dbname = "retrodoc_prod"
  132.  
  133. [staging : production]
  134.  
  135. [testing : production]
  136. phpSettings.display_startup_errors = 1
  137. phpSettings.display_errors = 1
  138. resources.db.params.dbname = APPLICATION_PATH "/../data/db/guestbook-testing.db"
  139.  
  140. [development : production]
  141. phpSettings.display_startup_errors = 1
  142. phpSettings.display_errors = 1
  143. resources.db.params.dbname = APPLICATION_PATH "/../data/db/guestbook-dev.db"
  144. resources.db.params.dbname = "retrodoc_dev"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement