Add pear modules, mail and net_smtp via composer (#93)
Add pear modules, mail and net_smtp via composer, remove php 5.6 build due to phpunit 6
This commit is contained in:
@@ -14,13 +14,20 @@ use Whoops\RunInterface;
|
||||
*/
|
||||
abstract class Handler implements HandlerInterface
|
||||
{
|
||||
/**
|
||||
* Return constants that can be returned from Handler::handle
|
||||
* to message the handler walker.
|
||||
/*
|
||||
Return constants that can be returned from Handler::handle
|
||||
to message the handler walker.
|
||||
*/
|
||||
const DONE = 0x10; // returning this is optional, only exists for
|
||||
// semantic purposes
|
||||
/**
|
||||
* The Handler has handled the Throwable in some way, and wishes to skip any other Handler.
|
||||
* Execution will continue.
|
||||
*/
|
||||
const LAST_HANDLER = 0x20;
|
||||
/**
|
||||
* The Handler has handled the Throwable in some way, and wishes to quit/stop execution
|
||||
*/
|
||||
const QUIT = 0x30;
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,23 +55,23 @@ class JsonResponseHandler extends Handler
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if ($this->jsonApi === true) {
|
||||
$response = [
|
||||
'errors' => [
|
||||
Formatter::formatExceptionAsDataArray(
|
||||
$this->getInspector(),
|
||||
$this->addTraceToOutput()
|
||||
),
|
||||
]
|
||||
];
|
||||
} else {
|
||||
$response = [
|
||||
'error' => Formatter::formatExceptionAsDataArray(
|
||||
$this->getInspector(),
|
||||
$this->addTraceToOutput()
|
||||
),
|
||||
];
|
||||
}
|
||||
if ($this->jsonApi === true) {
|
||||
$response = [
|
||||
'errors' => [
|
||||
Formatter::formatExceptionAsDataArray(
|
||||
$this->getInspector(),
|
||||
$this->addTraceToOutput()
|
||||
),
|
||||
]
|
||||
];
|
||||
} else {
|
||||
$response = [
|
||||
'error' => Formatter::formatExceptionAsDataArray(
|
||||
$this->getInspector(),
|
||||
$this->addTraceToOutput()
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
echo json_encode($response, defined('JSON_PARTIAL_OUTPUT_ON_ERROR') ? JSON_PARTIAL_OUTPUT_ON_ERROR : 0);
|
||||
|
||||
|
||||
@@ -151,7 +151,8 @@ class PlainTextHandler extends Handler
|
||||
public function generateResponse()
|
||||
{
|
||||
$exception = $this->getException();
|
||||
return sprintf("%s: %s in file %s on line %d%s\n",
|
||||
return sprintf(
|
||||
"%s: %s in file %s on line %d%s\n",
|
||||
get_class($exception),
|
||||
$exception->getMessage(),
|
||||
$exception->getFile(),
|
||||
@@ -221,7 +222,8 @@ class PlainTextHandler extends Handler
|
||||
);
|
||||
}
|
||||
|
||||
return sprintf("\n%s",
|
||||
return sprintf(
|
||||
"\n%s",
|
||||
preg_replace('/^/m', self::VAR_DUMP_PREFIX, ob_get_clean())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -168,6 +168,7 @@ class PrettyPageHandler extends Handler
|
||||
$templateFile = $this->getResource("views/layout.html.php");
|
||||
$cssFile = $this->getResource("css/whoops.base.css");
|
||||
$zeptoFile = $this->getResource("js/zepto.min.js");
|
||||
$prettifyFile = $this->getResource("js/prettify.min.js");
|
||||
$clipboard = $this->getResource("js/clipboard.min.js");
|
||||
$jsFile = $this->getResource("js/whoops.base.js");
|
||||
|
||||
@@ -186,6 +187,7 @@ class PrettyPageHandler extends Handler
|
||||
// @todo: Asset compiler
|
||||
"stylesheet" => file_get_contents($cssFile),
|
||||
"zepto" => file_get_contents($zeptoFile),
|
||||
"prettify" => file_get_contents($prettifyFile),
|
||||
"clipboard" => file_get_contents($clipboard),
|
||||
"javascript" => file_get_contents($jsFile),
|
||||
|
||||
@@ -491,7 +493,7 @@ class PrettyPageHandler extends Handler
|
||||
}
|
||||
|
||||
if (is_string($this->editor) && isset($this->editors[$this->editor]) && !is_callable($this->editors[$this->editor])) {
|
||||
return [
|
||||
return [
|
||||
'ajax' => false,
|
||||
'url' => $this->editors[$this->editor],
|
||||
];
|
||||
@@ -674,7 +676,8 @@ class PrettyPageHandler extends Handler
|
||||
* @param $superGlobalName string the name of the superglobal array, e.g. '_GET'
|
||||
* @param $key string the key within the superglobal
|
||||
*/
|
||||
public function blacklist($superGlobalName, $key) {
|
||||
public function blacklist($superGlobalName, $key)
|
||||
{
|
||||
$this->blacklist[$superGlobalName][] = $key;
|
||||
}
|
||||
|
||||
@@ -688,11 +691,12 @@ class PrettyPageHandler extends Handler
|
||||
* @param $superGlobalName string the name of the superglobal array, e.g. '_GET'
|
||||
* @return array $values without sensitive data
|
||||
*/
|
||||
private function masked(array $superGlobal, $superGlobalName) {
|
||||
private function masked(array $superGlobal, $superGlobalName)
|
||||
{
|
||||
$blacklisted = $this->blacklist[$superGlobalName];
|
||||
|
||||
$values = $superGlobal;
|
||||
foreach($blacklisted as $key) {
|
||||
foreach ($blacklisted as $key) {
|
||||
if (isset($superGlobal[$key])) {
|
||||
$values[$key] = str_repeat('*', strlen($superGlobal[$key]));
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class XmlResponseHandler extends Handler
|
||||
|
||||
/**
|
||||
* @param SimpleXMLElement $node Node to append data to, will be modified in place
|
||||
* @param array|Traversable $data
|
||||
* @param array|\Traversable $data
|
||||
* @return SimpleXMLElement The modified node, for chaining
|
||||
*/
|
||||
private static function addDataToNode(\SimpleXMLElement $node, $data)
|
||||
@@ -93,7 +93,7 @@ class XmlResponseHandler extends Handler
|
||||
/**
|
||||
* The main function for converting to an XML document.
|
||||
*
|
||||
* @param array|Traversable $data
|
||||
* @param array|\Traversable $data
|
||||
* @return string XML
|
||||
*/
|
||||
private static function toXml($data)
|
||||
|
||||
Reference in New Issue
Block a user