9dian房间guan理系统(3)
2023-07-17 来源:百合文库
self::$config=$dbConfig;
if(empty(self::$config['params']))self::$config['params']=array();
if(!isset(self::$link)){
$configs=self::$config;
if(self::$pconnect){
//开启长连接,添加到配置数组中
$configs['params'][constant("PDO::ATTR_PERSISTENT")]=true;}
try{
self::$link=new PDO($configs['dsn'],$configs['username'],$configs['password'],$configs['params']);
}catch(PDOException $e){
self::throw_exception($e->getMessage());}
if(!self::$link){
if(empty(self::$config['params']))self::$config['params']=array();
if(!isset(self::$link)){
$configs=self::$config;
if(self::$pconnect){
//开启长连接,添加到配置数组中
$configs['params'][constant("PDO::ATTR_PERSISTENT")]=true;}
try{
self::$link=new PDO($configs['dsn'],$configs['username'],$configs['password'],$configs['params']);
}catch(PDOException $e){
self::throw_exception($e->getMessage());}
if(!self::$link){