mirror of
https://github.com/Seldaek/monolog.git
synced 2025-02-24 06:52:34 +01:00
Add sound support
Add support for the default API sounds
This commit is contained in:
parent
607f20d4f9
commit
3df597f1c5
@ -30,6 +30,17 @@ class PushoverHandler extends SocketHandler
|
||||
|
||||
private $highPriorityLevel;
|
||||
private $emergencyLevel;
|
||||
|
||||
/**
|
||||
* Sounds the api supports by default
|
||||
* @see https://pushover.net/api#sounds
|
||||
* @var array
|
||||
*/
|
||||
private $sounds = array(
|
||||
'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming',
|
||||
'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb',
|
||||
'persistent', 'echo', 'updown', 'none',
|
||||
);
|
||||
|
||||
/**
|
||||
* @param string $token Pushover api token
|
||||
@ -89,6 +100,10 @@ class PushoverHandler extends SocketHandler
|
||||
} elseif ($record['level'] >= $this->highPriorityLevel) {
|
||||
$dataArray['priority'] = 1;
|
||||
}
|
||||
|
||||
if (isset($record['sound']) && in_array($record['sound'], $this->sounds)) {
|
||||
$dataArray['sound'] = $record['sound'];
|
||||
}
|
||||
|
||||
return http_build_query($dataArray);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user