ZendFramewor in php (2) zf + samrtyindex. php configuration & lt ;? Phperror_reporting (E_ALL & amp ;~ E_DEPRECATED & amp ;~ E_NOTICE); date_default_timezone_set (AsiaShanghai); define (R php ZendFramewor (II) zf + samrty index. php configuration
SetFallbackAutoloader (true); $ registry = Zend_Registry: getInstance (); $ config = new Zend_Config_Ini ('.. /application/configs/application. ini ', null, true); Zend_Registry: set ('config', $ config); $ dbAdapter = Zend_Db :: factory ($ config-> database-> db-> adapter, $ config-> database-> db-> config-> toArray ()); $ dbAdapter-> query ('set names utf8'); Zend_Db_Table: setDefaultAdapter ($ dbAdapter); Zend _ Registry: set ('DB', $ dbAdapter); require_once 'zend/Log. php '; require_once' Zend/Log/Writer/Stream. php '; $ logger = new Zend_Log (new Zend_Log_Writer_Stream ('. '. $ config-> log-> logger-> path, 'A + '); Zend_Registry: set ('logger', $ logger); $ view = new Zend_View (); $ view-> setScriptPath ('. /templates/'); $ view-> setHelperPath ('. /templates/helpers ', 'zend _ View_Helper'); $ registry ['View'] = $ view; I Nclude_once (".. /library/Smarty. class. php "); $ smarty = new Smarty (); $ smarty-> caching = false; $ smarty-> template_dir = ". /templates/"; $ smarty-> compile_dir = ". /data/smarty/"; $ smarty-> cache_dir = ". /data/smarty/cache_c/"; // $ smarty-> left_delimiter =" <{"; // $ smarty-> right_delimiter ="}> "; $ registry = Zend_Registry:: getInstance (); $ registry-> set ('smarty ', $ smarty); $ front = Zend_Controller_Fron T: getInstance (); $ front-> setBaseUrl ('/'); $ front-> setParam ('usedefacontrolleralway', true ); $ front-> setParam ('noviewrenderer', true); $ front-> setControllerDirectory ('.. /application/controllers '); $ front-> throwExceptions (true); Zend_Session: start (); require_once 'zend/Application. php '; $ application = new Zend_Application (APPLICATION_ENV, APPLICATION_PATH. '/configs/application. ini' ); $ Application-> bootstrap ()-> run ();?>