Differential D12806 Diff 30846 src/applications/console/plugin/errorlog/DarkConsoleErrorLogPluginAPI.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/console/plugin/errorlog/DarkConsoleErrorLogPluginAPI.php
| <?php | <?php | ||||
| final class DarkConsoleErrorLogPluginAPI { | final class DarkConsoleErrorLogPluginAPI { | ||||
| private static $errors = array(); | private static $errors = array(); | ||||
| private static $discardMode = false; | private static $discardMode = false; | ||||
| public static function registerErrorHandler() { | public static function registerErrorHandler() { | ||||
| // NOTE: This forces PhutilReadableSerializer to load, so that we are | // NOTE: This forces PhutilReadableSerializer to load, so that we are | ||||
| // able to handle errors which fire from inside autoloaders (PHP will not | // able to handle errors which fire from inside autoloaders (PHP will not | ||||
| // reenter autoloaders). | // reenter autoloaders). | ||||
| PhutilReadableSerializer::printableValue(null); | PhutilReadableSerializer::printableValue(null); | ||||
| PhutilErrorHandler::setErrorListener( | PhutilErrorHandler::setErrorListener( | ||||
| array('DarkConsoleErrorLogPluginAPI', 'handleErrors')); | array(__CLASS__, 'handleErrors')); | ||||
| } | } | ||||
| public static function enableDiscardMode() { | public static function enableDiscardMode() { | ||||
| self::$discardMode = true; | self::$discardMode = true; | ||||
| } | } | ||||
| public static function disableDiscardMode() { | public static function disableDiscardMode() { | ||||
| self::$discardMode = false; | self::$discardMode = false; | ||||
| ▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines | |||||