From 917c0fd609f9d91fa6b407c4a1c853f2319eb23b Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 12 May 2015 20:16:00 +0200 Subject: [PATCH] flush --- app/Controller/Github/Hook/Receive.php | 4 +--- app/Controller/Github/Repo.php | 1 + app/views/github/repo.phtml | 28 ++++++++++++++++++++------ app/views/navbar.phtml | 3 ++- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/app/Controller/Github/Hook/Receive.php b/app/Controller/Github/Hook/Receive.php index 48e10ae..62722ed 100644 --- a/app/Controller/Github/Hook/Receive.php +++ b/app/Controller/Github/Hook/Receive.php @@ -80,9 +80,8 @@ class Receive implements Controller private function uploadAssetForRelease($release, $repo) { $this->setTokenForUser($repo->owner->login); $asset = $this->createReleaseAsset($release, $repo); - // FIXME: use uri_template extension $name = sprintf("%s-%s.ext.phar", $repo->name, $release->tag_name); - $url = str_replace("{?name}", "?name=$name", $release->upload_url); + $url = uri_template($release->upload_url, compact("name")); $this->github->createReleaseAsset($url, $asset, "application/phar", function($json) { $response = $this->app->getResponse(); $response->setResponseCode(201); @@ -91,7 +90,6 @@ class Receive implements Controller } private function createReleaseAsset($release, $repo) { - define("STDERR", fopen("/var/log/apache2/php_errors.log", "a")); $source = (new Task\GitClone($repo->clone_url, $release->tag_name))->run(); $iterator = new Git($source); $meta = [ diff --git a/app/Controller/Github/Repo.php b/app/Controller/Github/Repo.php index 32fab56..ac2ce37 100644 --- a/app/Controller/Github/Repo.php +++ b/app/Controller/Github/Repo.php @@ -32,6 +32,7 @@ class Repo extends Github settype($repo->tags, "object"); $this->github->listHooks($repo->full_name, function($hooks) use($repo) { $repo->hooks = $hooks; + $this->app->getView()->addData(["hook" => $this->checkRepoHook($repo)]); }); $this->github->listTags($repo->full_name, 1, $this->createTagsCallback($repo)); $this->github->listReleases($repo->full_name, 1, $this->createReleasesCallback($repo)); diff --git a/app/views/github/repo.phtml b/app/views/github/repo.phtml index 80b5c8c..ae72691 100644 --- a/app/views/github/repo.phtml +++ b/app/views/github/repo.phtml @@ -105,7 +105,7 @@

Is the pharext hook enabled?

- check($repo)) : ?> + YES NO @@ -116,17 +116,33 @@
-
full_name ."/hook/" . ($this->check($repo) ? "upd" : "add")) ?>"> -
+ full_name ."/hook/" . (!empty($hook) ? "upd" : "add")) ?>"> +
+

PHARext Options:

+
+ +
+
"> + +
+
+
+

Hook Options:

@@ -139,7 +155,7 @@
-
+