예제 #1
0
파일: Mysql.php 프로젝트: ZhuJingfa/HuiLib
 protected function __construct($config)
 {
     $driverConfig = empty($config['driver']) ? '' : Front::getInstance()->getAppConfig()->getByKey($config['driver']);
     if (empty($config['driver']) || empty($driverConfig)) {
         throw new \HuiLib\Error\Exception('Log mysql driver ini error');
     }
     $this->driver = DbBase::create($driverConfig);
     if (!$this->driver instanceof \HuiLib\Db\Adapter\Pdo\PdoBase) {
         throw new \HuiLib\Error\Exception('Log mysql driver initialized failed');
     }
     if (empty($config['table'])) {
         throw new \HuiLib\Error\Exception('Log mysql driver table ini error');
     }
     $this->table = $config['table'];
     parent::__construct($config);
 }