✏️ 正在编辑: Bootstrap.php
路径:
/srv/systems_dir/oakberry/application/Bootstrap.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php require_once(APPLICATION_PATH . '/../vendor/autoload.php'); class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initPluginLoaderCache() { $classFileIncCache = APPLICATION_PATH . '/../data/cache/pluginLoaderCache.php'; if( file_exists($classFileIncCache) ){ include_once $classFileIncCache; } Zend_Loader_PluginLoader::setIncludeFileCache($classFileIncCache); } protected function _initDoctype() { $this->bootstrap('view'); $view = $this->getResource('view'); $view->doctype(Zend_View_Helper_Doctype::HTML5); } protected function _initNamespace() { $this->_bootstrap('db'); $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->registerNamespace(array( 'Validators', 'String', 'Core', 'File')); } protected function _initNavigation() { $role = is_object(Yuppie_Auth::getIdentity()) ? Yuppie_Auth::getIdentity()->grupo : null; $navigation = APPLICATION_PATH . '/configs/navigation.xml'; $this->bootstrap('layout'); $layout = $this->getResource('layout'); $view = $layout->getView(); $acl = new Core_LibraryAcl($role); Zend_Registry::set('acl', $acl); $config = new Zend_Config_Xml($navigation, 'nav'); $navigation = new Zend_Navigation($config); $view->navigation($navigation)->setAcl($acl)->setRole($role); Zend_View_Helper_Navigation_HelperAbstract::setDefaultAcl($acl); Zend_View_Helper_Navigation_HelperAbstract::setDefaultRole($role); } protected function _initViewHelpers() { $this->bootstrap('layout'); $layout = $this->getResource('layout'); $view = $layout->getView(); $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper'); $view->addHelperPath('Yuppie/View/Helper', 'Yuppie_View_Helper'); $view->addHelperPath('Bootstrap/View/Helper', 'Bootstrap_View_Helper'); $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer (); $viewRenderer->setView($view); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); } protected function _initPlugins() { // We're getting the Front Controller here $front = Zend_Controller_Front::getInstance(); // The plugins need to be registered with the Front Controller - or else they'll just be ignored $front->registerPlugin(new Plugin_Auth()); } protected function _initTimeZone() { setlocale(LC_TIME, "pt_BR", "pt_BR.iso-8859-1", "pt_BR.utf-8", "portuguese"); date_default_timezone_set('America/Recife'); } protected function _initLocale() { $locale = new Zend_Locale('pt_BR'); Zend_Registry::set('Zend_Locale', $locale); } protected function _initPaginator() { Zend_Paginator::setDefaultScrollingStyle('Sliding'); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); } protected function _initUploadDirAndConstant() { $uploadPath = PUBLIC_PATH . '/../public/uploads'; if( !file_exists($uploadPath) ){ if( !mkdir($uploadPath) ){ throw new Exception('Cannot make the following directorry: ' . $uploadPath); } } // if $uploadPath was created than define a constant defined('UPLOAD_PATH') || define('UPLOAD_PATH', $uploadPath); } protected function _initZFDebug() { $this->bootstrap('db'); $zfdebug = $this->getOption('zfdebug'); if($zfdebug) { $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->registerNamespace('ZFDebug'); $cache = $this->getResource('cachemanager')->getCache('database'); $options = array( 'plugins' => array('Variables', 'Database' => array('adapter' => Zend_Db_Table::getDefaultAdapter()), 'File' => array('basePath' => APPLICATION_PATH . '../'), 'Memory', 'Time', 'Cache' => array('backend' => $cache->getBackend()), 'Exception' ) ); $debug = new ZFDebug_Controller_Plugin_Debug($options); $this->bootstrap('frontController'); $frontController = $this->getResource('frontController'); $frontController->registerPlugin($debug); } } }
💾 保存文件
← 返回文件管理器