- function delHook($owner, $repo) {
- $this->github->fetchRepo("$owner/$repo", function($repo) {
- $this->github->fetchHooks($repo->full_name, function($hooks) use($repo) {
- $repo->hooks = $hooks;
- if (($hook = $this->checkRepoHook($repo))) {
- $this->github->deleteRepoHook($repo->full_name, $hook->id, function() use($repo) {
- if (($cache = $this->github->getCacheStorage())) {
- $cache->del($this->github->getCacheKey("hooks:" . $repo->full_name));
- }
- if (($back = $this->app->getRequest()->getForm("returnback")) && isset($this->session->previous)) {
- $this->app->redirect($this->app->getBaseUrl()->mod($this->session->previous));
- } else {
- $this->app->redirect($this->app->getBaseUrl()->mod("./github/repo/" . $repo->full_name));
- }
- });
- }
- });
- })->send();
+ function redirectBack($repo) {
+ if (($back = $this->app->getRequest()->getForm("returnback")) && isset($this->session->previous)) {
+ $this->app->redirect($this->app->getBaseUrl()->mod($this->session->previous));
+ } else {
+ $this->app->redirect($this->app->getBaseUrl()->mod(":./github/repo/" . $repo));
+ }