X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2FController%2FGithub%2FRepo.php;h=64fbb9dbb67459bcac988e5d9f5eb31cfaa0809e;hb=2198c781a021d85ee845f2f4b2f5c322f73e6bd5;hp=813b942bf0c2ec7f72345f29049b2ef9977070d5;hpb=c05a8f703d5a097355b5813154c264c87e3f71fe;p=pharext%2Fpharext.org diff --git a/app/Controller/Github/Repo.php b/app/Controller/Github/Repo.php index 813b942..64fbb9d 100644 --- a/app/Controller/Github/Repo.php +++ b/app/Controller/Github/Repo.php @@ -10,17 +10,22 @@ class Repo extends Github function __invoke(array $args = null) { extract($args); if ($this->checkToken()) { - 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"))) { - $action = $this->app->getRequest()->getQuery($modal); - $this->app->getView()->addData(compact("modal", "action")); - } - - $this->app->display("github/repo"); + $this->github->readRepo("$owner/$name")->then( + new RepoCallback($this->github) + )->done(function($result) use($owner, $name) { + list($repo) = $result; + $hook = $this->github->checkRepoHook($repo); + + $this->app->getView()->addData(compact("owner", "name", "repo", "hook")); + }); + $this->github->drain(); + } + + if (($modal = $this->app->getRequest()->getQuery("modal"))) { + $action = $this->app->getRequest()->getQuery($modal); + $this->app->getView()->addData(compact("modal", "action")); } + + $this->app->display("github/repo"); } }