(thinkphp323 )Driver.class.php

student097 2017-08-15 10:28:00
请教一下各位,new Driver/Mysql()时,在构造函数中只操作了config数组,没见到调用connect方法,那么实例化Mysql类是怎么连接数据库的?

/**
* 架构函数 读取数据库配置信息
* @access public
* @param array $config 数据库配置数组
*/
public function __construct($config=''){
if(!empty($config)) {
$this->config = array_merge($this->config,$config);
if(is_array($this->config['params'])){
$this->options = $this->config['params'] + $this->options;
}
}
}
/**
* 连接数据库方法
* @access public
*/
public function connect($config='',$linkNum=0,$autoConnection=false) {
}
...全文
95 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
大纲007 2017-08-15
  • 打赏
  • 举报
回复
323版本bug太多,建议用版本5吧!

4,251

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧