Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/calendar/management/PhabricatorCalendarManagementNotifyWorkflow.php
12256 views
1
<?php
2
3
final class PhabricatorCalendarManagementNotifyWorkflow
4
extends PhabricatorCalendarManagementWorkflow {
5
6
protected function didConstruct() {
7
$this
8
->setName('notify')
9
->setExamples('**notify** [options]')
10
->setSynopsis(
11
pht(
12
'Test and debug notifications about upcoming events.'))
13
->setArguments(
14
array(
15
array(
16
'name' => 'minutes',
17
'param' => 'N',
18
'help' => pht(
19
'Notify about events in the next __N__ minutes (default: 15). '.
20
'Setting this to a larger value makes testing easier.'),
21
),
22
));
23
}
24
25
public function execute(PhutilArgumentParser $args) {
26
$viewer = $this->getViewer();
27
28
$engine = new PhabricatorCalendarNotificationEngine();
29
30
$minutes = $args->getArg('minutes');
31
if ($minutes) {
32
$engine->setNotifyWindow(phutil_units("{$minutes} minutes in seconds"));
33
}
34
35
$engine->publishNotifications();
36
37
return 0;
38
}
39
40
}
41
42