示例#1
0
 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);
 }