Skip to content

Commit

Permalink
Adapt for jackrabbit running in tomcat
Browse files Browse the repository at this point in the history
  • Loading branch information
uwej711 committed May 21, 2012
1 parent c49386c commit 043e307
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Jackalope/Transport/Jackrabbit/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ public function getBinaryStream($path)
$curl = $request->execute(true);
switch ($curl->getHeader('Content-Type')) {
case 'text/xml; charset=utf-8':
case 'text/xml;charset=utf-8':
return $this->decodeBinaryDom($curl->getResponse());
case 'jcr-value/binary;charset=utf-8':
case 'jcr-value/binary; charset=utf-8':
Expand Down
4 changes: 2 additions & 2 deletions src/Jackalope/Transport/Jackrabbit/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ protected function handleError(curl $curl, $response, $httpCode)
// TODO extract HTTP status string from response, more descriptive about error

// use XML error response if it's there
if (substr($response, 0, 1) === '<') {
if (substr($response, 0, 2) === '<?') {
$dom = new DOMDocument();
$dom->loadXML($response);
$err = $dom->getElementsByTagNameNS(Client::NS_DCR, 'exception');
Expand Down Expand Up @@ -558,7 +558,7 @@ protected function handleError(curl $curl, $response, $httpCode)
}
}
}
if (404 === $httpCode) {
if (404 == $httpCode) {
throw new PathNotFoundException("HTTP 404 Path Not Found: {$this->method} \n" . $this->getShortErrorString());
} elseif (405 == $httpCode) {
throw new HTTPErrorException("HTTP 405 Method Not Allowed: {$this->method} \n" . $this->getShortErrorString(), 405);
Expand Down

0 comments on commit 043e307

Please sign in to comment.