forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsole.php
More file actions
42 lines (38 loc) · 1.51 KB
/
console.php
File metadata and controls
42 lines (38 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
use Illuminate\Foundation\Inspiring;
/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
Artisan::command('notifications:resend {username}', function ($username) {
$user = ProcessMaker\Models\User::where('username', $username)->firstOrFail();
$tokens = ProcessMaker\Models\ProcessRequestToken
::where('status', 'ACTIVE')
->where('user_id', $user->getKey())
->get();
foreach ($tokens as $token) {
dump($token->id);
$notification = new ProcessMaker\Notifications\ActivityActivatedNotification($token);
$user->notify($notification);
}
})->purpose('Resend to user the notifications of his/her active tasks');
Artisan::command('check {path}', function ($path) {
$dom = new DOMDocument;
$dom->load($path);
$query = new DOMXPath($dom);
$nodes = $query->evaluate('//*[@bpmnElement]');
foreach ($nodes as $node) {
$id = $node->getAttribute('bpmnElement');
$elem = $query->evaluate("//*[@id='$id']")->item(0);
dump($elem);
}
})->purpose('Display an inspiring quote');