Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/infrastructure/daemon/workers/action/PhabricatorLogTriggerAction.php
12242 views
1
<?php
2
3
/**
4
* Trivial action which logs a message.
5
*
6
* This action is primarily useful for testing triggers.
7
*/
8
final class PhabricatorLogTriggerAction
9
extends PhabricatorTriggerAction {
10
11
public function validateProperties(array $properties) {
12
PhutilTypeSpec::checkMap(
13
$properties,
14
array(
15
'message' => 'string',
16
));
17
}
18
19
public function execute($last_epoch, $this_epoch) {
20
$message = pht(
21
'(%s -> %s @ %s) %s',
22
$last_epoch ? date('Y-m-d g:i:s A', $last_epoch) : 'null',
23
date('Y-m-d g:i:s A', $this_epoch),
24
date('Y-m-d g:i:s A', PhabricatorTime::getNow()),
25
$this->getProperty('message'));
26
27
phlog($message);
28
}
29
30
}
31
32