From: Michael M Slusarz Date: Tue, 18 Nov 2008 22:37:15 +0000 (-0700) Subject: Add log callback handler X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=25c622cd1b14f2fe36bb72caffe8fe5a33cd6bec;p=horde.git Add log callback handler --- diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Exception.php b/framework/Imap_Client/lib/Horde/Imap/Client/Exception.php index f7f1858e5..de9b6aedb 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Exception.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Exception.php @@ -54,4 +54,25 @@ class Horde_Imap_Client_Exception extends Exception // Thrown if the cache has become invalid. const CACHEUIDINVALID = 11; + + /** + * Define a callback function used to log the exception. Will be passed + * a single parameter - a copy of this object. + * + * @var callback + */ + static public $logCallback = null; + + /** + * Constructor. + */ + function __construct($message = null, $code = 0) + { + parent::__construct($message, $code); + + /* Call log function. */ + if (!is_null(self::$logCallback)) { + call_user_func(self::$logCallback, $this); + } + } }