Properties

$processors

$processors : callable[]

Type

callable[]

$formatter

$formatter : ?\Monolog\Formatter\FormatterInterface

Type

FormatterInterface

$level

$level : int

Type

int

$bubble

$bubble : bool

Type

bool

$connectionString

$connectionString : string

Type

string

$connectionTimeout

$connectionTimeout : float

Type

float

$timeout

$timeout : float

Type

float

$writingTimeout

$writingTimeout : float

Type

float

$lastSentBytes

$lastSentBytes : ?int

Type

?int

$chunkSize

$chunkSize : ?int

Type

?int

$persistent

$persistent : bool

Type

bool

$errno

$errno : ?int

Type

?int

$errstr

$errstr : ?string

Type

?string

$lastWritingAt

$lastWritingAt : ?float

Type

?float

$token

$token : string

Type

string

$title

$title : string

Type

string

$retry

$retry : int

Type

int

$expire

$expire : int

Type

int

$highPriorityLevel

$highPriorityLevel : int

Type

int

$emergencyLevel

$emergencyLevel : int

Type

int

$useFormattedMessage

$useFormattedMessage : bool

Type

bool

$parameterNames

$parameterNames : array<string,bool>

All parameters that can be sent to Pushover

Type

array

$sounds

$sounds : string[]

Sounds the api supports by default

Type

string[]

Methods

__construct()

__construct(string  $token, string|array  $users, string|null  $title = null, mixed  $level = Logger::CRITICAL, bool  $bubble = true, bool  $useSSL = true, string|int  $highPriorityLevel = Logger::CRITICAL, string|int  $emergencyLevel = Logger::EMERGENCY, int  $retry = 30, int  $expire = 25200, bool  $persistent = false, float  $timeout = 0.0, float  $writingTimeout = 10.0, ?float  $connectionTimeout = null, ?int  $chunkSize = null) : mixed

Parameters

string $token

Pushover api token

string|array $users

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

string|null $title

Title sent to the Pushover API

mixed $level
bool $bubble
bool $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.

string|int $highPriorityLevel

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

string|int $emergencyLevel

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

int $retry

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

int $expire

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

bool $persistent

Flag to enable/disable persistent connections

float $timeout

Socket timeout to wait until the request is being aborted

float $writingTimeout

Socket timeout to wait until the request should've been sent/written

?float $connectionTimeout

Socket connect timeout to wait until the connection should've been established

?int $chunkSize

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

Returns

mixed —

close()

close() : void

Closes the handler.

closeSocket()

closeSocket() : void

Close socket, if open

setPersistent()

setPersistent(bool  $persistent) : self

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

Parameters

bool $persistent

Returns

self —

setConnectionTimeout()

setConnectionTimeout(float  $seconds) : self

Set connection timeout. Only has effect before we connect.

Parameters

float $seconds

Returns

self —

setTimeout()

setTimeout(float  $seconds) : self

Set write timeout. Only has effect before we connect.

Parameters

float $seconds

Returns

self —

setWritingTimeout()

setWritingTimeout(float  $seconds) : self

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

Parameters

float $seconds

0 for no timeout

Returns

self —

setChunkSize()

setChunkSize(int  $bytes) : self

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

Parameters

int $bytes

Returns

self —

getConnectionString()

getConnectionString() : string

Get current connection string

Returns

string —

isPersistent()

isPersistent() : bool

Get persistent setting

Returns

bool —

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 —

getChunkSize()

getChunkSize() : ?int

Get current chunk size

Returns

?int —

isConnected()

isConnected() : bool

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

bool —

handle()

handle(array  $record) : bool

{@inheritDoc}

Parameters

array $record

Returns

bool —

reset()

reset() : void

pushProcessor()

pushProcessor(callable  $callback) : \Monolog\Handler\HandlerInterface

{@inheritDoc}

Parameters

callable $callback

Returns

\Monolog\Handler\HandlerInterface —

popProcessor()

popProcessor() : callable

{@inheritDoc}

Returns

callable —

setFormatter()

setFormatter(\Monolog\Formatter\FormatterInterface  $formatter) : \Monolog\Handler\HandlerInterface

{@inheritDoc}

Parameters

\Monolog\Formatter\FormatterInterface $formatter

Returns

\Monolog\Handler\HandlerInterface —

getFormatter()

getFormatter() : \Monolog\Formatter\FormatterInterface

{@inheritDoc}

Returns

\Monolog\Formatter\FormatterInterface —

isHandling()

isHandling(array  $record) : bool

{@inheritDoc}

Parameters

array $record

Returns

bool —

setLevel()

setLevel(mixed  $level) : self

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

Parameters

mixed $level

Returns

self —

getLevel()

getLevel() : int

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

Returns

int —

setBubble()

setBubble(bool  $bubble) : self

Sets the bubbling behavior.

Parameters

bool $bubble

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

Returns

self —

getBubble()

getBubble() : bool

Gets the bubbling behavior.

Returns

bool —

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

handleBatch()

handleBatch(array  $records) : void

Handles a set of records at once.

Parameters

array $records

The records to handle (an array of record arrays)

__destruct()

__destruct() : mixed

Returns

mixed —

__sleep()

__sleep() : mixed

Returns

mixed —

setHighPriorityLevel()

setHighPriorityLevel(int|string  $value) : self

Parameters

int|string $value

Returns

self —

setEmergencyLevel()

setEmergencyLevel(int|string  $value) : self

Parameters

int|string $value

Returns

self —

useFormattedMessage()

useFormattedMessage(bool  $value) : self

Use the formatted message?

Parameters

bool $value

Returns

self —

write()

write(array  $record) : void

Connect (if necessary) and write to the socket

{@inheritDoc}

Parameters

array $record

pfsockopen()

pfsockopen() : resource|false

Wrapper to allow mocking

Returns

resource|false —

fsockopen()

fsockopen() : resource|false

Wrapper to allow mocking

Returns

resource|false —

streamSetTimeout()

streamSetTimeout() : bool

Wrapper to allow mocking

Returns

bool —

streamSetChunkSize()

streamSetChunkSize() : int|bool

Wrapper to allow mocking

Returns

int|bool —

fwrite()

fwrite(string  $data) : int|bool

Wrapper to allow mocking

Parameters

string $data

Returns

int|bool —

streamGetMetadata()

streamGetMetadata() : array|bool

Wrapper to allow mocking

Returns

array|bool —

generateDataStream()

generateDataStream(array  $record) : string

Parameters

array $record

Returns

string —

getResource()

getResource() : resource|null

Returns

resource|null —

processRecord()

processRecord(array  $record) : array

Processes a record.

Parameters

array $record

Returns

array —

resetProcessors()

resetProcessors() : void

getDefaultFormatter()

getDefaultFormatter() : \Monolog\Formatter\FormatterInterface

Gets the default formatter.

Overwrite this if the LineFormatter is not a good default for your handler.

Returns

\Monolog\Formatter\FormatterInterface —

validateTimeout()

validateTimeout(float  $value) : void

Parameters

float $value

connectIfNotConnected()

connectIfNotConnected() : void

connect()

connect() : void

createSocketResource()

createSocketResource() : void

setSocketTimeout()

setSocketTimeout() : void

setStreamChunkSize()

setStreamChunkSize() : void

writeToSocket()

writeToSocket(string  $data) : void

Parameters

string $data

writingIsTimedOut()

writingIsTimedOut(int  $sent) : bool

Parameters

int $sent

Returns

bool —

buildContent()

buildContent(array  $record) : string

Parameters

array $record

Returns

string —

buildHeader()

buildHeader(string  $content) : string

Parameters

string $content

Returns

string —