[PHP] Zend中使用工厂模式 →→→→→进入此内容的聊天室

来自 , 2019-08-24, 写在 PHP, 查看 135 次.
URL http://www.code666.cn/view/d3d80b65
  1. <?php
  2.  
  3. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
  4. {
  5.     function __construct($app)
  6.     {
  7.         parent::__construct($app);
  8.        
  9.         $url = constant('APPLICATION_PATH') . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR . 'config.ini';
  10.        
  11.         $dbconfig = new Zend_Config_Ini($url, null, true);
  12.        
  13.         $db = Zend_Db::factory($dbconfig->general->db->adapter, $dbconfig->general->db->params->toArray());
  14.        
  15.         //            var_dump($db);
  16.        
  17.         $db->query('SET NAMES UTF8');
  18.        
  19.         Zend_Db_Table::setDefaultAdapter($db);
  20.        
  21.     }
  22.    
  23. }
  24.  
  25. ?>

回复 "Zend中使用工厂模式"

这儿你可以回复上面这条便签

captcha