Menu

## PushoverHandler extends SocketHandler
in package

PushoverHandler.php : 22

Sends notifications through the pushover api to mobile phones

##### Tags

author

  Sebastian Göttschkes sebastian.goettschkes@googlemail.com

see
  https://www.pushover.net/api

### Table of Contents

$bubble : mixed
$formatter : FormatterInterface
$level : mixed
$processors : mixed
$chunkSize : mixed
$connectionString : mixed
$connectionTimeout : mixed
$emergencyLevel : mixed
$errno : mixed
$errstr : mixed
$expire : mixed
$highPriorityLevel : mixed
$lastSentBytes : mixed
$lastWritingAt : mixed
$parameterNames : array<string|int, mixed>
  All parameters that can be sent to Pushover
$persistent : mixed
$resource : mixed
$retry : mixed
$sounds : array<string|int, mixed>
  Sounds the api supports by default
$timeout : mixed
$title : mixed
$token : mixed
$useFormattedMessage : mixed
$user : mixed
$users : mixed
$writingTimeout : mixed
__construct() : mixed
__destruct() : mixed
close() : mixed
  Closes the handler.
closeSocket() : mixed
  Close socket, if open
getBubble() : bool
  Gets the bubbling behavior.
getChunkSize() : float
  Get current chunk size
getConnectionString() : string
  Get current connection string
getConnectionTimeout() : float
  Get current connection timeout setting
getFormatter() : FormatterInterface
  Gets the formatter.
getLevel() : int
  Gets minimum logging level at which this handler will be triggered.
getTimeout() : float
  Get current in-transfer timeout
getWritingTimeout() : float
  Get current local writing timeout
handle() : mixed
  {@inheritdoc}
handleBatch() : mixed
  Handles a set of records at once.
isConnected() : bool
  Check to see if the socket is currently available.
isHandling() : bool
  Checks whether the given record will be handled by this handler.
isPersistent() : bool
  Get persistent setting
popProcessor() : callable
  Removes the processor on top of the stack and returns it.
pushProcessor() : self
  Adds a processor in the stack.
reset() : mixed
setBubble() : self
  Sets the bubbling behavior.
setChunkSize() : mixed
  Set chunk size. Only has effect during connection in the writing cycle.
setConnectionTimeout() : mixed
  Set connection timeout. Only has effect before we connect.
setEmergencyLevel() : mixed
setFormatter() : self
  Sets the formatter.
setHighPriorityLevel() : mixed
setLevel() : self
  Sets minimum logging level at which this handler will be triggered.
setPersistent() : mixed
  Set socket connection to nbe persistent. It only has effect before the connection is initiated.
setTimeout() : mixed
  Set write timeout. Only has effect before we connect.
setWritingTimeout() : mixed
  Set writing timeout. Only has effect during connection in the writing cycle.
useFormattedMessage() : mixed
  Use the formatted message?
fsockopen() : mixed
  Wrapper to allow mocking
fwrite() : mixed
  Wrapper to allow mocking
generateDataStream() : mixed
getDefaultFormatter() : FormatterInterface
  Gets the default formatter.
getResource() : resource|null
pfsockopen() : mixed
  Wrapper to allow mocking
processRecord() : array<string|int, mixed>
  Processes a record.
streamGetMetadata() : mixed
  Wrapper to allow mocking
streamSetChunkSize() : mixed
  Wrapper to allow mocking
streamSetTimeout() : mixed
  Wrapper to allow mocking
write() : void
  Connect (if necessary) and write to the socket
buildContent() : mixed
buildHeader() : mixed
connect() : mixed
connectIfNotConnected() : mixed
createSocketResource() : mixed
setSocketTimeout() : mixed
setStreamChunkSize() : mixed
validateTimeout() : mixed
writeToSocket() : mixed
writingIsTimedOut() : mixed

### Properties

#### $bubble

AbstractHandler.php : 27
`protected mixed $bubble = true`

#### $formatter

AbstractHandler.php : 32
`protected FormatterInterface $formatter`

#### $level

AbstractHandler.php : 26
`protected mixed $level = MonologLogger::DEBUG`

#### $processors

AbstractHandler.php : 33
`protected mixed $processors = array()`

#### $chunkSize

SocketHandler.php : 30
`private mixed $chunkSize = null`

#### $connectionString

SocketHandler.php : 24
`private mixed $connectionString`

#### $connectionTimeout

SocketHandler.php : 25
`private mixed $connectionTimeout`

#### $emergencyLevel

PushoverHandler.php : 32
`private mixed $emergencyLevel`

#### $errno

SocketHandler.php : 32
`private mixed $errno`

#### $errstr

SocketHandler.php : 33
`private mixed $errstr`

#### $expire

PushoverHandler.php : 29
`private mixed $expire`

#### $highPriorityLevel

PushoverHandler.php : 31
`private mixed $highPriorityLevel`

#### $lastSentBytes

SocketHandler.php : 29
`private mixed $lastSentBytes = null`

#### $lastWritingAt

SocketHandler.php : 34
`private mixed $lastWritingAt`

#### $parameterNames

PushoverHandler.php : 40

All parameters that can be sent to Pushover

`private array<string|int, mixed> $parameterNames = array('token' => true, 'user' => true, 'message' => true, 'device' => true, 'title' => true, 'url' => true, 'url_title' => true, 'priority' => true, 'timestamp' => true, 'sound' => true, 'retry' => true, 'expire' => true, 'callback' => true)`

##### Tags

see
  https://pushover.net/api

#### $persistent

SocketHandler.php : 31
`private mixed $persistent = false`

#### $resource

SocketHandler.php : 26
`private mixed $resource`

#### $retry

PushoverHandler.php : 28
`private mixed $retry`

#### $sounds

PushoverHandler.php : 61

Sounds the api supports by default

`private array<string|int, mixed> $sounds = array('pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming', 'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb', 'persistent', 'echo', 'updown', 'none')`

##### Tags

see
  https://pushover.net/api#sounds

#### $timeout

SocketHandler.php : 27
`private mixed $timeout = 0`

#### $title

PushoverHandler.php : 26
`private mixed $title`

#### $token

PushoverHandler.php : 24
`private mixed $token`

#### $useFormattedMessage

PushoverHandler.php : 33
`private mixed $useFormattedMessage = false`

#### $user

PushoverHandler.php : 27
`private mixed $user`

#### $users

PushoverHandler.php : 25
`private mixed $users`

#### $writingTimeout

SocketHandler.php : 28
`private mixed $writingTimeout = 10`

### Methods

#### __construct()

PushoverHandler.php : 82
`public __construct(string $token, string|array<string|int, mixed> $users[, string $title = null ][, int $level = Logger::CRITICAL ][, bool $bubble = true ][, bool $useSSL = true ][, int $highPriorityLevel = Logger::CRITICAL ][, int $emergencyLevel = Logger::EMERGENCY ][, int $retry = 30 ][, int $expire = 25200 ]) : mixed`

##### Parameters

$token : string

  Pushover api token

$users : string|array<string|int, mixed>

  Pushover user id or array of ids the message will be sent to

$title : string = null

  Title sent to the Pushover API

$level : int = Logger::CRITICAL

  The minimum logging level at which this handler will be triggered

$bubble : bool = true

  Whether the messages that are handled can bubble up the stack or not

$useSSL : bool = true

  Whether to connect via SSL. Required when pushing messages to users that are not the pushover.net app owner. OpenSSL is required for this option.

$highPriorityLevel : int = Logger::CRITICAL

  The minimum logging level at which this handler will start sending "high priority" requests to the Pushover API

$emergencyLevel : int = Logger::EMERGENCY

  The minimum logging level at which this handler will start sending "emergency" requests to the Pushover API

$retry : int = 30

  The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user.

$expire : int = 25200

  The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds).

##### Return values

mixed —

#### __destruct()

AbstractHandler.php : 167
`public __destruct() : mixed`

##### Return values

mixed —

#### close()

AbstractHandler.php : 68

Closes the handler.

`public close() : mixed`

This will be called automatically when the object is destroyed

##### Return values

mixed —

#### closeSocket()

SocketHandler.php : 76

Close socket, if open

`public closeSocket() : mixed`

##### Return values

mixed —

#### getBubble()

AbstractHandler.php : 162

Gets the bubbling behavior.

`public getBubble() : bool`

##### Return values

bool —

true means that this handler allows bubbling. false means that bubbling is not permitted.

#### getChunkSize()

SocketHandler.php : 196

Get current chunk size

`public getChunkSize() : float`

##### Return values

float —

#### getConnectionString()

SocketHandler.php : 146

Get current connection string

`public getConnectionString() : string`

##### Return values

string —

#### getConnectionTimeout()

SocketHandler.php : 166

Get current connection timeout setting

`public getConnectionTimeout() : float`

##### Return values

float —

#### getFormatter()

AbstractHandler.php : 110

Gets the formatter.

`public getFormatter() : FormatterInterface`

##### Return values

FormatterInterface —

#### getLevel()

AbstractHandler.php : 137

Gets minimum logging level at which this handler will be triggered.

`public getLevel() : int`

##### Return values

int —

#### getTimeout()

SocketHandler.php : 176

Get current in-transfer timeout

`public getTimeout() : float`

##### Return values

float —

#### getWritingTimeout()

SocketHandler.php : 186

Get current local writing timeout

`public getWritingTimeout() : float`

##### Return values

float —

#### handle()

AbstractProcessingHandler.php : 29

{@inheritdoc}

`public handle(array<string|int, mixed> $record) : mixed`

##### Parameters

$record : array<string|int, mixed>

##### Return values

mixed —

#### handleBatch()

AbstractHandler.php : 56

Handles a set of records at once.

`public handleBatch(array<string|int, mixed> $records) : mixed`

##### Parameters

$records : array<string|int, mixed>

  The records to handle (an array of record arrays)

##### Return values

mixed —

#### isConnected()

SocketHandler.php : 208

Check to see if the socket is currently available.

`public isConnected() : bool`

UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details.

##### Return values

bool —

#### isHandling()

AbstractHandler.php : 48

Checks whether the given record will be handled by this handler.

`public isHandling(array<string|int, mixed> $record) : bool`

##### Parameters

$record : array<string|int, mixed>

  Partial log record containing only a level key

##### Return values

bool —

#### isPersistent()

SocketHandler.php : 156

Get persistent setting

`public isPersistent() : bool`

##### Return values

bool —

#### popProcessor()

AbstractHandler.php : 88

Removes the processor on top of the stack and returns it.

`public popProcessor() : callable`

##### Return values

callable —

#### pushProcessor()

AbstractHandler.php : 75

Adds a processor in the stack.

`public pushProcessor(mixed $callback) : self`

##### Parameters

$callback : mixed

##### Return values

self —

#### reset()

AbstractHandler.php : 178
`public reset() : mixed`

##### Return values

mixed —

#### setBubble()

AbstractHandler.php : 149

Sets the bubbling behavior.

`public setBubble(bool $bubble) : self`

##### Parameters

$bubble : bool

  true means that this handler allows bubbling. false means that bubbling is not permitted.

##### Return values

self —

#### setChunkSize()

SocketHandler.php : 136

Set chunk size. Only has effect during connection in the writing cycle.

`public setChunkSize(float $bytes) : mixed`

##### Parameters

$bytes : float

##### Return values

mixed —

#### setConnectionTimeout()

SocketHandler.php : 101

Set connection timeout. Only has effect before we connect.

`public setConnectionTimeout(float $seconds) : mixed`

##### Parameters

$seconds : float

##### Tags

see
  http://php.net/manual/en/function.fsockopen.php

##### Return values

mixed —

#### setEmergencyLevel()

PushoverHandler.php : 172
`public setEmergencyLevel(mixed $value) : mixed`

##### Parameters

$value : mixed

##### Return values

mixed —

#### setFormatter()

AbstractHandler.php : 100

Sets the formatter.

`public setFormatter(FormatterInterface $formatter) : self`

##### Parameters

$formatter : FormatterInterface

##### Return values

self —

#### setHighPriorityLevel()

PushoverHandler.php : 167
`public setHighPriorityLevel(mixed $value) : mixed`

##### Parameters

$value : mixed

##### Return values

mixed —

#### setLevel()

AbstractHandler.php : 125

Sets minimum logging level at which this handler will be triggered.

`public setLevel(int|string $level) : self`

##### Parameters

$level : int|string

  Level or level name

##### Return values

self —

#### setPersistent()

SocketHandler.php : 89

Set socket connection to nbe persistent. It only has effect before the connection is initiated.

`public setPersistent(bool $persistent) : mixed`

##### Parameters

$persistent : bool

##### Return values

mixed —

#### setTimeout()

SocketHandler.php : 114

Set write timeout. Only has effect before we connect.

`public setTimeout(float $seconds) : mixed`

##### Parameters

$seconds : float

##### Tags

see
  http://php.net/manual/en/function.stream-set-timeout.php

##### Return values

mixed —

#### setWritingTimeout()

SocketHandler.php : 125

Set writing timeout. Only has effect during connection in the writing cycle.

`public setWritingTimeout(float $seconds) : mixed`

##### Parameters

$seconds : float

  0 for no timeout

##### Return values

mixed —

#### useFormattedMessage()

PushoverHandler.php : 181

Use the formatted message?

`public useFormattedMessage(bool $value) : mixed`

##### Parameters

$value : bool

##### Return values

mixed —

#### fsockopen()

SocketHandler.php : 225

Wrapper to allow mocking

`protected fsockopen() : mixed`

##### Return values

mixed —

#### fwrite()

SocketHandler.php : 256

Wrapper to allow mocking

`protected fwrite(mixed $data) : mixed`

##### Parameters

$data : mixed

##### Return values

mixed —

#### generateDataStream()

PushoverHandler.php : 96
`protected generateDataStream(mixed $record) : mixed`

##### Parameters

$record : mixed

##### Return values

mixed —

#### getDefaultFormatter()

AbstractHandler.php : 192

Gets the default formatter.

`protected getDefaultFormatter() : FormatterInterface`

##### Return values

FormatterInterface —

#### getResource()

SocketHandler.php : 293
`protected getResource() : resource|null`

##### Return values

resource|null —

#### pfsockopen()

SocketHandler.php : 217

Wrapper to allow mocking

`protected pfsockopen() : mixed`

##### Return values

mixed —

#### processRecord()

AbstractProcessingHandler.php : 58

Processes a record.

`protected processRecord(array<string|int, mixed> $record) : array<string|int, mixed>`

##### Parameters

$record : array<string|int, mixed>

##### Return values

array<string|int, mixed> —

#### streamGetMetadata()

SocketHandler.php : 264

Wrapper to allow mocking

`protected streamGetMetadata() : mixed`

##### Return values

mixed —

#### streamSetChunkSize()

SocketHandler.php : 248

Wrapper to allow mocking

`protected streamSetChunkSize() : mixed`

##### Tags

see
  http://php.net/manual/en/function.stream-set-chunk-size.php

##### Return values

mixed —

#### streamSetTimeout()

SocketHandler.php : 235

Wrapper to allow mocking

`protected streamSetTimeout() : mixed`

##### Tags

see
  http://php.net/manual/en/function.stream-set-timeout.php

##### Return values

mixed —

#### write()

PushoverHandler.php : 155

Connect (if necessary) and write to the socket

`protected write(array<string|int, mixed> $record) : void`

##### Parameters

$record : array<string|int, mixed>

##### Return values

void —

#### buildContent()

PushoverHandler.php : 103
`private buildContent(mixed $record) : mixed`

##### Parameters

$record : mixed

##### Return values

mixed —

#### buildHeader()

PushoverHandler.php : 144
`private buildHeader(mixed $content) : mixed`

##### Parameters

$content : mixed

##### Return values

mixed —

#### connect()

SocketHandler.php : 298
`private connect() : mixed`

##### Return values

mixed —

#### connectIfNotConnected()

SocketHandler.php : 277
`private connectIfNotConnected() : mixed`

##### Return values

mixed —

#### createSocketResource()

SocketHandler.php : 305
`private createSocketResource() : mixed`

##### Return values

mixed —

#### setSocketTimeout()

SocketHandler.php : 318
`private setSocketTimeout() : mixed`

##### Return values

mixed —

#### setStreamChunkSize()

SocketHandler.php : 325
`private setStreamChunkSize() : mixed`

##### Return values

mixed —

#### validateTimeout()

SocketHandler.php : 269
`private validateTimeout(mixed $value) : mixed`

##### Parameters

$value : mixed

##### Return values

mixed —

#### writeToSocket()

SocketHandler.php : 332
`private writeToSocket(mixed $data) : mixed`

##### Parameters

$data : mixed

##### Return values

mixed —

#### writingIsTimedOut()

SocketHandler.php : 361
`private writingIsTimedOut(mixed $sent) : mixed`

##### Parameters

$sent : mixed

##### Return values

mixed —

## Search results