@@ -9,18 +9,6 @@ class Plugin extends Base
99{
1010 public function initialize ()
1111 {
12- $ this ->on ('app.bootstrap ' , function ($ container ) {
13- Translator::load ($ container ['config ' ]->getCurrentLanguage (), __DIR__ .'/Locale ' );
14-
15- $ container ['eventManager ' ]->register (WebhookHandler::EVENT_COMMIT , t ('Github commit received ' ));
16- $ container ['eventManager ' ]->register (WebhookHandler::EVENT_ISSUE_OPENED , t ('Github issue opened ' ));
17- $ container ['eventManager ' ]->register (WebhookHandler::EVENT_ISSUE_CLOSED , t ('Github issue closed ' ));
18- $ container ['eventManager ' ]->register (WebhookHandler::EVENT_ISSUE_REOPENED , t ('Github issue reopened ' ));
19- $ container ['eventManager ' ]->register (WebhookHandler::EVENT_ISSUE_ASSIGNEE_CHANGE , t ('Github issue assignee change ' ));
20- $ container ['eventManager ' ]->register (WebhookHandler::EVENT_ISSUE_LABEL_CHANGE , t ('Github issue label change ' ));
21- $ container ['eventManager ' ]->register (WebhookHandler::EVENT_ISSUE_COMMENT , t ('Github issue comment created ' ));
22- });
23-
2412 $ this ->actionManager ->getAction ('\Kanboard\Action\CommentCreation ' )->addEvent (WebhookHandler::EVENT_ISSUE_COMMENT );
2513 $ this ->actionManager ->getAction ('\Kanboard\Action\CommentCreation ' )->addEvent (WebhookHandler::EVENT_COMMIT );
2614 $ this ->actionManager ->getAction ('\Kanboard\Action\TaskAssignCategoryLabel ' )->addEvent (WebhookHandler::EVENT_ISSUE_LABEL_CHANGE );
@@ -35,6 +23,19 @@ public function initialize()
3523 $ this ->route ->addRoute ('/webhook/github/:project_id/:token ' , 'webhook ' , 'handler ' , 'GithubWebhook ' );
3624 }
3725
26+ public function onStartup ()
27+ {
28+ Translator::load ($ this ->language ->getCurrentLanguage (), __DIR__ .'/Locale ' );
29+
30+ $ this ->eventManager ->register (WebhookHandler::EVENT_COMMIT , t ('Github commit received ' ));
31+ $ this ->eventManager ->register (WebhookHandler::EVENT_ISSUE_OPENED , t ('Github issue opened ' ));
32+ $ this ->eventManager ->register (WebhookHandler::EVENT_ISSUE_CLOSED , t ('Github issue closed ' ));
33+ $ this ->eventManager ->register (WebhookHandler::EVENT_ISSUE_REOPENED , t ('Github issue reopened ' ));
34+ $ this ->eventManager ->register (WebhookHandler::EVENT_ISSUE_ASSIGNEE_CHANGE , t ('Github issue assignee change ' ));
35+ $ this ->eventManager ->register (WebhookHandler::EVENT_ISSUE_LABEL_CHANGE , t ('Github issue label change ' ));
36+ $ this ->eventManager ->register (WebhookHandler::EVENT_ISSUE_COMMENT , t ('Github issue comment created ' ));
37+ }
38+
3839 public function getPluginName ()
3940 {
4041 return 'Github Webhook ' ;
@@ -52,7 +53,7 @@ public function getPluginAuthor()
5253
5354 public function getPluginVersion ()
5455 {
55- return '1.0.1 ' ;
56+ return '1.0.2 ' ;
5657 }
5758
5859 public function getPluginHomepage ()
0 commit comments