Browse files

a bit more simplification

  • Loading branch information...
1 parent 574f079 commit 94481297251b9f376ae99a388b5d818e41ac6bad @rich rich committed Apr 9, 2009
Showing with 4 additions and 3 deletions.
  1. +3 −1 Hoptoad.php
  2. +1 −2 example.php
View
4 Hoptoad.php
@@ -11,8 +11,10 @@ class Hoptoad
* @return void
* @author Rich Cavanaugh
*/
- public static function installHandlers()
+ public static function installHandlers($api_key=NULL)
{
+ if (isset($api_key)) define('HOPTOAD_API_KEY', $api_key);
+
set_error_handler(array("Hoptoad", "errorHandler"));
set_exception_handler(array("Hoptoad", "exceptionHandler"));
}
View
3 example.php
@@ -1,5 +1,4 @@
<?php
require_once('Hoptoad.php');
- define("HOPTOAD_API_KEY", "YOUR_HOPTOAD_API_KEY");
- Hoptoad::installHandlers();
+ Hoptoad::installHandlers("YOUR_HOPTOAD_API_KEY");

0 comments on commit 9448129

Please sign in to comment.