/** */ public static function disable() { restore_exception_handler(); Stagehand_LegacyError_PEARErrorStack::disableConversion(); Stagehand_LegacyError_PEARError::disableConversion(); Stagehand_LegacyError_PHPError::disableConversion(); }
/** * Parses the command line options. * * @return array */ protected function parseOptions() { Stagehand_LegacyError_PEARError::enableConversion(); $oldErrorReportingLevel = error_reporting(error_reporting() & ~E_STRICT & ~E_NOTICE); Stagehand_LegacyError_PHPError::enableConversion(error_reporting()); try { $argv = Console_Getopt::readPHPArgv(); array_shift($argv); $parsedOptions = Console_Getopt::getopt2($argv, $this->shortOptions, $this->longOptions); } catch (Stagehand_LegacyError_PEARError_Exception $e) { Stagehand_LegacyError_PHPError::disableConversion(); error_reporting($oldErrorReportingLevel); Stagehand_LegacyError_PEARError::disableConversion(); throw new $this->exceptionClass(preg_replace('/^Console_Getopt: /', '', $e->getMessage())); } catch (Exception $e) { Stagehand_LegacyError_PHPError::disableConversion(); error_reporting($oldErrorReportingLevel); Stagehand_LegacyError_PEARError::disableConversion(); throw $e; } Stagehand_LegacyError_PHPError::disableConversion(); error_reporting($oldErrorReportingLevel); Stagehand_LegacyError_PEARError::disableConversion(); return $parsedOptions; }