From 3e239cfbf8a62024dac197d122527c8bb8c410ac Mon Sep 17 00:00:00 2001 From: Cyril SAINT-YVES Date: Mon, 10 Jul 2017 11:45:03 +0200 Subject: [PATCH] Fixed Group search and Repository files --- lib/Gitlab/Api/Groups.php | 3 ++- lib/Gitlab/Api/Repositories.php | 12 ++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/Gitlab/Api/Groups.php b/lib/Gitlab/Api/Groups.php index 4ec574d64..efab70600 100644 --- a/lib/Gitlab/Api/Groups.php +++ b/lib/Gitlab/Api/Groups.php @@ -23,7 +23,8 @@ public function all($page = 1, $per_page = self::PER_PAGE) */ public function search($query, $page = 1, $per_page = self::PER_PAGE) { - return $this->get('groups?search='.$this->encodePath($query), array( + return $this->get('groups', array( + 'search' => $this->encodePath($query), 'page' => $page, 'per_page' => $per_page )); diff --git a/lib/Gitlab/Api/Repositories.php b/lib/Gitlab/Api/Repositories.php index bb6e842e8..343f7f12c 100644 --- a/lib/Gitlab/Api/Repositories.php +++ b/lib/Gitlab/Api/Repositories.php @@ -253,8 +253,7 @@ public function blob($project_id, $sha, $filepath) */ public function getFile($project_id, $file_path, $ref) { - return $this->get($this->getProjectPath($project_id, 'repository/files'), array( - 'file_path' => $file_path, + return $this->get($this->getProjectPath($project_id, 'repository/files/'.$this->encodePath($file_path)), array( 'ref' => $ref )); } @@ -272,8 +271,7 @@ public function getFile($project_id, $file_path, $ref) */ public function createFile($project_id, $file_path, $content, $branch_name, $commit_message, $encoding = null, $author_email = null, $author_name = null) { - return $this->post($this->getProjectPath($project_id, 'repository/files'), array( - 'file_path' => $file_path, + return $this->post($this->getProjectPath($project_id, 'repository/files/'.$this->encodePath($file_path)), array( 'branch_name' => $branch_name, 'content' => $content, 'commit_message' => $commit_message, @@ -296,8 +294,7 @@ public function createFile($project_id, $file_path, $content, $branch_name, $com */ public function updateFile($project_id, $file_path, $content, $branch_name, $commit_message, $encoding = null, $author_email = null, $author_name = null) { - return $this->put($this->getProjectPath($project_id, 'repository/files'), array( - 'file_path' => $file_path, + return $this->put($this->getProjectPath($project_id, 'repository/files/'.$this->encodePath($file_path)), array( 'branch_name' => $branch_name, 'content' => $content, 'commit_message' => $commit_message, @@ -318,8 +315,7 @@ public function updateFile($project_id, $file_path, $content, $branch_name, $com */ public function deleteFile($project_id, $file_path, $branch_name, $commit_message, $author_email = null, $author_name = null) { - return $this->delete($this->getProjectPath($project_id, 'repository/files'), array( - 'file_path' => $file_path, + return $this->delete($this->getProjectPath($project_id, 'repository/files/'.$this->encodePath($file_path)), array( 'branch_name' => $branch_name, 'commit_message' => $commit_message, 'author_email' => $author_email,