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:
@@ -2,7 +2,7 @@
|
||||
"name": "filp/whoops",
|
||||
"license": "MIT",
|
||||
"description": "php error handling for cool kids",
|
||||
"keywords": ["library", "error", "handling", "exception", "whoops", "zf2"],
|
||||
"keywords": ["library", "error", "handling", "exception", "whoops", "throwable"],
|
||||
"homepage": "https://filp.github.io/whoops/",
|
||||
"authors": [
|
||||
{
|
||||
@@ -16,7 +16,7 @@
|
||||
"psr/log": "^1.0.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8 || ^5.0",
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.7",
|
||||
"mockery/mockery": "0.9.*",
|
||||
"symfony/var-dumper": "^2.6 || ^3.0"
|
||||
},
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
namespace Whoops\Exception;
|
||||
|
||||
|
||||
class Formatter
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -286,7 +286,7 @@ class Frame implements Serializable
|
||||
|
||||
/**
|
||||
* Mark as an frame belonging to the application.
|
||||
*
|
||||
*
|
||||
* @param boolean $application
|
||||
*/
|
||||
public function setApplication($application)
|
||||
|
||||
@@ -42,7 +42,7 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
|
||||
*/
|
||||
public function filter($callable)
|
||||
{
|
||||
$this->frames = array_filter($this->frames, $callable);
|
||||
$this->frames = array_values(array_filter($this->frames, $callable));
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
|
||||
*/
|
||||
public function countIsApplication()
|
||||
{
|
||||
return count(array_filter($this->frames, function(Frame $f) {
|
||||
return count(array_filter($this->frames, function (Frame $f) {
|
||||
return $f->isApplication();
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -67,7 +67,8 @@ class Inspector
|
||||
return $this->extractDocrefUrl($this->exception->getMessage())['url'];
|
||||
}
|
||||
|
||||
private function extractDocrefUrl($message) {
|
||||
private function extractDocrefUrl($message)
|
||||
{
|
||||
$docref = [
|
||||
'message' => $message,
|
||||
'url' => null,
|
||||
@@ -128,7 +129,6 @@ class Inspector
|
||||
|
||||
// Fill empty line/file info for call_user_func_array usages (PHP Bug #44428)
|
||||
foreach ($frames as $k => $frame) {
|
||||
|
||||
if (empty($frame['file'])) {
|
||||
// Default values when file and line are missing
|
||||
$file = '[internal]';
|
||||
@@ -144,7 +144,6 @@ class Inspector
|
||||
$frames[$k]['file'] = $file;
|
||||
$frames[$k]['line'] = $line;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Find latest non-error handling frame index ($i) used to remove error handling frames
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -228,8 +228,6 @@ header {
|
||||
}
|
||||
|
||||
.code-block {
|
||||
max-height: 345px;
|
||||
overflow: hidden;
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
border-radius: 6px;
|
||||
@@ -384,13 +382,15 @@ pre.code-block, code.code-block, .frame-args.code-block, .frame-args.code-block
|
||||
|
||||
.linenums li.current{
|
||||
background: rgba(255, 100, 100, .07);
|
||||
padding-top: 4px;
|
||||
padding-left: 1px;
|
||||
}
|
||||
.linenums li.current.active {
|
||||
background: rgba(255, 100, 100, .17);
|
||||
}
|
||||
|
||||
pre:not(.prettyprinted) {
|
||||
padding-left: 60px;
|
||||
}
|
||||
|
||||
#plain-exception {
|
||||
display: none;
|
||||
}
|
||||
|
||||
28
lib/composer/vendor/filp/whoops/src/Whoops/Resources/js/prettify.min.js
vendored
Normal file
28
lib/composer/vendor/filp/whoops/src/Whoops/Resources/js/prettify.min.js
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
var r=null;window.PR_SHOULD_USE_CONTINUATION=!0;
|
||||
(function(){function O(a){function i(d){var a=d.charCodeAt(0);if(a!==92)return a;var f=d.charAt(1);return(a=s[f])?a:"0"<=f&&f<="7"?parseInt(d.substring(1),8):f==="u"||f==="x"?parseInt(d.substring(2),16):d.charCodeAt(1)}function g(d){if(d<32)return(d<16?"\\x0":"\\x")+d.toString(16);d=String.fromCharCode(d);return d==="\\"||d==="-"||d==="]"||d==="^"?"\\"+d:d}function j(d){var a=d.substring(1,d.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),d=[],f=
|
||||
a[0]==="^",b=["["];f&&b.push("^");for(var f=f?1:0,c=a.length;f<c;++f){var h=a[f];if(/\\[bdsw]/i.test(h))b.push(h);else{var h=i(h),e;f+2<c&&"-"===a[f+1]?(e=i(a[f+2]),f+=2):e=h;d.push([h,e]);e<65||h>122||(e<65||h>90||d.push([Math.max(65,h)|32,Math.min(e,90)|32]),e<97||h>122||d.push([Math.max(97,h)&-33,Math.min(e,122)&-33]))}}d.sort(function(d,a){return d[0]-a[0]||a[1]-d[1]});a=[];c=[];for(f=0;f<d.length;++f)h=d[f],h[0]<=c[1]+1?c[1]=Math.max(c[1],h[1]):a.push(c=h);for(f=0;f<a.length;++f)h=a[f],b.push(g(h[0])),
|
||||
h[1]>h[0]&&(h[1]+1>h[0]&&b.push("-"),b.push(g(h[1])));b.push("]");return b.join("")}function t(d){for(var a=d.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=a.length,i=[],c=0,h=0;c<b;++c){var e=a[c];e==="("?++h:"\\"===e.charAt(0)&&(e=+e.substring(1))&&(e<=h?i[e]=-1:a[c]=g(e))}for(c=1;c<i.length;++c)-1===i[c]&&(i[c]=++z);for(h=c=0;c<b;++c)e=a[c],e==="("?(++h,i[h]||(a[c]="(?:")):"\\"===e.charAt(0)&&(e=+e.substring(1))&&e<=h&&
|
||||
(a[c]="\\"+i[e]);for(c=0;c<b;++c)"^"===a[c]&&"^"!==a[c+1]&&(a[c]="");if(d.ignoreCase&&w)for(c=0;c<b;++c)e=a[c],d=e.charAt(0),e.length>=2&&d==="["?a[c]=j(e):d!=="\\"&&(a[c]=e.replace(/[A-Za-z]/g,function(d){d=d.charCodeAt(0);return"["+String.fromCharCode(d&-33,d|32)+"]"}));return a.join("")}for(var z=0,w=!1,k=!1,m=0,b=a.length;m<b;++m){var o=a[m];if(o.ignoreCase)k=!0;else if(/[a-z]/i.test(o.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){w=!0;k=!1;break}}for(var s={b:8,t:9,n:10,v:11,
|
||||
f:12,r:13},q=[],m=0,b=a.length;m<b;++m){o=a[m];if(o.global||o.multiline)throw Error(""+o);q.push("(?:"+t(o)+")")}return RegExp(q.join("|"),k?"gi":"g")}function P(a,i){function g(a){switch(a.nodeType){case 1:if(j.test(a.className))break;for(var b=a.firstChild;b;b=b.nextSibling)g(b);b=a.nodeName.toLowerCase();if("br"===b||"li"===b)t[k]="\n",w[k<<1]=z++,w[k++<<1|1]=a;break;case 3:case 4:b=a.nodeValue,b.length&&(b=i?b.replace(/\r\n?/g,"\n"):b.replace(/[\t\n\r ]+/g," "),t[k]=b,w[k<<1]=z,z+=b.length,w[k++<<
|
||||
1|1]=a)}}var j=/(?:^|\s)nocode(?:\s|$)/,t=[],z=0,w=[],k=0;g(a);return{a:t.join("").replace(/\n$/,""),d:w}}function E(a,i,g,j){i&&(a={a:i,e:a},g(a),j.push.apply(j,a.g))}function x(a,i){function g(a){for(var k=a.e,m=[k,"pln"],b=0,o=a.a.match(t)||[],s={},q=0,d=o.length;q<d;++q){var v=o[q],f=s[v],u=void 0,c;if(typeof f==="string")c=!1;else{var h=j[v.charAt(0)];if(h)u=v.match(h[1]),f=h[0];else{for(c=0;c<z;++c)if(h=i[c],u=v.match(h[1])){f=h[0];break}u||(f="pln")}if((c=f.length>=5&&"lang-"===f.substring(0,
|
||||
5))&&!(u&&typeof u[1]==="string"))c=!1,f="src";c||(s[v]=f)}h=b;b+=v.length;if(c){c=u[1];var e=v.indexOf(c),p=e+c.length;u[2]&&(p=v.length-u[2].length,e=p-c.length);f=f.substring(5);E(k+h,v.substring(0,e),g,m);E(k+h+e,c,F(f,c),m);E(k+h+p,v.substring(p),g,m)}else m.push(k+h,f)}a.g=m}var j={},t;(function(){for(var g=a.concat(i),k=[],m={},b=0,o=g.length;b<o;++b){var s=g[b],q=s[3];if(q)for(var d=q.length;--d>=0;)j[q.charAt(d)]=s;s=s[1];q=""+s;m.hasOwnProperty(q)||(k.push(s),m[q]=r)}k.push(/[\S\s]/);t=
|
||||
O(k)})();var z=i.length;return g}function l(a){var i=[],g=[];a.tripleQuotedStrings?i.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,r,"'\""]):a.multiLineStrings?i.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,r,"'\"`"]):i.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,r,"\"'"]);a.verbatimStrings&&
|
||||
g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,r]);var j=a.hashComments;j&&(a.cStyleComments?(j>1?i.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,r,"#"]):i.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,r,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,r])):i.push(["com",/^#[^\n\r]*/,r,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,r]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,
|
||||
r]));a.regexLiterals&&g.push(["lang-regex",/^(?:^^\.?|[+-]|[!=]={0,2}|#|%=?|&&?=?|\(|\*=?|[+-]=|->|\/=?|::?|<<?=?|>{1,3}=?|[,;?@[{~]|\^\^?=?|\|\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(j=a.types)&&g.push(["typ",j]);a=(""+a.keywords).replace(/^ | $/g,"");a.length&&g.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),r]);i.push(["pln",/^\s+/,r," \r\n\t\u00a0"]);g.push(["lit",
|
||||
/^@[$_a-z][\w$@]*/i,r],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,r],["pln",/^[$_a-z][\w$@]*/i,r],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,r,"0123456789"],["pln",/^\\[\S\s]?/,r],["pun",/^.[^\s\w"$'./@\\`]*/,r]);return x(i,g)}function G(a,i,g){function j(a){switch(a.nodeType){case 1:if(z.test(a.className))break;if("br"===a.nodeName)t(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)j(a);break;case 3:case 4:if(g){var b=
|
||||
a.nodeValue,f=b.match(n);if(f){var i=b.substring(0,f.index);a.nodeValue=i;(b=b.substring(f.index+f[0].length))&&a.parentNode.insertBefore(k.createTextNode(b),a.nextSibling);t(a);i||a.parentNode.removeChild(a)}}}}function t(a){function i(a,b){var d=b?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=i(e,1),f=a.nextSibling;e.appendChild(d);for(var g=f;g;g=f)f=g.nextSibling,e.appendChild(g)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=i(a.nextSibling,0),f;(f=a.parentNode)&&f.nodeType===
|
||||
1;)a=f;b.push(a)}for(var z=/(?:^|\s)nocode(?:\s|$)/,n=/\r\n?|\n/,k=a.ownerDocument,m=k.createElement("li");a.firstChild;)m.appendChild(a.firstChild);for(var b=[m],o=0;o<b.length;++o)j(b[o]);i===(i|0)&&b[0].setAttribute("value",i);var s=k.createElement("ol");s.className="linenums";for(var i=Math.max(0,i-1|0)||0,o=0,q=b.length;o<q;++o)m=b[o],m.className="L"+(o+i)%10,m.firstChild||m.appendChild(k.createTextNode("\u00a0")),s.appendChild(m);a.appendChild(s)}function n(a,i){for(var g=i.length;--g>=0;){var j=
|
||||
i[g];A.hasOwnProperty(j)?C.console&&console.warn("cannot override language handler %s",j):A[j]=a}}function F(a,i){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(i)?"default-markup":"default-code";return A[a]}function H(a){var i=a.h;try{var g=P(a.c,a.i),j=g.a;a.a=j;a.d=g.d;a.e=0;F(i,j)(a);var t=/\bMSIE\s(\d+)/.exec(navigator.userAgent),t=t&&+t[1]<=8,i=/\n/g,n=a.a,w=n.length,g=0,k=a.d,m=k.length,j=0,b=a.g,o=b.length,s=0;b[o]=w;var q,d;for(d=q=0;d<o;)b[d]!==b[d+2]?(b[q++]=b[d++],b[q++]=b[d++]):d+=2;o=q;
|
||||
for(d=q=0;d<o;){for(var v=b[d],f=b[d+1],u=d+2;u+2<=o&&b[u+1]===f;)u+=2;b[q++]=v;b[q++]=f;d=u}b.length=q;var c=a.c,h;if(c)h=c.style.display,c.style.display="none";try{for(;j<m;){var e=k[j+2]||w,p=b[s+2]||w,u=Math.min(e,p),l=k[j+1],D;if(l.nodeType!==1&&(D=n.substring(g,u))){t&&(D=D.replace(i,"\r"));l.nodeValue=D;var y=l.ownerDocument,x=y.createElement("span");x.className=b[s+1];var B=l.parentNode;B.replaceChild(x,l);x.appendChild(l);g<e&&(k[j+1]=l=y.createTextNode(n.substring(u,e)),B.insertBefore(l,
|
||||
x.nextSibling))}g=u;g>=e&&(j+=2);g>=p&&(s+=2)}}finally{if(c)c.style.display=h}}catch(A){C.console&&console.log(A&&A.stack?A.stack:A)}}var C=window,y=["break,continue,do,else,for,if,return,while"],B=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],I=[B,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],
|
||||
J=[B,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],K=[J,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],B=[B,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],
|
||||
L=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],M=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],N=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,
|
||||
Q=/\S/,R=l({keywords:[I,K,B,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+L,M,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};n(R,["default-code"]);n(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",
|
||||
/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);n(x([["pln",/^\s+/,r," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,r,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],
|
||||
["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);n(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);n(l({keywords:I,hashComments:!0,cStyleComments:!0,types:N}),["c","cc","cpp","cxx","cyc","m"]);n(l({keywords:"null,true,false"}),["json"]);n(l({keywords:K,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:N}),
|
||||
["cs"]);n(l({keywords:J,cStyleComments:!0}),["java"]);n(l({keywords:y,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);n(l({keywords:L,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py"]);n(l({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);n(l({keywords:M,hashComments:!0,
|
||||
multiLineStrings:!0,regexLiterals:!0}),["rb"]);n(l({keywords:B,cStyleComments:!0,regexLiterals:!0}),["js"]);n(l({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);n(x([],[["str",/^[\S\s]+/]]),["regex"]);var S=C.PR={createSimpleLexer:x,registerLangHandler:n,sourceDecorator:l,
|
||||
PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:C.prettyPrintOne=function(a,i,g){var j=document.createElement("pre");j.innerHTML=a;g&&G(j,g,!0);H({h:i,j:g,c:j,i:1});return j.innerHTML},prettyPrint:C.prettyPrint=function(a){function i(){var u;for(var g=C.PR_SHOULD_USE_CONTINUATION?k.now()+250:Infinity;m<j.length&&
|
||||
k.now()<g;m++){var c=j[m],h=c.className;if(s.test(h)&&!q.test(h)){for(var e=!1,p=c.parentNode;p;p=p.parentNode)if(f.test(p.tagName)&&p.className&&s.test(p.className)){e=!0;break}if(!e){c.className+=" prettyprinted";var h=h.match(o),n;if(e=!h){for(var e=c,p=void 0,l=e.firstChild;l;l=l.nextSibling)var t=l.nodeType,p=t===1?p?e:l:t===3?Q.test(l.nodeValue)?e:p:p;e=(n=p===e?void 0:p)&&v.test(n.tagName)}e&&(h=n.className.match(o));h&&(h=h[1]);u=d.test(c.tagName)?1:(e=(e=c.currentStyle)?e.whiteSpace:document.defaultView&&
|
||||
document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(c,r).getPropertyValue("white-space"):0)&&"pre"===e.substring(0,3),e=u;(p=(p=c.className.match(/\blinenums\b(?::(\d+))?/))?p[1]&&p[1].length?+p[1]:!0:!1)&&G(c,p,e);b={h:h,c:c,j:p,i:e};H(b)}}}m<j.length?setTimeout(i,250):a&&a()}for(var g=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],j=[],n=0;n<g.length;++n)for(var l=0,w=g[n].length;l<w;++l)j.push(g[n][l]);var g=
|
||||
r,k=Date;k.now||(k={now:function(){return+new Date}});var m=0,b,o=/\blang(?:uage)?-([\w.]+)(?!\S)/,s=/\bprettyprint\b/,q=/\bprettyprinted\b/,d=/pre|xmp/i,v=/^code$/i,f=/^(?:pre|code|xmp)$/i;i()}};typeof define==="function"&&define.amd&&define("google-code-prettify",[],function(){return S})})();
|
||||
@@ -1,17 +1,4 @@
|
||||
Zepto(function($) {
|
||||
|
||||
// a jQuery.getScript() equivalent to asyncronously load javascript files
|
||||
// credits to http://stackoverflow.com/a/8812950/1597388
|
||||
var getScript = function(src, func) {
|
||||
var script = document.createElement('script');
|
||||
script.async = 'async';
|
||||
script.src = src;
|
||||
if (func) {
|
||||
script.onload = func;
|
||||
}
|
||||
document.getElementsByTagName('head')[0].appendChild( script );
|
||||
};
|
||||
|
||||
var $leftPanel = $('.left-panel');
|
||||
var $frameContainer = $('.frames-container');
|
||||
var $appFramesTab = $('#application-frames-tab');
|
||||
@@ -31,11 +18,6 @@ Zepto(function($) {
|
||||
$header.removeClass('header-expand');
|
||||
});
|
||||
|
||||
// load prettify asyncronously to speed up page rendering
|
||||
getScript('//cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.js', function () {
|
||||
renderCurrentCodeblock();
|
||||
});
|
||||
|
||||
/*
|
||||
* add prettyprint classes to our current active codeblock
|
||||
* run prettyPrint() to highlight the active code
|
||||
@@ -69,6 +51,13 @@ Zepto(function($) {
|
||||
var $lines = $activeFrame.find('.linenums li');
|
||||
var firstLine = +($lines.first().val());
|
||||
|
||||
// We show more code than needed, purely for proper syntax highlighting
|
||||
// Let’s hide a big chunk of that code and then scroll the remaining block
|
||||
$activeFrame.find('.code-block').first().css({
|
||||
maxHeight: 345,
|
||||
overflow: 'hidden',
|
||||
});
|
||||
|
||||
var $offset = $($lines[activeLineNumber - firstLine - 10]);
|
||||
if ($offset.length > 0) {
|
||||
$offset[0].scrollIntoView();
|
||||
@@ -186,6 +175,9 @@ Zepto(function($) {
|
||||
}
|
||||
});
|
||||
|
||||
// Render late enough for highlightCurrentLine to be ready
|
||||
renderCurrentCodeblock();
|
||||
|
||||
// Avoid to quit the page with some protocol (e.g. IntelliJ Platform REST API)
|
||||
$ajaxEditors.on('click', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<div class="frames-description <?php echo $has_frames_tabs ? 'frames-description-application' : '' ?>">
|
||||
<?php if ($has_frames_tabs): ?>
|
||||
<?php if ($active_frames_tab == 'application'): ?>
|
||||
<a href="#" id="application-frames-tab" class="frames-tab frames-tab-active">
|
||||
Application frames (<?php echo $frames->countIsApplication() ?>)
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<span href="#" id="application-frames-tab" class="frames-tab">
|
||||
<span href="#" id="application-frames-tab" class="frames-tab frames-tab-active">
|
||||
Application frames (<?php echo $frames->countIsApplication() ?>)
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<a href="#" id="application-frames-tab" class="frames-tab">
|
||||
Application frames (<?php echo $frames->countIsApplication() ?>)
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<a href="#" id="all-frames-tab" class="frames-tab <?php echo $active_frames_tab == 'all' ? 'frames-tab-active' : '' ?>">
|
||||
All frames (<?php echo count($frames) ?>)
|
||||
@@ -17,4 +17,4 @@
|
||||
Stack frames (<?php echo count($frames) ?>)
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="robots" content="noindex,nofollow"/>
|
||||
<title><?php echo $tpl->escape($page_title) ?></title>
|
||||
|
||||
<style><?php echo $stylesheet ?></style>
|
||||
@@ -23,6 +24,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script><?php echo $prettify ?></script>
|
||||
<script><?php echo $zepto ?></script>
|
||||
<script><?php echo $clipboard ?></script>
|
||||
<script><?php echo $javascript ?></script>
|
||||
|
||||
@@ -33,5 +33,4 @@ class HtmlDumperOutput
|
||||
{
|
||||
$this->output = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,15 +9,15 @@ namespace Whoops\Util;
|
||||
class Misc
|
||||
{
|
||||
/**
|
||||
* Can we at this point in time send HTTP headers?
|
||||
*
|
||||
* Currently this checks if we are even serving an HTTP request,
|
||||
* as opposed to running from a command line.
|
||||
*
|
||||
* If we are serving an HTTP request, we check if it's not too late.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
* Can we at this point in time send HTTP headers?
|
||||
*
|
||||
* Currently this checks if we are even serving an HTTP request,
|
||||
* as opposed to running from a command line.
|
||||
*
|
||||
* If we are serving an HTTP request, we check if it's not too late.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function canSendHeaders()
|
||||
{
|
||||
return isset($_SERVER["REQUEST_URI"]) && !headers_sent();
|
||||
@@ -40,15 +40,15 @@ class Misc
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate ErrorException code into the represented constant.
|
||||
*
|
||||
* @param int $error_code
|
||||
* @return string
|
||||
*/
|
||||
* Translate ErrorException code into the represented constant.
|
||||
*
|
||||
* @param int $error_code
|
||||
* @return string
|
||||
*/
|
||||
public static function translateErrorCode($error_code)
|
||||
{
|
||||
$constants = get_defined_constants(true);
|
||||
if (array_key_exists('Core' , $constants)) {
|
||||
if (array_key_exists('Core', $constants)) {
|
||||
foreach ($constants['Core'] as $constant => $value) {
|
||||
if (substr($constant, 0, 2) == 'E_' && $value == $error_code) {
|
||||
return $constant;
|
||||
@@ -60,7 +60,7 @@ class Misc
|
||||
|
||||
/**
|
||||
* Determine if an error level is fatal (halts execution)
|
||||
*
|
||||
*
|
||||
* @param int $level
|
||||
* @return bool
|
||||
*/
|
||||
|
||||
@@ -88,7 +88,8 @@ class TemplateHelper
|
||||
$escaped = $this->escape($raw);
|
||||
return preg_replace(
|
||||
"@([A-z]+?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@",
|
||||
"<a href=\"$1\" target=\"_blank\">$1</a>", $escaped
|
||||
"<a href=\"$1\" target=\"_blank\" rel=\"noreferrer noopener\">$1</a>",
|
||||
$escaped
|
||||
);
|
||||
}
|
||||
|
||||
@@ -166,7 +167,7 @@ class TemplateHelper
|
||||
// exclude verbose information (e.g. exception stack traces)
|
||||
if (class_exists('Symfony\Component\VarDumper\Caster\Caster')) {
|
||||
$cloneVar = $this->getCloner()->cloneVar($value, Caster::EXCLUDE_VERBOSE);
|
||||
// Symfony VarDumper 2.6 Caster class dont exist.
|
||||
// Symfony VarDumper 2.6 Caster class dont exist.
|
||||
} else {
|
||||
$cloneVar = $this->getCloner()->cloneVar($value);
|
||||
}
|
||||
@@ -182,7 +183,7 @@ class TemplateHelper
|
||||
return $output;
|
||||
}
|
||||
|
||||
return print_r($value, true);
|
||||
return htmlspecialchars(print_r($value, true));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,7 +204,7 @@ class TemplateHelper
|
||||
|
||||
if ($numFrames > 0) {
|
||||
$html = '<ol class="linenums">';
|
||||
foreach($frame->getArgs() as $j => $frameArg) {
|
||||
foreach ($frame->getArgs() as $j => $frameArg) {
|
||||
$html .= '<li>'. $this->dump($frameArg) .'</li>';
|
||||
}
|
||||
$html .= '</ol>';
|
||||
@@ -265,7 +266,7 @@ class TemplateHelper
|
||||
* Sets a single template variable, by its name:
|
||||
*
|
||||
* @param string $variableName
|
||||
* @param mixd $variableValue
|
||||
* @param mixed $variableValue
|
||||
*/
|
||||
public function setVariable($variableName, $variableValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user