private function __construct($config = null) { self::$_CONFIG = empty($config) ? DBConfig::$MYSQL_MASTER_SERVER : $config; try { $this->_link = new mysqli(self::$_CONFIG['host'], self::$_CONFIG['username'], self::$_CONFIG['password'], self::$_CONFIG['database'], self::$_CONFIG['port'] ? intval(self::$_CONFIG['port']) : 3306); if ($this->_link) { $this->_link->set_charset('utf8'); } } catch (Exception $e) { Log::error($e->getMessage() . mysqli_connect_errno(), 'Mysqli'); } }