62 'pushover',
'bike',
'bugle',
'cashregister',
'classical',
'cosmic',
'falling',
'gamelan',
'incoming',
63 'intermission',
'magic',
'mechanical',
'pianobar',
'siren',
'spacealarm',
'tugboat',
'alien',
'climb',
64 'persistent',
'echo',
'updown',
'none',
84 $connectionString = $useSSL ?
'ssl://api.pushover.net:443' :
'api.pushover.net:80';
88 $this->users = (array)
$users;
89 $this->title =
$title ?: gethostname();
106 $maxMessageLength = 512 - strlen($this->title);
111 $timestamp = $record[
'datetime']->getTimestamp();
114 'token' => $this->token,
115 'user' => $this->
user,
117 'title' => $this->title,
121 if (isset($record[
'level']) && $record[
'level'] >= $this->emergencyLevel) {
122 $dataArray[
'priority'] = 2;
125 } elseif (isset($record[
'level']) && $record[
'level'] >= $this->highPriorityLevel) {
126 $dataArray[
'priority'] = 1;
130 $context = array_intersect_key($record[
'context'], $this->parameterNames);
131 $extra = array_intersect_key($record[
'extra'], $this->parameterNames);
134 $dataArray = array_merge($extra,
$context, $dataArray);
137 if (isset($dataArray[
'sound']) && !in_array($dataArray[
'sound'], $this->sounds)) {
138 unset($dataArray[
'sound']);
141 return http_build_query($dataArray);
146 $header =
"POST /1/messages.json HTTP/1.1\r\n";
147 $header .=
"Host: api.pushover.net\r\n";
148 $header .=
"Content-Type: application/x-www-form-urlencoded\r\n";
149 $header .=
"Content-Length: " . strlen($content) .
"\r\n";
155 protected function write(array $record)
157 foreach ($this->users as
$user) {
169 $this->highPriorityLevel = $value;
174 $this->emergencyLevel = $value;
Stores to any socket - uses fsockopen() or pfsockopen().
generateDataStream($record)
static toMonologLevel($level)
Converts PSR-3 levels to Monolog ones if necessary.
setHighPriorityLevel($value)
setEmergencyLevel($value)
catch(Exception $e) $message
useFormattedMessage($value)
Use the formatted message?
const EMERGENCY
Urgent alert.
const CRITICAL
Critical conditions.
foreach($mandatory_scripts as $file) $timestamp
__construct($token, $users, $title=null, $level=Logger::CRITICAL, $bubble=true, $useSSL=true, $highPriorityLevel=Logger::CRITICAL, $emergencyLevel=Logger::EMERGENCY, $retry=30, $expire=25200)
closeSocket()
Close socket, if open.
Sends notifications through the pushover api to mobile phones.