If you are in trouble, perhaps this page will give you a solution.
Troubleshooting
-
The response times are slow
You can reduced timeout period on a stream (socket) to connect/read. Default is 30 secondes, like php.ini
default_socket_timeout
directive.
<?php require_once 'Net/Growl/Autoload.php'; $notifications = array( 'GROWL_NOTIFY_PHPERROR' ); $appName = 'PHP App Example using GNTP'; $password = ''; $app = new Net_Growl_Application( $appName, $notifications, $password ); $options = array( 'protocol' => 'gntp', 'timeout' => 15 ); $growl = Net_Growl::singleton($app, null, null, $options); $growl->register(); ?>
You can also suppress timeout by setting value to zero. -
Notifications are not displayed
-
Are you sure Growl is running (not stopped or paused) ?
-
Check if your application and the notification type used is well registered
-
If your application is well registered, check if notifications display are enabled
-
Password provided by your application is probably unknown of Growl client (see Password Manager on Security Tab)
-
Check if your code produces error/exceptions.
<?php require_once 'Net/Growl/Autoload.php'; $notifications = array( 'GROWL_NOTIFY_PHPERROR' ); $appName = 'PHP App Example using GNTP'; $password = ''; $options = array( 'protocol' => 'gntp', ); try { $growl = Net_Growl::singleton($appName, $notifications, $password, $options); $growl->register(); } catch (Net_Growl_Exception $e) { echo 'Caught Growl exception: ' . $e->getMessage() . PHP_EOL; } ?>
All errors produced by Net_Growl raise a Net_Growl_Exception
-
-
Net_Growl is not really verbose
To known what MIME messages are sent and received from Growl, activate the
verbose
mode. Give a valid path to a filename ondebug
option.<?php require_once 'Net/Growl/Autoload.php'; $notifications = array( 'GROWL_NOTIFY_PHPERROR' ); $appName = 'PHP App Example using GNTP'; $password = ''; $options = array( 'protocol' => 'gntp', 'debug' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'netgrowl.log' ); try { $growl = Net_Growl::singleton($appName, $notifications, $password, $options); $growl->register(); } catch (Net_Growl_Exception $e) { echo 'Caught Growl exception: ' . $e->getMessage() . PHP_EOL; } ?>
-
My favorite application icons are not shown
-
URL given are not valid or not reachable
-
URL are good but resources are invalid images
If you give URL/resource that are not valid, Net_Growl will use default icon returns by Net_Growl::getDefaultGrowlIcon method.
-
-
How to detect error with new version 2.1
GNTP specialized response are now returned with version 2.1.0 (or greater). If you want to catch an error, test status code after each register() or notify() method. See Net_Growl_Response::getStatus
<?php require_once 'Net/Growl/Autoload.php'; $notifications = array( 'GROWL_NOTIFY_PHPERROR' ); $appName = 'PHP App Example using GNTP'; $password = ''; $options = array( 'protocol' => 'gntp', 'debug' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'netgrowl.log' ); try { $growl = Net_Growl::singleton($appName, $notifications, $password, $options); $resp = $growl->register(); if ($resp->getStatus() != 'OK') { die($resp); } } catch (Net_Growl_Exception $e) { echo 'Caught Growl exception: ' . $e->getMessage() . PHP_EOL; } ?>