813b942bf0c2ec7f72345f29049b2ef9977070d5
[pharext/pharext.org] / app / Controller / Github / Repo.php
1 <?php
2
3 namespace app\Controller\Github;
4
5 use app\Controller\Github;
6 use app\Github\API\Repos\RepoCallback;
7
8 class Repo extends Github
9 {
10 function __invoke(array $args = null) {
11 extract($args);
12 if ($this->checkToken()) {
13 list($repo) = $this->github->readRepo("$owner/$name", new RepoCallback($this->github))->send();
14 $hook = $this->github->checkRepoHook($repo);
15
16 $this->app->getView()->addData(compact("owner", "name", "repo", "hook"));
17
18 if (($modal = $this->app->getRequest()->getQuery("modal"))) {
19 $action = $this->app->getRequest()->getQuery($modal);
20 $this->app->getView()->addData(compact("modal", "action"));
21 }
22
23 $this->app->display("github/repo");
24 }
25 }
26 }