Removed krumo, updated ace + patch to support traits, changed L&F to monokai/sublime, output changed to plain text, removed clippy

This commit is contained in:
2015-09-14 15:24:10 +02:00
parent 41e11bfc56
commit 7131e2accd
31 changed files with 29331 additions and 3050 deletions
+23 -61
View File
@@ -42,7 +42,6 @@ if (!in_array('*', $options['ip_whitelist'], true) &&
}
define('PHP_CONSOLE_VERSION', '1.4.0');
require 'krumo/class.krumo.php';
require 'lib/MelodyPlugin.php';
require 'vendor/autoload.php';
@@ -61,19 +60,21 @@ function runCode($__source_code, $__bootstrap_file)
}
if (isset($_POST['code'])) {
ini_set('html_errors', false);
if (get_magic_quotes_gpc()) {
$code = stripslashes($code);
}
$code = $_POST['code'];
// if there's only one line wrap it into a krumo() call
if (preg_match('#^(?!var_dump|echo|print|< )([^\r\n]+?);?\s*$#is', $code, $m) && trim($m[1])) {
$code = 'krumo('.$m[1].');';
}
// // if there's only one line wrap it into a krumo() call
// if (preg_match('#^(?!var_dump|echo|print|< )([^\r\n]+?);?\s*$#is', $code, $m) && trim($m[1])) {
// $code = 'krumo('.$m[1].');';
// }
// replace '< foo' by krumo(foo)
$code = preg_replace('#^<\s+(.+?);?[\r\n]?$#m', 'krumo($1);', $code);
// $code = preg_replace('#^<\s+(.+?);?[\r\n]?$#m', 'krumo($1);', $code);
// replace newlines in the entire code block by the new specified one
// i.e. put #\r\n on the first line to emulate a file with windows line
@@ -126,81 +127,42 @@ if (isset($_POST['code'])) {
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Debug Console</title>
<title>PHP Sandbox</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
<script src="jquery-1.9.1.min.js"></script>
<script src="ace/ace.js" charset="utf-8"></script>
<script src="ace/mode-php.js" charset="utf-8"></script>
<script src="ace/ace.js"></script>
<script src="ace/theme-monokai.js"></script>
<script src="ace/mode-php.js"></script>
<script src="php-console.js"></script>
<script>
$.console({
tabsize: <?php echo json_encode($options['tabsize']) ?>
tabsize: <?= json_encode($options['tabsize']) ?>
});
</script>
</head>
<body>
<div class="console-wrapper">
<div class="input-wrapper">
<form method="POST" action="">
<form method="POST" action="" id="mainform">
<div class="input">
<textarea class="editor" id="editor" name="code"><?php echo (isset($_POST['code']) ? htmlentities($_POST['code'], ENT_QUOTES, 'UTF-8') : "&lt;?php\n\n") ?></textarea>
<textarea class="editor" id="editor" name="code"><?=
(isset($_POST['code']) ? htmlentities($_POST['code'], ENT_QUOTES, 'UTF-8') : "&lt;?php\n\n")
?></textarea>
</div>
<div class="statusbar">
<span class="position">Line: 1, Column: 1</span>
<span class="copy">
Copy selection: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="110" height="14" id="clippy">
<param name="movie" value="clippy/clippy.swf"/>
<param name="allowScriptAccess" value="always" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param NAME="FlashVars" value="text=">
<param name="bgcolor" value="#E8E8E8">
<embed src="clippy/clippy.swf"
width="110"
height="14"
name="clippy"
quality="high"
allowScriptAccess="always"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
FlashVars="text="
bgcolor="#E8E8E8"
/>
</object>
</span>
<a href="" class="reset">Reset</a>
<!-- <a href="" class="reset">Reset</a> -->
<span class="runtime-info"></span>
<input type="submit" name="subm" value="Run!"/>
</div>
<input type="submit" name="subm" value="Try this!" />
</form>
</div>
<div class="output-wrapper">
<div class="output"><?php echo $debugOutput ?></div>
</div>
</div>
<div class="footer-wrapper">
<div class="help">
debug:
&lt; foo()
krumo(foo());
</div>
<div class="help">
commands:
krumo::backtrace();
krumo::includes();
krumo::functions();
krumo::classes();
krumo::defines();
</div>
<div class="help">
misc:
press ctrl-enter to submit
put '#\n' on the first line to enforce
\n line breaks (\r\n etc work too)
</div>
<div class="footer">
php-console v<?php echo PHP_CONSOLE_VERSION ?> - by <a href="http://seld.be/">Jordi Boggiano</a> - <a href="http://github.com/Seldaek/php-console">sources on github</a>
<div class="output"><?= htmlentities($debugOutput) ?></div>
</div>
</div>
</body>
</html>
</html>