PHP Класс lithium\analysis\logger\adapter\Growl

Наследование: extends lithium\core\Object
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_autoConfig array Allow the Growl connection resource to be auto-configured from constructor parameters.
$_connection resource Holds the connection resource used to send messages to Growl.
$_priorities array Array that maps Logger message priority names to Growl-compatible priority levels.
$_registered boolean Registration only needs to happen once, but may fail for several reasons, including inability to connect to the server, or the server requires a password which has not been specified.

Открытые методы

Метод Описание
__construct ( array $config = [] ) : void Constructor. Growl logger constructor. Accepts an array of settings which are merged with the default settings and used to create the connection and handle notifications.
__destruct ( ) : void Destructor. Closes and releases the socket connection to Growl.
notify ( string $description = '', array $options = [] ) : boolean Posts a new notification to the Growl server.
write ( string $priority, string $message, array $options = [] ) : Closure Writes $message to a new Growl notification.

Защищенные методы

Метод Описание
_connection ( ) : resource Creates a connection to the Growl server using the protocol, host and port configurations specified in the constructor.
_register ( ) : boolean Growl server connection registration and initialization.
_send ( string $data ) : boolean Sends binary data to the Growl server.

Описание методов

__construct() публичный Метод

Constructor. Growl logger constructor. Accepts an array of settings which are merged with the default settings and used to create the connection and handle notifications.
См. также: lithium\analysis\Logger::write()
public __construct ( array $config = [] ) : void
$config array The settings to configure the logger. Available settings are as follows: - `'name`' _string_: The name of the application as it should appear in Growl's system settings. Defaults to the directory name containing your application. - `'host'` _string_: The Growl host with which to communicate, usually your local machine. Use this setting to send notifications to another machine on the network. Defaults to `'127.0.0.1'`. - `'port'` _integer_: Port of the host machine. Defaults to the standard Growl port, `9887`. - `'password'` _string_: Only required if the host machine requires a password. If notification or registration fails, check this against the host machine's Growl settings. - '`protocol'` _string_: Protocol to use when opening socket communication to Growl. Defaults to `'udp'`. - `'title'` _string_: The default title to display when showing Growl messages. The default value is the same as `'name'`, but can be changed on a per-message basis by specifying a `'title'` key in the `$options` parameter of `Logger::write()`. - `'notification'` _array_: A list of message types you wish to register with Growl to be able to send. Defaults to `array('Errors', 'Messages')`.
Результат void

__destruct() публичный Метод

Destructor. Closes and releases the socket connection to Growl.
public __destruct ( ) : void
Результат void

_connection() защищенный Метод

Creates a connection to the Growl server using the protocol, host and port configurations specified in the constructor.
protected _connection ( ) : resource
Результат resource Returns a connection resource created by `fsockopen()`.

_register() защищенный Метод

Growl server connection registration and initialization.
protected _register ( ) : boolean
Результат boolean True

_send() защищенный Метод

Sends binary data to the Growl server.
protected _send ( string $data ) : boolean
$data string The raw binary data to send to the Growl server.
Результат boolean Always returns `true`.

notify() публичный Метод

Posts a new notification to the Growl server.
public notify ( string $description = '', array $options = [] ) : boolean
$description string Message to be displayed.
$options array Options consists of: -'title': The title of the displayed notification. Displays the name of the application's parent folder by default.
Результат boolean Always returns `true`.

write() публичный Метод

Writes $message to a new Growl notification.
public write ( string $priority, string $message, array $options = [] ) : Closure
$priority string The `Logger`-based priority of the message. This value is mapped to a Growl-specific priority value if possible.
$message string Message to be shown.
$options array Any options that are passed to the `notify()` method. See the `$options` parameter of `notify()`.
Результат Closure Function returning boolean `true` on successful write, `false` otherwise.

Описание свойств

$_autoConfig защищенное свойство

Allow the Growl connection resource to be auto-configured from constructor parameters.
protected array $_autoConfig
Результат array

$_connection защищенное свойство

Holds the connection resource used to send messages to Growl.
protected resource $_connection
Результат resource

$_priorities защищенное свойство

Array that maps Logger message priority names to Growl-compatible priority levels.
protected array $_priorities
Результат array

$_registered защищенное свойство

Registration only needs to happen once, but may fail for several reasons, including inability to connect to the server, or the server requires a password which has not been specified.
protected bool $_registered
Результат boolean