@@ -9,16 +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 ('Gitlab commit received ' ));
16- $ container ['eventManager ' ]->register (WebhookHandler::EVENT_ISSUE_OPENED , t ('Gitlab issue opened ' ));
17- $ container ['eventManager ' ]->register (WebhookHandler::EVENT_ISSUE_CLOSED , t ('Gitlab issue closed ' ));
18- $ container ['eventManager ' ]->register (WebhookHandler::EVENT_ISSUE_REOPENED , t ('Gitlab issue reopened ' ));
19- $ container ['eventManager ' ]->register (WebhookHandler::EVENT_ISSUE_COMMENT , t ('Gitlab issue comment created ' ));
20- });
21-
2212 $ this ->actionManager ->getAction ('\Kanboard\Action\CommentCreation ' )->addEvent (WebhookHandler::EVENT_ISSUE_COMMENT );
2313 $ this ->actionManager ->getAction ('\Kanboard\Action\CommentCreation ' )->addEvent (WebhookHandler::EVENT_COMMIT );
2414 $ this ->actionManager ->getAction ('\Kanboard\Action\TaskClose ' )->addEvent (WebhookHandler::EVENT_COMMIT );
@@ -31,6 +21,17 @@ public function initialize()
3121 $ this ->route ->addRoute ('/webhook/gitlab/:project_id/:token ' , 'webhook ' , 'handler ' , 'GitlabWebhook ' );
3222 }
3323
24+ public function onStartup ()
25+ {
26+ Translator::load ($ this ->language ->getCurrentLanguage (), __DIR__ .'/Locale ' );
27+
28+ $ this ->eventManager ->register (WebhookHandler::EVENT_COMMIT , t ('Gitlab commit received ' ));
29+ $ this ->eventManager ->register (WebhookHandler::EVENT_ISSUE_OPENED , t ('Gitlab issue opened ' ));
30+ $ this ->eventManager ->register (WebhookHandler::EVENT_ISSUE_CLOSED , t ('Gitlab issue closed ' ));
31+ $ this ->eventManager ->register (WebhookHandler::EVENT_ISSUE_REOPENED , t ('Gitlab issue reopened ' ));
32+ $ this ->eventManager ->register (WebhookHandler::EVENT_ISSUE_COMMENT , t ('Gitlab issue comment created ' ));
33+ }
34+
3435 public function getPluginName ()
3536 {
3637 return 'Gitlab Webhook ' ;
@@ -48,7 +49,7 @@ public function getPluginAuthor()
4849
4950 public function getPluginVersion ()
5051 {
51- return '1.0.2 ' ;
52+ return '1.0.3 ' ;
5253 }
5354
5455 public function getPluginHomepage ()
0 commit comments