lithium\analysis\logger\adapter\Growl::__construct()

public method

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.

Parameters

  • array $config

    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').

Returns

void

Source

	public function __construct(array $config = []) {
		$name = basename(Libraries::get(true, 'path'));

		$defaults = compact('name') + [
			'host'     => '127.0.0.1',
			'port'     => 9887,
			'password' => null,
			'protocol' => 'udp',
			'title'    => Inflector::humanize($name),
			'notifications' => ['Errors', 'Messages'],
			'registered' => false
		];
		parent::__construct($config + $defaults);
	}