GitHub PullRequestReviewCommentEvent at 2014-01-19 21:31:35
Repository: whoops
Actor: oldskool
Payload: {"comment":{"url":"https://api.github.com/repos/filp/whoops/pulls/comments/8994151","id":8994151,"diff_hunk":"@@ -0,0 +1,46 @@\n+<?php\n+App::import('Vendor', array('file' => 'autoload'));\n+\n+/**\n+ * The WhoopsExceptionHandler will pass our Exception to the Whoops library.\n+ * Exceptions will then be shown on a \"Pretty Page\", including the code excerpt\n+ * where the Exception was thrown along with an interactive stack trace.\n+ *\n+ * @author Jan Dorsman, ODC Engineering <jan.dorsman@odc-engineering.nl>\n+ * @copyright Copyright (c) 2014, ODC Engineering\n+ * @license http://opensource.org/licenses/MIT The MIT License (MIT)\n+ */\n+class WhoopsExceptionHandler {\n+\n+/**\n+ * This integer sets the minimum debug level required.\n+ *\n+ * If your CakePHP debug level is lower than this integer, the default ExceptionHandler is used.\n+ * The Whoops library provides a lot of information that you'd normally not want to share with\n+ * your end users (like code excerpts and server details). So make sure not to set this value too low.\n+ *\n+ * @var int\n+ */\n+\tpublic static $minDebugLevel = 1;\n+\n+/**\n+ * This method will handle any Exception thrown.\n+ *\n+ * @param Exception $exception The exception to be handled\n+ *\n+ * @return void\n+ */\n+\tpublic static function handle($exception) {\n+\t\t// Verify if the debug level is at least the minDebugLevel\n+\t\tif (Configure::read('debug') >= self::$minDebugLevel) {\n+\t\t\t// Debug level is high enough, use the Whoops handler\n+\t\t\t$Whoops = new Whoops\\Run();\n+\t\t\t$Whoops->pushHandler(new Whoops\\Handler\\PrettyPageHandler());\n+\t\t\t$Whoops->handleException($exception);\n+\t\t} else {\n+\t\t\t// Debug level is too low, fall back to CakePHP default ErrorHandler\n+\t\t\tErrorHandler::handleException($exception);\n+\t\t}\n+\t}\n+\n+}","path":"src/Whoops/Provider/Cake/WhoopsExceptionHandler.php","position":46,"original_position":46,"commit_id":"beb5ad108c8fd79248a30149257d8bc6e1eaa414","original_commit_id":"1a169c6b8b0ac5808086e53e205e4776f4269ed1","user":{"login":"oldskool","id":567664,"avatar_url":"https://gravatar.com/avatar/018973120e6a6b6aa97bdab1104a4c8e?d=https%3A%2F%2Fidenticons.github.com%2F9dbcfa164ab943e911da6a931fe5e2b9.png&r=x","gravatar_id":"018973120e6a6b6aa97bdab1104a4c8e","url":"https://api.github.com/users/oldskool","html_url":"https://github.com/oldskool","followers_url":"https://api.github.com/users/oldskool/followers","following_url":"https://api.github.com/users/oldskool/following{/other_user}","gists_url":"https://api.github.com/users/oldskool/gists{/gist_id}","starred_url":"https://api.github.com/users/oldskool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oldskool/subscriptions","organizations_url":"https://api.github.com/users/oldskool/orgs","repos_url":"https://api.github.com/users/oldskool/repos","events_url":"https://api.github.com/users/oldskool/events{/privacy}","received_events_url":"https://api.github.com/users/oldskool/received_events","type":"User","site_admin":false},"body":"Done. https://github.com/oldskool/whoops/commit/beb5ad108c8fd79248a30149257d8bc6e1eaa414","created_at":"2014-01-19T21:31:35Z","updated_at":"2014-01-19T21:31:35Z","html_url":"https://github.com/filp/whoops/pull/130#discussion_r8994151","pull_request_url":"https://api.github.com/repos/filp/whoops/pulls/130","_links":{"self":{"href":"https://api.github.com/repos/filp/whoops/pulls/comments/8994151"},"html":{"href":"https://github.com/filp/whoops/pull/130#discussion_r8994151"},"pull_request":{"href":"https://api.github.com/repos/filp/whoops/pulls/130"}}}}