Guest User

Untitled

a guest
Jun 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.18 KB | None | 0 0
  1. ## Bootstrap.php
  2. <?php
  3.  
  4.  
  5. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
  6. {
  7. protected function _initView()
  8. {
  9. // Initialize view
  10. $view = new Zend_View();
  11. $view->doctype('XHTML1_STRICT');
  12.  
  13. // Add it to the ViewRenderer
  14. $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
  15. 'ViewRenderer'
  16. );
  17. $viewRenderer->setView($view);
  18.  
  19. // Return it, so that it can be stored by the bootstrap
  20. return $view;
  21. }
  22.  
  23. protected function _initLibraryNamespaces()
  24. {
  25. $loader = Zend_Loader_Autoloader::getInstance();
  26. $loader->registerNamespace('Lupi_')
  27. ->registerNamespace('Scienta_');
  28. }
  29.  
  30. protected function _initRouting()
  31. {
  32. $router = Zend_Controller_Front::getInstance()->getRouter();
  33.  
  34. $router->addRoute('dbLookup', new Lupi_Controller_Router_Route_DbRoute());
  35.  
  36. $staticRoute = 'Zend_Controller_Router_Route_Static';
  37. $rewriteRoute = 'Zend_Controller_Router_Route';
  38. $router->addRoute('user_login',
  39. new $staticRoute('login',
  40. array('module' => 'default',
  41. 'controller' => 'login',
  42. 'action' => 'login')));
  43. $router->addRoute('user_logout',
  44. new $staticRoute('logout',
  45. array('module' => 'default',
  46. 'controller' => 'login',
  47. 'action' => 'logout')));
  48. $router->addRoute('admin_logout',
  49. new $staticRoute('admin/logout',
  50. array('module' => 'admin',
  51. 'controller' => 'login',
  52. 'action' => 'logout')));
  53. $router->addRoute('admin_login',
  54. new $staticRoute('admin/login',
  55. array('module' => 'admin',
  56. 'controller' => 'login',
  57. 'action' => 'index')));
  58. $router->addRoute('article_year',
  59. new $rewriteRoute('blog/:year',
  60. array('module' => 'default',
  61. 'controller' => 'article',
  62. 'action' => 'year'),
  63. array('year' => '\d+')));
  64. $router->addRoute('article_month',
  65. new $rewriteRoute('blog/:year/:month',
  66. array('module' => 'default',
  67. 'controller' => 'article',
  68. 'action' => 'month'),
  69. array('year' => '\d+',
  70. 'month' => '\d+')));
  71. }
  72.  
  73. ## app.ini
  74.  
  75. [production]
  76. phpSettings.display_startup_errors = 0
  77. phpSettings.display_errors = 0
  78.  
  79. bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
  80. bootstrap.class = "Bootstrap"
  81.  
  82. resources.frontController.moduleControllerDirectoryName = "controllers"
  83. resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
  84. resources.frontController.defaultModule = "default"
  85. resources.frontController.plugins.modulelayout = "Lupi_Controller_Plugin_ModuleLayout"
  86. resources.frontController.plugins.scienta = "Scienta_Controller_Plugin_Debug"
  87.  
  88. resources.db.params.host = "localhost"
  89. resources.db.params.dbname = ""
  90. resources.db.params.username = ""
  91. resources.db.params.password = ""
  92. resources.db.adapter = "Pdo_Mysql"
  93. resources.db.isDefaultTableAdapter = true
  94.  
  95. resources.layout.layout = "default"
  96. resources.layout.layoutPath = APPLICATION_PATH "/modules/default/layouts"
  97.  
  98. resources.view.encoding = "UTF-8"
  99.  
  100.  
  101. [staging : production]
  102.  
  103. [testing : production]
  104. phpSettings.display_startup_errors = 1
  105. phpSettings.display_errors = 1
  106.  
  107. [development : production]
  108. phpSettings.display_startup_errors = 1
  109. phpSettings.display_errors = 1
  110.  
  111. }
Add Comment
Please, Sign In to add comment