lithium\analysis\logger\adapter\Growl::notify PHP Method

notify() public method

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.
return boolean Always returns `true`.
    public function notify($description = '', $options = array())
    {
        $this->_register();
        $defaults = array('sticky' => false, 'priority' => 0, 'type' => 'Messages');
        $options += $defaults + array('title' => $this->_config['title']);
        $type = $options['type'];
        $title = $options['title'];
        $message = compact('type', 'title', 'description') + array('app' => $this->_config['name']);
        $message = array_map('utf8_encode', $message);
        $flags = ($options['priority'] & 7) * 2;
        $flags = $options['priority'] < 0 ? $flags |= 8 : $flags;
        $flags = $options['sticky'] ? $flags | 256 : $flags;
        $params = array('c2n5', static::PROTOCOL_VERSION, static::TYPE_NOTIFY, $flags);
        $lengths = array_map('strlen', $message);
        $data = call_user_func_array('pack', array_merge($params, $lengths));
        $data .= join('', $message);
        $data .= pack('H32', md5($data . $this->_config['password']));
        $this->_send($data);
        return true;
    }