/** * 构造器 * * @param ConfigObj $config_obj 连接配置对象 */ public function __construct(ConfigObj $config_obj) { $this->conn_name = $config_obj->conn_name(); $config_data = $config_obj->otherConfig(); $config_data['host'] = $config_obj->host(); $config_data['port'] = $config_obj->port(); $auth = strval($config_obj->auth()); if (!empty($auth)) { $config_data['auth'] = $auth; } $config_data['persistent'] = true; $config_data['index'] = $config_obj->database(); $config_data['prefix'] = $config_obj->prefix(); $this->config_data = $config_data; }
/** * 构造器 * * @param ConfigObj $config_obj 连接配置对象 */ public function __construct(ConfigObj $config_obj) { $this->conn_name = $config_obj->conn_name(); $this->config_object = $config_obj; }