public function initByConfig($key, $config)
    {
        if(empty($config))
        {
            throw new Exception('db config is empty');
        }
        $driver = 'Li\\'.ucfirst($config['driver']);

        if(!(isset($this->$key) && $this->$key instanceof $driver))
        {
            $this->$key =  new $driver($config);
        }      

    }
public function initByConfig($key, $config)
    {
        if(empty($config))
        {
            throw new Exception('db config is empty');
        }
        $driver = 'Li\\'.ucfirst($config['driver']);

        if(!(isset($this->$key) && $this->$key instanceof $driver))
        {
            $this->$key =  new $driver($config);
        }      

    }
public function initByConfig ( $ key , $ config ) { if ( empty ( $ config ) ) { throw new Exception ( 'db config is empty' ) ; } $ driver = 'Li\\' . ucfirst ( $ config [ 'driver' ] ) ; if ( ! ( isset ( $ this -> $ key ) && $ this -> $ key instanceof $ driver ) ) { $ this -> $ key = new $ driver ( $ config ) ; } }
init db instance by config
@param $key string the db index
@param $config mixed the config
init db instance by config