Properties

$level

$level : 

Type

$bubble

$bubble : 

Type

$processors

$processors : 

Type

$connectionString

$connectionString : 

Type

$connectionTimeout

$connectionTimeout : 

Type

$resource

$resource : 

Type

$timeout

$timeout : 

Type

$writingTimeout

$writingTimeout : 

Type

$lastSentBytes

$lastSentBytes : 

Type

$persistent

$persistent : 

Type

$errno

$errno : 

Type

$errstr

$errstr : 

Type

$lastWritingAt

$lastWritingAt : 

Type

$token

$token : 

Type

$users

$users : 

Type

$title

$title : 

Type

$user

$user : 

Type

$retry

$retry : 

Type

$expire

$expire : 

Type

$highPriorityLevel

$highPriorityLevel : 

Type

$emergencyLevel

$emergencyLevel : 

Type

$useFormattedMessage

$useFormattedMessage : 

Type

$parameterNames

$parameterNames : array

All parameters that can be sent to Pushover

Type

array

$sounds

$sounds : array

Sounds the api supports by default

Type

array

Methods

__construct()

__construct(string  $token, string|array  $users, string  $title = null, integer  $level = \Monolog\Logger::CRITICAL, Boolean  $bubble = true, Boolean  $useSSL = true, integer  $highPriorityLevel = \Monolog\Logger::CRITICAL, integer  $emergencyLevel = \Monolog\Logger::EMERGENCY, integer  $retry = 30, integer  $expire = 25200) 

Parameters

string $token

Pushover api token

string|array $users

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

string $title

Title sent to the Pushover API

integer $level

The minimum logging level at which this handler will be triggered

Boolean $bubble

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

Boolean $useSSL

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.

integer $highPriorityLevel

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

integer $emergencyLevel

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

integer $retry

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

integer $expire

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

close()

close() 

Closes the handler.

This will be called automatically when the object is destroyed

closeSocket()

closeSocket() 

Close socket, if open

setPersistent()

setPersistent(boolean  $persistent) 

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

Parameters

boolean $persistent

setConnectionTimeout()

setConnectionTimeout(float  $seconds) 

Set connection timeout. Only has effect before we connect.

Parameters

float $seconds

setTimeout()

setTimeout(float  $seconds) 

Set write timeout. Only has effect before we connect.

Parameters

float $seconds

setWritingTimeout()

setWritingTimeout(float  $seconds) 

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

Parameters

float $seconds

0 for no timeout

getConnectionString()

getConnectionString() : string

Get current connection string

Returns

string

isPersistent()

isPersistent() : boolean

Get persistent setting

Returns

boolean

getConnectionTimeout()

getConnectionTimeout() : float

Get current connection timeout setting

Returns

float

getTimeout()

getTimeout() : float

Get current in-transfer timeout

Returns

float

getWritingTimeout()

getWritingTimeout() : float

Get current local writing timeout

Returns

float

isConnected()

isConnected() : boolean

Check to see if the socket is currently available.

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

Returns

boolean

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record

isHandling()

isHandling(array  $record) : Boolean

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

This is mostly done for performance reasons, to avoid calling processors for nothing.

Handlers should still check the record levels within handle(), returning false in isHandling() is no guarantee that handle() will not be called, and isHandling() might not be called for a given record.

Parameters

array $record

Partial log record containing only a level key

Returns

Boolean

handleBatch()

handleBatch(array  $records) 

Handles a set of records at once.

Parameters

array $records

The records to handle (an array of record arrays)

pushProcessor()

pushProcessor(callable  $callback) : self

Adds a processor in the stack.

Parameters

callable $callback

Returns

self

popProcessor()

popProcessor() : callable

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

Returns

callable

setLevel()

setLevel(integer|string  $level) : self

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

Parameters

integer|string $level

Level or level name

Returns

self

getLevel()

getLevel() : integer

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

Returns

integer

setBubble()

setBubble(Boolean  $bubble) : self

Sets the bubbling behavior.

Parameters

Boolean $bubble

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

Returns

self

getBubble()

getBubble() : Boolean

Gets the bubbling behavior.

Returns

Boolean —

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

__destruct()

__destruct() 

setHighPriorityLevel()

setHighPriorityLevel(  $value) 

Parameters

$value

setEmergencyLevel()

setEmergencyLevel(  $value) 

Parameters

$value

useFormattedMessage()

useFormattedMessage(boolean  $value) 

Use the formatted message?

Parameters

boolean $value

write()

write(array  $record) : void

Connect (if necessary) and write to the socket

Parameters

array $record

pfsockopen()

pfsockopen() 

Wrapper to allow mocking

fsockopen()

fsockopen() 

Wrapper to allow mocking

streamSetTimeout()

streamSetTimeout() 

Wrapper to allow mocking

fwrite()

fwrite(  $data) 

Wrapper to allow mocking

Parameters

$data

streamGetMetadata()

streamGetMetadata() 

Wrapper to allow mocking

generateDataStream()

generateDataStream(  $record) 

Parameters

$record

getResource()

getResource() : resource|null

Returns

resource|null

processRecord()

processRecord(array  $record) : array

Processes a record.

Parameters

array $record

Returns

array

validateTimeout()

validateTimeout(  $value) 

Parameters

$value

connectIfNotConnected()

connectIfNotConnected() 

connect()

connect() 

createSocketResource()

createSocketResource() 

setSocketTimeout()

setSocketTimeout() 

writeToSocket()

writeToSocket(  $data) 

Parameters

$data

writingIsTimedOut()

writingIsTimedOut(  $sent) 

Parameters

$sent

buildContent()

buildContent(  $record) 

Parameters

$record

buildHeader()

buildHeader(  $content) 

Parameters

$content