File tree 3 files changed +89
-0
lines changed 3 files changed +89
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ namespace Webhooks \Wrapper ;
3
+
4
+ use http \Exception \RuntimeException ;
5
+
6
+ set_include_path ('.. ' );
7
+
8
+ require "vendor/autoload.php " ;
9
+
10
+ require ".config " ;
11
+
12
+ $ client = new Trello \Client ();
13
+ $ client ->authenticate ($ key , $ token , Trello \Client::AUTH_URL_CLIENT_ID );
14
+
15
+ $ trello = new Trello ($ client );
16
+
17
+ $ webhook = new Webhook ($ trello );
18
+ $ webhook ->setToken ($ getWebhookToken );
19
+
20
+ $ webhook ->pullFromService ();
21
+
22
+ $ webhook ->setService (null );
23
+ print_r ($ webhook );
Original file line number Diff line number Diff line change
1
+ <?php
2
+ namespace Webhooks \Wrapper ;
3
+
4
+ use http \Exception \RuntimeException ;
5
+
6
+ set_include_path ('.. ' );
7
+
8
+ require "vendor/autoload.php " ;
9
+
10
+ require ".config " ;
11
+
12
+ $ client = new Trello \Client ();
13
+ $ client ->authenticate ($ key , $ token , Trello \Client::AUTH_URL_CLIENT_ID );
14
+
15
+ $ trello = new Trello ($ client );
16
+
17
+ $ webhook = new Webhook ($ trello );
18
+ $ webhook ->setModel ($ updateWebhookModelId );
19
+
20
+ $ action = new Action ("action_move_card_from_list_to_list " );
21
+ $ action ->setName ('Returns the string \'Executed \'' );
22
+ $ action ->addArgument ('return ' , 'Executed ' );
23
+ $ action ->setFunction (function ($ return , $ data , $ action ) {
24
+ print_r ($ data );
25
+ if ($ action ->getWebhook ()->getModel () == $ data ->listBefore ->id ) {
26
+ return 'Moved away ' ;
27
+ }
28
+ if ($ action ->getWebhook ()->getModel () == $ data ->listAfter ->id ) {
29
+ return 'Moved here ' ;
30
+ }
31
+ return $ return ;
32
+ });
33
+
34
+ $ webhook ->setAction ($ action );
35
+
36
+ echo $ webhook ->run ($ runWebhookJson );
Original file line number Diff line number Diff line change
1
+ <?php
2
+ namespace Webhooks \Wrapper ;
3
+
4
+ use http \Exception \RuntimeException ;
5
+
6
+ set_include_path ('.. ' );
7
+
8
+ require "vendor/autoload.php " ;
9
+
10
+ require ".config " ;
11
+
12
+ $ client = new Trello \Client ();
13
+ $ client ->authenticate ($ key , $ token , Trello \Client::AUTH_URL_CLIENT_ID );
14
+
15
+ $ trello = new Trello ($ client );
16
+
17
+ $ webhook = new Webhook ($ trello );
18
+ $ webhook ->setToken ($ getWebhookToken );
19
+
20
+ $ webhook ->pullFromService ();
21
+
22
+ $ webhook ->setUrl ($ updateWebhookNewUrl . $ webhook ->getId ());
23
+ $ webhook ->setModel ($ updateWebhookModelId );
24
+
25
+ $ webhook ->pushToService ();
26
+
27
+ $ webhook ->pullFromService ();
28
+
29
+ $ webhook ->setService (null );
30
+ print_r ($ webhook );
You can’t perform that action at this time.
0 commit comments