yet another github api refactoring
authorMichael Wallner <mike@php.net>
Wed, 13 May 2015 08:18:12 +0000 (10:18 +0200)
committerMichael Wallner <mike@php.net>
Wed, 13 May 2015 08:18:12 +0000 (10:18 +0200)
29 files changed:
app/Controller/Github.php
app/Controller/Github/Callback.php
app/Controller/Github/Hook/Receive.php
app/Controller/Github/Index.php
app/Controller/Github/Repo.php
app/Controller/Github/RepoHook.php
app/Github/API.php
app/Github/API/Call.php
app/Github/API/Callback.php [new file with mode: 0644]
app/Github/API/Hooks/CreateHook.php
app/Github/API/Hooks/HooksCallback.php [new file with mode: 0644]
app/Github/API/Hooks/ListHooks.php
app/Github/API/Hooks/UpdateHook.php
app/Github/API/Releases/CreateRelease.php
app/Github/API/Releases/CreateReleaseAsset.php
app/Github/API/Releases/ListReleaseAssets.php
app/Github/API/Releases/ListReleases.php
app/Github/API/Repos/ContentsCallback.php [new file with mode: 0644]
app/Github/API/Repos/ListRepos.php
app/Github/API/Repos/ReadContents.php
app/Github/API/Repos/ReadRepo.php
app/Github/API/Repos/ReleasesCallback.php [new file with mode: 0644]
app/Github/API/Repos/RepoCallback.php [new file with mode: 0644]
app/Github/API/Repos/ReposCallback.php [new file with mode: 0644]
app/Github/API/Tags/ListTags.php
app/Github/API/Tags/TagsCallback.php [new file with mode: 0644]
app/Github/API/Users/ReadAuthToken.php
app/Github/API/Users/ReadAuthUser.php
app/views/github/repo.phtml

index 364f0e584424fa2a1438605f746f14ecf655c5b6..164f3205134070d8464ca6927382151f9f050594 100644 (file)
@@ -35,7 +35,7 @@ abstract class Github implements Controller
                        "location" => "github", 
                        "title" => "Github"
                ]);
-               $this->app->getView()->registerFunction("check", [$this, "checkRepoHook"]);
+               $this->app->getView()->registerFunction("check", [$github, "checkRepoHook"]);
                
                if (($header = $this->app->getRequest()->getHeader("Cache-Control", Header::class))) {
                        $params = $header->getParams();
@@ -57,20 +57,4 @@ abstract class Github implements Controller
                ]));
                return false;
        }
-
-       /**
-        * Check if the pharext webhook is set for the repo and return it
-        * @param object $repo
-        * @return int hook id
-        */
-       function checkRepoHook($repo) {
-               if ($repo->hooks) {
-                       foreach ($repo->hooks as $hook) {
-                               if ($hook->name === "web" && $hook->config->url === $this->github->getConfig()->hook->url) {
-                                       return $hook;
-                               }
-                       }
-               }
-               return null;
-       }
 }
index 1b7f34f1ce1651ff1f43827db0ea7e2c3680c560..646d782f20d52c59676efdbd23a72a39ddd3c5ba 100644 (file)
@@ -4,14 +4,12 @@ namespace app\Controller\Github;
 
 use app\Controller\Github;
 use app\Github\API;
-use app\Github\Exception;
 use app\Model\Accounts;
 use app\Session;
 use app\Web;
 
 class Callback extends Github
 {
-       
        /**
         * @var Accounts
         */
index 62722edf99a75ce3c73fc08812864d1c747a606f..c53878c614123c602cad9aad19140821a03831f6 100644 (file)
@@ -8,7 +8,7 @@ use app\Model\Accounts;
 use app\Web;
 use http\Params;
 use pharext\Task;
-use pharext\SourceDir\Git;
+use pharext\SourceDir;
 
 require_once __DIR__."/../../../../vendor/m6w6/pharext/src/pharext/Version.php";
 
@@ -79,19 +79,22 @@ class Receive implements Controller
        
        private function uploadAssetForRelease($release, $repo) {
                $this->setTokenForUser($repo->owner->login);
-               $asset = $this->createReleaseAsset($release, $repo);
-               $name = sprintf("%s-%s.ext.phar", $repo->name, $release->tag_name);
-               $url = uri_template($release->upload_url, compact("name"));
-               $this->github->createReleaseAsset($url, $asset, "application/phar", function($json) {
-                       $response = $this->app->getResponse();
-                       $response->setResponseCode(201);
-                       $response->setHeader("Location", $json->url);
+               $this->github->listHooks($repo->full_name, function($hooks) use($release, $repo) {
+                       $repo->hooks = $hooks;
+                       $asset = $this->createReleaseAsset($release, $repo);
+                       $name = sprintf("%s-%s.ext.phar", $repo->name, $release->tag_name);
+                       $url = uri_template($release->upload_url, compact("name"));
+                       $this->github->createReleaseAsset($url, $asset, "application/phar", function($json) {
+                               $response = $this->app->getResponse();
+                               $response->setResponseCode(201);
+                               $response->setHeader("Location", $json->url);
+                       });
                })->send();
        }
        
        private function createReleaseAsset($release, $repo) {
                $source = (new Task\GitClone($repo->clone_url, $release->tag_name))->run();
-               $iterator = new Git($source);
+               $iterator = new SourceDir\Git($source);
                $meta = [
                        "header" => sprintf("pharext v%s (c) Michael Wallner <mike@php.net>", \pharext\VERSION),
                        "version" => \pharext\VERSION,
index c0838b7912af788da3fe83c9a276804b617d0818..2b16c7bfe84994bcd67dce0e273e589b7cd0e8a1 100644 (file)
@@ -8,21 +8,11 @@ class Index extends Github
 {
        function __invoke(array $args = null) {
                if ($this->checkToken()) {
-                       $this->github->listRepos(
+                       list($repos, $links) = $this->github->listRepos(
                                $this->app->getRequest()->getQuery("page"), 
-                               [$this, "reposCallback"]
+                               new \app\Github\API\Repos\ReposCallback($this->github)
                        )->send();
-                       $this->app->display("github/index");
-               }
-       }
-
-       function reposCallback($repos, $links) {
-               $this->app->getView()->addData(compact("repos", "links"));
-
-               foreach ($repos as $repo) {
-                       $this->github->listHooks($repo->full_name, function($hooks) use($repo) {
-                               $repo->hooks = $hooks;
-                       });
+                       $this->app->display("github/index", compact("repos", "links"));
                }
        }
 }
index ac2ce37d5916cebdb2a3fc68e8cb39f4c2fa1202..813b942bf0c2ec7f72345f29049b2ef9977070d5 100644 (file)
@@ -3,79 +3,24 @@
 namespace app\Controller\Github;
 
 use app\Controller\Github;
+use app\Github\API\Repos\RepoCallback;
 
 class Repo extends Github
 {
        function __invoke(array $args = null) {
                extract($args);
-               $this->app->getView()->addData(compact("owner", "name"));
                if ($this->checkToken()) {
-                       $this->github->readRepo(
-                               "$owner/$name",
-                               [$this, "repoCallback"]
-                       )->send();
+                       list($repo) = $this->github->readRepo("$owner/$name", new RepoCallback($this->github))->send();
+                       $hook = $this->github->checkRepoHook($repo);
+                       
+                       $this->app->getView()->addData(compact("owner", "name", "repo", "hook"));
                        
                        if (($modal = $this->app->getRequest()->getQuery("modal"))) {
-                               $this->app->getView()->addData(compact("modal") + [
-                                       "action" => $this->app->getRequest()->getQuery($modal)
-                               ]);
+                               $action = $this->app->getRequest()->getQuery($modal);
+                               $this->app->getView()->addData(compact("modal", "action")); 
                        }
                        
                        $this->app->display("github/repo");
                }
        }
-
-       function repoCallback($repo) {
-               $this->app->getView()->addData(compact("repo") + [
-                       "title" => "Github: {$repo->name}"
-               ]);
-               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));
-               $this->github->readContents($repo->full_name, null, $this->createContentsCallback($repo));
-       }
-
-       function createReleasesCallback($repo) {
-               return function($releases, $links) use($repo) {
-                       foreach ($releases as $release) {
-                               $tag = $release->tag_name;
-                               settype($repo->tags->$tag, "object");
-                               $repo->tags->$tag->release = $release;
-                               $this->github->listReleaseAssets($repo->full_name, $release->id, function($assets) use($release) {
-                                       $release->assets = $assets;
-                               });
-                       }
-               };
-       }
-
-       function createTagsCallback($repo) {
-               return function($tags, $links) use ($repo) {
-                       foreach ($tags as $tag) {
-                               $name = $tag->name;
-                               settype($repo->tags->$name, "object");
-                               $repo->tags->$name->tag = $tag;
-                       }
-               };
-       }
-       
-       function createContentsCallback($repo) {
-               return function($tree) use($repo) {
-                       foreach ($tree as $entry) {
-                               if ($entry->type !== "file" || $entry->size <= 0) {
-                                       continue;
-                               }
-                               if ($entry->name === "config.m4" || fnmatch("config?.m4", $entry->name)) {
-                                       $repo->config_m4 = $entry->name;
-                               } elseif ($entry->name === "package.xml" || $entry->name === "package2.xml") {
-                                       $repo->package_xml = $entry->name;
-                               } elseif ($entry->name === "pharext_package.php") {
-                                       $repo->pharext_package_php = $entry->name;
-                               }
-                       }
-               };
-       }
 }
index 023763a5ffef707622b04ad80debf643e7cb74ad..39f6f1bb7acab299442e92f0ca50fc30c3c107bf 100644 (file)
@@ -48,7 +48,7 @@ class RepoHook extends Github
                $this->github->readRepo("$owner/$repo", function($repo) {
                        $call = $this->github->listHooks($repo->full_name, function($hooks, $links) use($repo, &$call) {
                                $repo->hooks = $hooks;
-                               if (($hook = $this->checkRepoHook($repo))) {
+                               if (($hook = $this->github->checkRepoHook($repo))) {
                                        $hook_conf = $this->app->getRequest()->getForm();
                                        $this->github->updateRepoHook($repo->full_name, $hook->id, $hook_conf, function($changed_hook) use($repo, $hook, $hooks, $links, &$call) {
                                                foreach ($changed_hook as $key => $val) {
@@ -66,7 +66,7 @@ class RepoHook extends Github
                $this->github->readRepo("$owner/$repo", function($repo) {
                        $call = $this->github->listHooks($repo->full_name, function($hooks) use($repo, &$call) {
                                $repo->hooks = $hooks;
-                               if (($hook = $this->checkRepoHook($repo))) {
+                               if (($hook = $this->github->checkRepoHook($repo))) {
                                        $this->github->deleteRepoHook($repo->full_name, $hook->id, function() use($repo, &$call) {
                                                $call->dropFromCache();
                                                $this->redirectBack($repo->full_name);
index d6990f257edf7fc80fa8c04961e4687d35df251d..1c9ff7834e772a92cc8fb758bb8701bfaae6bf88 100644 (file)
@@ -168,6 +168,22 @@ class API
                return $call($callback);
        }
 
+       /**
+        * Check if the pharext webhook is set for the repo and return it
+        * @param object $repo
+        * @return stdClass hook
+        */
+       function checkRepoHook($repo) {
+               if ($repo->hooks) {
+                       foreach ($repo->hooks as $hook) {
+                               if ($hook->name === "web" && $hook->config->url === $this->config->hook->url) {
+                                       return $hook;
+                               }
+                       }
+               }
+               return null;
+       }
+
        function listHooks($repo, callable $callback) {
                $call = new API\Hooks\ListHooks($this, compact("repo"));
                return $call($callback);
index d4afd19eeb3c375408162728293622a2f2e2b12c..22a69516e3f7fb60d466e3eac46b1522e6e13122 100644 (file)
@@ -35,6 +35,11 @@ abstract class Call
         */
        protected $query;
        
+       /**
+        * @var array
+        */
+       protected $result;
+       
        /**
         * Queue this call to the API client
         */
@@ -58,8 +63,8 @@ abstract class Call
        }
        
        function __invoke(callable $callback) {
-               if ($this->readFromCache($cached)) {
-                       call_user_func_array($callback, $cached);
+               if ($this->readFromCache($this->result)) {
+                       call_user_func_array($callback, $this->result);
                } else {
                        $this->enqueue($callback);
                }
@@ -79,7 +84,8 @@ abstract class Call
         * Call Client::send()
         */
        function send() {
-               return $this->api->getClient()->send();
+               $this->api->getClient()->send();
+               return $this->result;
        }
        
        /**
diff --git a/app/Github/API/Callback.php b/app/Github/API/Callback.php
new file mode 100644 (file)
index 0000000..04b9ed6
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+namespace app\Github\API;
+
+use app\Github\API;
+
+abstract class Callback
+{
+       protected $api;
+       
+       abstract function __invoke($json, $links = null);
+       
+       function __construct(API $api) {
+               $this->api = $api;
+       }
+}
index 866e93964236bdd12bccdb95c2025d5db3368553..8e7c050e0c0ff1b62b9bb46b9b11c56379f429b9 100644 (file)
@@ -39,6 +39,7 @@ class CreateHook extends Call
                        if ($response->getResponseCode() >= 400 || null === ($json = json_decode($response->getBody()))) {
                                throw new RequestException($response);
                        }
+                       $this->result = [$json];
                        $callback($json);
                        return true;
                });
diff --git a/app/Github/API/Hooks/HooksCallback.php b/app/Github/API/Hooks/HooksCallback.php
new file mode 100644 (file)
index 0000000..f520844
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+namespace app\Github\API\Hooks;
+
+use app\Github\API;
+use app\Github\API\Callback;
+
+class HooksCallback extends Callback
+{
+       private $repo;
+       
+       function __construct(API $api, $repo) {
+               parent::__construct($api);
+               $this->repo = $repo;
+       }
+       
+       function __invoke($json, $links = null) {
+               $this->repo->hooks = $json;
+       }
+}
index 6cd784e13c07961e33d2abfae19c653eb2c361f7..3d8237e992d87b9d110211221428f3ba0015acdf 100644 (file)
@@ -20,7 +20,8 @@ class ListHooks extends Call
                                throw new RequestException($response);
                        }
                        $links = new Links($response->getHeader("Link"));
-                       $this->saveToCache([$json, $links]);
+                       $this->result = [$json, $links];
+                       $this->saveToCache($this->result);
                        $callback($json, $links);
                        return true;
                });
index cd249bad2b7bb544fbfaf147566af44bb28926cd..1fb8231cdfde9c8d7d1de044426dfdda1955ea52 100644 (file)
@@ -25,6 +25,7 @@ class UpdateHook extends \app\Github\API\Call
                        if ($response->getResponseCode() >= 400 || null === ($json = json_decode($response->getBody()))) {
                                throw new \app\Github\Exception\RequestException($response);
                        }
+                       $this->result = [$json];
                        $callback($json);
                        return true;
                });
index 21f849f6d6d298f656370c13bba94dd02c4a189f..5942f0ce1ea0ab4d2c5f31670ab6516a8abde45f 100644 (file)
@@ -22,6 +22,7 @@ class CreateRelease extends Call
                        if ($response->getResponseCode() >= 400 || null === ($json = json_decode($response->getBody()))) {
                                throw new RequestException($response);
                        }
+                       $this->result = [$json];
                        $callback($json);
                        return true;
                });
index c69d8056cd7a8e003829b08bd0f9e577db45df5d..88b5a493bb8a1a4482b680a3a55b23902d8875ee 100644 (file)
@@ -20,6 +20,7 @@ class CreateReleaseAsset extends Call
                        if ($response->getResponseCode() >= 400 || null === ($json = json_decode($response->getBody()))) {
                                throw new RequestException($response);
                        }
+                       $this->result = [$json];
                        $callback($json);
                        return true;
                });
index bde9096b99930fee7e0f39e93824c3cd9bfca5ea..2aaaaad900a2a9fd7f84f0333c0a20e6d18cc77e 100644 (file)
@@ -20,7 +20,8 @@ class ListReleaseAssets extends Call
                                throw new RequestException($response);
                        }
                        $links = new Links($response->getHeader("Link"));
-                       $this->saveToCache([$json, $links]);
+                       $this->result = [$json, $links];
+                       $this->saveToCache($this->result);
                        $callback($json, $links);
                        return true;
                });
index c1760b95bcec2c9cdebec3f630ef6c9f17383360..bb1e158109fd25720ee185d755830ead366e68eb 100644 (file)
@@ -20,7 +20,8 @@ class ListReleases extends Call
                                throw new RequestException($response);
                        }
                        $links = new Links($response->getHeader("Link"));
-                       $this->saveToCache([$json, $links]);
+                       $this->result = [$json, $links];
+                       $this->saveToCache($this->result);
                        $callback($json, $links);
                        return true;
                });
diff --git a/app/Github/API/Repos/ContentsCallback.php b/app/Github/API/Repos/ContentsCallback.php
new file mode 100644 (file)
index 0000000..c08c3c2
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace app\Github\API\Repos;
+
+use app\Github\API;
+use app\Github\API\Callback;
+
+class ContentsCallback extends Callback
+{
+       private $repo;
+       
+       function __construct(API $api, $repo) {
+               parent::__construct($api);
+               $this->repo = $repo;
+       }
+       
+       function __invoke($json, $links = null) {
+               foreach ($json as $entry) {
+                       if ($entry->type !== "file" || $entry->size <= 0) {
+                               continue;
+                       }
+                       if ($entry->name === "config.m4" || fnmatch("config?.m4", $entry->name)) {
+                               $this->repo->config_m4 = $entry->name;
+                       } elseif ($entry->name === "package.xml" || $entry->name === "package2.xml") {
+                               $this->repo->package_xml = $entry->name;
+                       } elseif ($entry->name === "pharext_package.php") {
+                               $this->repo->pharext_package_php = $entry->name;
+                       }
+               }
+       }
+}
index c84219696004d66ee5fbdec025e9b864309f7798..60767c395e42ef9188cc5744f012022cab6687a3 100644 (file)
@@ -20,7 +20,8 @@ class ListRepos extends Call
                                throw new RequestException($response);
                        }
                        $links = new Links($response->getHeader("Link"));
-                       $this->saveToCache([$json, $links]);
+                       $this->result = [$json, $links];
+                       $this->saveToCache($this->result);
                        $callback($json, $links);
                        return true;
                });
index fde19b88a664cb6bfb462faa3a5f88039e39d001..844df198209cb2aec4d091d0ea3f4d16a7dafd96 100644 (file)
@@ -18,7 +18,8 @@ class ReadContents extends Call
                        if ($response->getResponseCode() >= 400 || null === ($json = json_decode($response->getBody()))) {
                                throw new RequestException($response);
                        }
-                       $this->saveToCache([$json]);
+                       $this->result = [$json];
+                       $this->saveToCache($this->result);
                        $callback($json);
                        return true;
                });
index 775a9ee6fb73cecff7a4a2cf1e4b078621f24c6f..2a82b0879ea7d11e3ed037a8e7dd02459e62dc0c 100644 (file)
@@ -18,7 +18,8 @@ class ReadRepo extends Call
                        if ($response->getResponseCode() >= 400 || null === ($json = json_decode($response->getBody()))) {
                                throw new RequestException($response);
                        }
-                       $this->saveToCache([$json]);
+                       $this->result = [$json];
+                       $this->saveToCache($this->result);
                        $callback($json);
                        return true;
                });
diff --git a/app/Github/API/Repos/ReleasesCallback.php b/app/Github/API/Repos/ReleasesCallback.php
new file mode 100644 (file)
index 0000000..aca8575
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+namespace app\Github\API\Repos;
+
+use app\Github\API;
+use app\Github\API\Callback;
+
+class ReleasesCallback extends Callback
+{
+       private $repo;
+       
+       function __construct(API $api, $repo) {
+               parent::__construct($api);
+               $this->repo = $repo;
+       }
+       
+       function __invoke($json, $links = null) {
+               settype($this->repo->tags, "object");
+               foreach ($json as $release) {
+                       $tag = $release->tag_name;
+                       settype($this->repo->tags->$tag, "object");
+                       $this->repo->tags->$tag->release = $release;
+                       $this->api->listReleaseAssets($this->repo->full_name, $release->id, function($assets) use($release) {
+                               $release->assets = $assets;
+                       });
+               }
+       }
+}
diff --git a/app/Github/API/Repos/RepoCallback.php b/app/Github/API/Repos/RepoCallback.php
new file mode 100644 (file)
index 0000000..a3621a5
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+namespace app\Github\API\Repos;
+
+use app\Github\API\Callback;
+use app\Github\API\Hooks\HooksCallback;
+use app\Github\API\Tags\TagsCallback;
+
+class RepoCallback extends Callback
+{
+       function __invoke($repo, $links = null) {
+               $this->api->listHooks($repo->full_name, new HooksCallback($this->api, $repo));
+               $this->api->listTags($repo->full_name, 1, new TagsCallback($this->api, $repo));
+               $this->api->listReleases($repo->full_name, 1, new ReleasesCallback($this->api, $repo));
+               $this->api->readContents($repo->full_name, null, new ContentsCallback($this->api, $repo));;
+       }
+}
diff --git a/app/Github/API/Repos/ReposCallback.php b/app/Github/API/Repos/ReposCallback.php
new file mode 100644 (file)
index 0000000..78d68c9
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+namespace app\Github\API\Repos;
+
+use app\Github\API\Callback;
+use app\Github\API\Hooks\HooksCallback;
+
+class ReposCallback extends Callback
+{
+       function __invoke($json, $links = null) {
+               foreach ($json as $repo) {
+                       $this->api->listHooks($repo->full_name, new HooksCallback($this->api, $repo));
+               }
+       }
+}
index b7a1d4c8dd4f57c2c1361dbd471d79c6c0fa62fc..fd60a6708aa94d50079c3cd87b48bfe5ddc0b778 100644 (file)
@@ -20,7 +20,8 @@ class ListTags extends Call
                                throw new RequestException($response);
                        }
                        $links = new Links($response->getHeader("Link"));
-                       $this->saveToCache([$json, $links]);
+                       $this->result = [$json, $links];
+                       $this->saveToCache($this->result);
                        $callback($json, $links);
                        return true;
                });
diff --git a/app/Github/API/Tags/TagsCallback.php b/app/Github/API/Tags/TagsCallback.php
new file mode 100644 (file)
index 0000000..99b623b
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+namespace app\Github\API\Tags;
+
+use app\Github\API;
+use app\Github\API\Callback;
+
+class TagsCallback extends Callback
+{
+       private $repo;
+       
+       function __construct(API $api, $repo) {
+               parent::__construct($api);
+               $this->repo = $repo;
+       }
+       
+       function __invoke($json, $links = null) {
+               settype($this->repo->tags, "object");
+               foreach ($json as $tag) {
+                       $name = $tag->name;
+                       settype($this->repo->tags->$name, "object");
+                       $this->repo->tags->$name->tag = $tag;
+               }
+       }
+}
index bc1f03bb5349d4bb50e21ba8786e0490b63a9636..e167eef40e5bd3341b0e1c7939793229e3103dd6 100644 (file)
@@ -18,6 +18,7 @@ class ReadAuthToken extends Call
                        if ($response->getResponseCode() >= 400 || null === ($json = json_decode($response->getBody()))) {
                                throw new RequestException($response);
                        }
+                       $this->result = [$json];
                        $callback($json);
                        return true;
                });
index 6cb6de098a86f38b5cd3cb57dd1e720b599bf62e..b5c4fa92b78382c66a2052eedd3f6927e18d1160 100644 (file)
@@ -18,7 +18,8 @@ class ReadAuthUser extends Call
                        if ($response->getResponseCode() >= 400 || null === ($json = json_decode($response->getBody()))) {
                                throw new RequestException($response);
                        }
-                       $this->saveToCache([$json]);
+                       $this->result = [$json];
+                       $this->saveToCache($this->result);
                        $callback($json);
                        return true;
                });
index ae72691120d0784e0c8d5057d59b1de8709386eb..c1994a87717eba62a0e262bf22fffae7321e3397 100644 (file)
@@ -1,4 +1,4 @@
-<?php $this->layout("layout") ?>
+<?php $this->layout("layout", ["title" => "Github: {$repo->name}"]) ?>
 
 <div class="page-header">
        <h1>