Property | Type | Description | |
---|---|---|---|
$_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. |
Method | Description | |
---|---|---|
__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. |
Method | Description | |
---|---|---|
_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. |
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')`. |
return | void |
public __destruct ( ) : void | ||
return | void |
protected _connection ( ) : resource | ||
return | resource | Returns a connection resource created by `fsockopen()`. |
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. |
return | boolean | Always returns `true`. |
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()`. |
return | Closure | Function returning boolean `true` on successful write, `false` otherwise. |
protected array $_autoConfig | ||
return | array |
protected resource $_connection | ||
return | resource |
protected array $_priorities | ||
return | array |
protected bool $_registered | ||
return | boolean |