From a95bea94c8b9c0b38f8575c462d5e35db110d150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 5 Sep 2015 13:57:05 +0200 Subject: [PATCH] Simplify constructing URIs --- composer.json | 2 +- src/Client.php | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 92f258c..231158b 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "php": ">=5.3", "react/event-loop": "~0.4.0|~0.3.0", "react/promise": "~2.1|~1.1", - "clue/buzz-react": "~0.4.0", + "clue/buzz-react": "~0.4.1", "ext-simplexml": "*", "neitanod/forceutf8": "~1.4" }, diff --git a/src/Client.php b/src/Client.php index b16a3b6..bd6a716 100644 --- a/src/Client.php +++ b/src/Client.php @@ -48,9 +48,9 @@ public function fetchFile($path, $revision = null) return $this->fetch( $this->browser->resolve( - '/{+path}?view=co{&pathrev}', + '{+path}?view=co{&pathrev}', array( - 'path' => ltrim($path, '/'), + 'path' => $path, 'pathrev' => $revision ) ) @@ -68,9 +68,9 @@ public function fetchDirectory($path, $revision = null, $showAttic = false) return $this->fetchXml( $this->browser->resolve( - '/{+path}{?pathrev,hideattic}', + '{+path}{?pathrev,hideattic}', array( - 'path' => ltrim($path, '/'), + 'path' => $path, 'pathrev' => $revision, 'hideattic' => $showAttic ? '0' : null ) @@ -87,9 +87,9 @@ public function fetchPatch($path, $r1, $r2) { return $this->fetch( $this->browser->resolve( - '/{+path}?view=patch{&r1,r2}', + '{+path}?view=patch{&r1,r2}', array( - 'path' => ltrim($path, '/'), + 'path' => $path, 'r1' => $r1, 'r2' => $r2 ) @@ -103,9 +103,9 @@ public function fetchLog($path, $revision = null) return $this->fetchXml( $this->browser->resolve( - '/{+path}?view=log{&pathrev}', + '{+path}?view=log{&pathrev}', array( - 'path' => ltrim($path, '/'), + 'path' => $path, 'pathrev' => $revision ) ) @@ -132,9 +132,9 @@ private function fetchLogXml($path) { return $this->fetchXml( $this->browser->resolve( - '/{+path}?view=log', + '{+path}?view=log', array( - 'path' => ltrim($path, '/') + 'path' => $path ) ) );