public function connect($host, $user, $password, $database = '', $port = '', $socket = '', $connect = false) {

        // if the "memcache" extension is loaded and the caching method is set to "memcache"
        if (!extension_loaded('memcache') || $this->caching_method == 'memcache')

            // suppress the warning telling the developer to use memcache for caching query results
            unset($this->warnings['memcache']);

        // we are using lazy-connection
        // that is, we are not going to actually connect to the database until we execute the first query
        // the actual connection is done by the _connected method
        $this->credentials = array(
            'host'      => $host,
            'user'      => $user,
            'password'  => $password,
            'database'  => $database,
            'port'      => $port == '' ? ini_get('mysqli.default_port') : $port,
            'socket'    => $socket == '' ? ini_get('mysqli.default_socket') : $socket,
        );

        // connect now, if we need to connect right away
        if ($connect) $this->_connected();

    }