testerArr); } /** * 封号 * @param string $uid */ function isBaned($uid) { return in_array($uid, $this->banedArr); } // 测试号 abstract protected function _InitTester(); // 封号 abstract protected function _InitBaneder(); /** * 初始化paydb */ abstract protected function _InitPaydb(); /** * redis配置 */ abstract protected function _InitNosql(); /** * mongodb配置 */ abstract protected function _InitMongoDB(); /** * @return config 单例 */ static public function Inst() { static $config = null; if (is_null($config)) { $config = include __DIR__ . '/configs/config_' . PLAT . '.php'; } return $config; } /** * 构造函数负责初始化配置数据 */ private function __construct() { $this->_InitTester(); # 测试用户 $this->_InitBaneder(); # 封号用户 $this->paydb = new \stdclass(); $this->paydb->persistant = false; # 持久链接 or not. $this->paydb->driver = 'mysql'; # Must be MySQL. Don't support other database server yet. $this->paydb->encoding = 'UTF8'; # Encoding of database. $this->paydb->strictMode = false; # Turn off the strict mode of MySQL. // $this->paydb->emulatePrepare = true; # PDO::ATTR_EMULATE_PREPARES // $this->paydb->bufferQuery = true; # PDO::MYSQL_ATTR_USE_BUFFERED_QUERY $this->paydb->prefix = ''; # 表前缀 $this->_InitPaydb(); # mysql数据库配置 $this->nosql = new \stdClass(); $this->_InitNosql(); # nosql数据库配置 $this->mongo = new \stdClass(); $this->_InitMongoDB(); # mongodb } }