[XQZone General] Bug fixing for PHP driver
raff at aromatic.org
Mon Oct 18 21:09:24 PDT 2004
Here is an updated version of the PHP driver.
The main change is a bug fix (or hack ?) to make Windows happy. For some
reason on Windows the response header contains both the response to a HEAD
request (that "curl" does to check if the server requires authentication)
and to the POST for the query. The "curl" documentation says this can happen
if the response to the HEAD request contains a body (that is illegal
according to the HTTP specs). The XDBC server doesn't return a body, but it
does return a Content-Length (that is legal according to the spec, but that
I guess other servers don't return on an answer to HEAD). In any case I was
stopping at the first Content-Type to check if the response was a multipart,
but the Content-Type for the first request was "text/html". Now I simply
scan the full header, skip lines without ":" (to skip the 2nd response
status) and override the 1st Content-Type with the second (that is the one I
Other minor changes:
- the "x-type" for the HTTP header is now "x-header"
- the "x-type" for a non-multipart response (that should never happen) is
- the default value for $flags in xdbc_query is XDBC_ARRAY (so if you don't
need to log-in you can call 'xdbc_query($server, $query)'
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3966 bytes
Desc: not available
Url : http://xqzone.marklogic.com/pipermail/general/attachments/20041018/0d420f85/xdbc.obj
More information about the General