X-Git-Url: https://git.cweiske.de/shpub.git/blobdiff_plain/bb34295b8772673294bc77c9f4ce93af57281208..613d09d06d7bab3c6d91fd1b5b231e54c7304480:/src/shpub/Request.php diff --git a/src/shpub/Request.php b/src/shpub/Request.php index dce163f..e7c3b77 100644 --- a/src/shpub/Request.php +++ b/src/shpub/Request.php @@ -93,6 +93,17 @@ class Request $cp = new CurlPrinter(); $cp->show($this->req, $this->uploadsInfo, $this->dedicatedBody); } + + if ($this->cfg->dryRun && $this->req->getMethod() != 'GET') { + //do not run any modifying queries + //fake a successful response + $res = new \HTTP_Request2_Response('HTTP/1.1 200 OK', false); + $res->parseHeaderLine('Content-type: text/plain'); + $res->parseHeaderLine('Location: http://example.org/fake-response'); + $res->appendBody('Fake --dry-run response'); + return $res; + } + $res = $this->req->send(); if (intval($res->getStatus() / 100) != 2) {