├── .gitignore ├── LICENSE ├── Makefile ├── README.mdown ├── ace ├── LICENSE ├── ace.js ├── mode-php.js └── worker-php.js ├── clippy ├── LICENSE └── clippy.swf ├── composer.json ├── config.php.dist ├── index.php ├── jquery-1.9.1.min.js ├── krumo ├── INSTALL ├── LICENSE ├── README ├── TODO ├── VERSION ├── class.krumo.php ├── krumo.ini ├── krumo.js └── skins │ ├── blue │ ├── bg.gif │ └── skin.css │ ├── default │ ├── bg.gif │ └── skin.css │ ├── green │ ├── bg.gif │ └── skin.css │ ├── orange │ ├── bg.gif │ └── skin.css │ └── schablon.com │ ├── collapsed.gif │ ├── dotted.gif │ ├── empty.gif │ ├── expanded.gif │ └── skin.css ├── lib └── MelodyPlugin.php ├── loader.gif ├── php-console.js └── styles.css /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | config.php 3 | composer.lock 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Jordi Boggiano 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Slippy nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | web: .PHONY 2 | php -S localhost:8088 -t . index.php 3 | 4 | .PHONY: 5 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | PHP Console 2 | =========== 3 | 4 | A web console to try your PHP code into 5 | 6 | Creating a test file or using php's interactive mode can be a bit cumbersome 7 | to try random php snippets. This allows you to run small bits of code easily 8 | right from your browser. 9 | 10 | It is secure since accessible only from the local host, and very easy to 11 | setup and use. 12 | 13 | Screenshot 14 | ---------- 15 | 16 | PHP Console screenshot 17 | 18 | Installation 19 | ------------ 20 | 21 | Clone the git repo or download it as a zip/tarball, drop it somewhere in your 22 | local web document root and access it with http://localhost/path/to/php-console 23 | 24 | You can also install it with Composer using this command: 25 | 26 | composer create-project --stability=dev --keep-vcs seld/php-console 27 | 28 | To update it just run `git pull` in the directory to pull the latest changes in. 29 | 30 | You can use the internal PHP server too. 31 | run `php -S localhost:1337` in a terminal and go to `http://localhost:1337/`. 32 | 33 | Configuration 34 | ------------- 35 | 36 | Default settings are available in `config.php.dist`, if you would like to modify 37 | them, you can copy the file to `config.php` and edit settings. 38 | 39 | Contributing 40 | ------------ 41 | 42 | Code contributions or ideas are obviously much welcome. Send pull requests or issues on github. 43 | 44 | Author 45 | ------ 46 | 47 | Jordi Boggiano -
48 | - 49 | 50 | Changelog 51 | --------- 52 | 53 | - 1.5.0-dev 54 | - Added melody-script integration. requires a composer binary within the systems/webservers PATH env variable. 55 | - Updated bundled ACE editor to 1.1.8 56 | - Layout is now flex-css based 57 | - Added a new `bootstrap` option to be include before source evaluation 58 | - Moved tabsize, ip-whitelist into an option 59 | - Added servers-side runtime information, to be rendered in the consoles statusbar 60 | - Allow configuring options 61 | - 1.4.0 62 | - Added control-char escaping to make them more visible 63 | - 1.3.0 64 | - Added code persistence across sessions in localStorage + a reset button 65 | - 1.2.3 66 | - Fixed syntax highlighting 67 | - Fixed some styling issues 68 | - Fixed ajax error handling for non responding backends 69 | - 1.2.2 70 | - Updated ACE to latest version 71 | - Added composer.json support 72 | - 1.2.1 73 | - Performance fixes for ACE editor integration 74 | - JS is no longer a requirement 75 | - 1.2.0 76 | - Replaced built-in editor with [ACE editor](http://ace.ajax.org/) which provides highlighting and 77 | [other features](https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts) 78 | - Handle old setups with magic_quotes enabled 79 | - 1.1.2 80 | - Fixed issue with IPv6 loopback not being whitelisted 81 | - 1.1.1 82 | - Cross-browser compatibility enhancements 83 | - 1.1.0 84 | - Script execution is now done via an async js request, preventing die() and exception to mess up the entire console 85 | - Added a status bar with char/line display 86 | - Added a toggle button to expand/collapse all krumo sub-trees at once 87 | - Cross-browser compatibility enhancements 88 | - Removing a tab (i.e. 4 spaces) on backspace now 89 | - Made tab character(s) configurable (see index.php) 90 | - 1.0.0 91 | - Initial Public Release 92 | 93 | License 94 | ------- 95 | 96 | PHP Console is licensed under the New BSD License, which means you can do pretty much anything you want with it. 97 | 98 | New BSD License - see the LICENSE file for details 99 | 100 | Acknowledgements 101 | ---------------- 102 | 103 | PHP Console bundles the following libraries, and the work of their respective authors is very much appreciated: 104 | 105 | - [krumo](http://krumo.sourceforge.net/) licensed under the LGPL 106 | - [jQuery](http://jquery.com) licensed under the MIT License 107 | - [ACE](http://ace.ajax.org/) licensed under the MPL/LGPL/GPL Licenses 108 | - [Clippy](https://github.com/mojombo/clippy) licensed under the MIT License 109 | -------------------------------------------------------------------------------- /ace/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Ajax.org B.V. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Ajax.org B.V. nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /ace/worker-php.js: -------------------------------------------------------------------------------- 1 | "no use strict";(function(e){function t(e,t){var n=e,r="";while(n){var i=t[n];if(typeof i=="string")return i+r;if(i)return i.location.replace(/\/*$/,"/")+(r||i.main||i.name);if(i===!1)return"";var s=n.lastIndexOf("/");if(s===-1)break;r=n.substr(s)+r,n=n.slice(0,s)}return e}if(typeof e.window!="undefined"&&e.document)return;if(e.require&&e.define)return;e.console||(e.console=function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})},e.console.error=e.console.warn=e.console.log=e.console.trace=e.console),e.window=e,e.ace=e,e.onerror=function(e,t,n,r,i){postMessage({type:"error",data:{message:e,data:i.data,file:t,line:n,col:r,stack:i.stack}})},e.normalizeModule=function(t,n){if(n.indexOf("!")!==-1){var r=n.split("!");return e.normalizeModule(t,r[0])+"!"+e.normalizeModule(t,r[1])}if(n.charAt(0)=="."){var i=t.split("/").slice(0,-1).join("/");n=(i?i+"/":"")+n;while(n.indexOf(".")!==-1&&s!=n){var s=n;n=n.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return n},e.require=function(r,i){i||(i=r,r=null);if(!i.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");i=e.normalizeModule(r,i);var s=e.require.modules[i];if(s)return s.initialized||(s.initialized=!0,s.exports=s.factory().exports),s.exports;if(!e.require.tlns)return console.log("unable to load "+i);var o=t(i,e.require.tlns);return o.slice(-3)!=".js"&&(o+=".js"),e.require.id=i,e.require.modules[i]={},importScripts(o),e.require(r,i)},e.require.modules={},e.require.tlns={},e.define=function(t,n,r){arguments.length==2?(r=n,typeof t!="string"&&(n=t,t=e.require.id)):arguments.length==1&&(r=t,n=[],t=e.require.id);if(typeof r!="function"){e.require.modules[t]={exports:r,initialized:!0};return}n.length||(n=["require","exports","module"]);var i=function(n){return e.require(t,n)};e.require.modules[t]={exports:{},factory:function(){var e=this,t=r.apply(this,n.map(function(t){switch(t){case"require":return i;case"exports":return e.exports;case"module":return e;default:return i(t)}}));return t&&(e.exports=t),e}}},e.define.amd={},require.tlns={},e.initBaseUrls=function(t){for(var n in t)require.tlns[n]=t[n]},e.initSender=function(){var n=e.require("ace/lib/event_emitter").EventEmitter,r=e.require("ace/lib/oop"),i=function(){};return function(){r.implement(this,n),this.callback=function(e,t){postMessage({type:"call",id:t,data:e})},this.emit=function(e,t){postMessage({type:"event",name:e,data:t})}}.call(i.prototype),new i};var n=e.main=null,r=e.sender=null;e.onmessage=function(t){var i=t.data;if(i.event&&r)r._signal(i.event,i.data);else if(i.command)if(n[i.command])n[i.command].apply(n,i.args);else{if(!e[i.command])throw new Error("Unknown command:"+i.command);e[i.command].apply(e,i.args)}else if(i.init){e.initBaseUrls(i.tlns),require("ace/lib/es5-shim"),r=e.sender=e.initSender();var s=require(i.module)[i.classname];n=e.main=new s(r)}}})(this),define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?tthis.end.column?1:0:ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.rowt)var r={row:t+1,column:0};else if(this.start.row=0&&t.row=0&&t.column<=e[t.row].length}function s(e,t){t.action!="insert"&&t.action!="remove"&&r(t,"delta.action must be 'insert' or 'remove'"),t.lines instanceof Array||r(t,"delta.lines must be an Array"),(!t.start||!t.end)&&r(t,"delta.start/end must be an present");var n=t.start;i(e,t.start)||r(t,"delta.start must be contained in document");var s=t.end;t.action=="remove"&&!i(e,s)&&r(t,"delta.end must contained in document for 'remove' actions");var o=s.row-n.row,u=s.column-(o==0?n.column:0);(o!=t.lines.length-1||t.lines[o].length!=u)&&r(t,"delta.range must match delta lines")}t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,s=e[r]||"";switch(t.action){case"insert":var o=t.lines;if(o.length===1)e[r]=s.substring(0,i)+t.lines[0]+s.substring(i);else{var u=[r,1].concat(t.lines);e.splice.apply(e,u),e[r]=s.substring(0,i)+e[r],e[r+t.lines.length-1]+=s.substring(i)}break;case"remove":var a=t.end.column,f=t.end.row;r===f?e[r]=s.substring(0,i)+s.substring(a):e.splice(r,f-r+1,s.substring(0,i)+e[f].substring(a))}}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){"use strict";var r={},i=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var o=0;othis.row)return;var n=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=e("./anchor").Anchor,a=function(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new u(this,e,t)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:"insert",lines:[t]},!0),this.clonePos(r)},this.clippedPos=function(e,t){var n=this.getLength();e===undefined?e=n:e<0?e=0:e>=n&&(e=n-1,t=undefined);var r=this.getLine(e);return t==undefined&&(t=r.length),t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e0,r=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){e instanceof o||(e=o.fromPoints(e.start,e.end));if(t.length===0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);var n;return t?n=this.insert(e.start,t):n=e.start,n},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n=e.action=="insert";if(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))return;n&&e.lines.length>2e4&&this.$splitAndapplyLargeDelta(e,2e4),i(this.$lines,e,t),this._signal("change",e)},this.$splitAndapplyLargeDelta=function(e,t){var n=e.lines,r=n.length,i=e.start.row,s=e.start.column,o=0,u=0;do{o=u,u+=t-1;var a=n.slice(o,u);if(u>r){e.lines=a,e.start.row=i+o,e.start.column=s;break}a.push(""),this.applyDelta({start:this.pos(i+o,s),end:this.pos(i+u,s=0),action:e.action,lines:a},!0)}while(!0)},this.revertDelta=function(e){this.applyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:e.action=="insert"?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length;for(var i=t||0,s=n.length;i0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n)/i:/^(\<\?php(?:\r\n|[ \t\r\n])|\ 143 | 144 | 145 | 146 | 151 | 152 | 153 |
154 |
155 |
156 |
157 | 158 |
159 |
160 | Line: 1, Column: 1 161 | 162 | Copy selection: 163 | 164 | 165 | 166 | 167 | 168 | 169 | 180 | 181 | 182 | Reset 183 | 184 |
185 | 186 |
187 |
188 |
189 |
190 |
191 |
192 | 216 | 217 | 218 | -------------------------------------------------------------------------------- /krumo/INSTALL: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | 3 | SETUP: How to install Krumo ? 4 | 5 | ------------------------------------------------------------------------------ 6 | 7 | In order to use Krumo you have to put it on your (development) server, and 8 | include it in your script. You can put it somewhere in the INCLUDE_PATH, or 9 | specify the full path to the "class.krumo.php" file. 10 | 11 | You have to modify the "krumo.ini" file too. It is the configuration file for 12 | Krumo. The first option is choosing a skin: 13 | 14 | [skin] 15 | selected = "orange" 16 | 17 | The value for this setting has to be the name of one of the sub-folders from the 18 | "Krumo/skins/" folder. If the value provided for the skin results in not finding 19 | the skin, the `default` skin will be used instead. 20 | 21 | The second option is used to set the correct web path to the folder where Krumo 22 | is installed. This is used in order to make the images from Krumo's CSS skins 23 | web-accessible. 24 | 25 | [css] 26 | url = "http://www.example.com/Krumo/" 27 | 28 | So far those two are the only configuration options. 29 | 30 | All the CSS files ("skin.css") from the "Krumo/skins/" sub-folders must have the 31 | proper permissions in order to be readable from Krumo. Same applies for 32 | "krumo.ini" and "krumo.js" files. -------------------------------------------------------------------------------- /krumo/LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 489 | 490 | Also add information on how to contact you by electronic and paper mail. 491 | 492 | You should also get your employer (if you work as a programmer) or your 493 | school, if any, to sign a "copyright disclaimer" for the library, if 494 | necessary. Here is a sample; alter the names: 495 | 496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. 498 | 499 | , 1 April 1990 500 | Ty Coon, President of Vice 501 | 502 | That's all there is to it! 503 | 504 | 505 | -------------------------------------------------------------------------------- /krumo/README: -------------------------------------------------------------------------------- 1 | ============================================================================= 2 | 3 | Krumo 4 | version 0.2.1a 5 | 6 | ============================================================================= 7 | 8 | You probably got this package from... 9 | http://www.sourceforge.net/projects/krumo/ 10 | 11 | If there is no licence agreement with this package please download 12 | a version from the location above. You must read and accept that 13 | licence to use this software. The file is titled simply LICENSE. 14 | 15 | OVERVIEW 16 | ------------------------------------------------------------------------------ 17 | To put it simply, Krumo is a replacement for print_r() and var_dump(). By 18 | definition Krumo is a debugging tool (for PHP5), which displays structured 19 | information about any PHP variable. 20 | 21 | A lot of developers use print_r() and var_dump() in the means of debugging 22 | tools. Although they were intended to present human readble information about a 23 | variable, we can all agree that in general they are not. Krumo is an 24 | alternative: it does the same job, but it presents the information beautified 25 | using CSS and DHTML. 26 | 27 | EXAMPLES 28 | ------------------------------------------------------------------------------ 29 | Here's a basic example, which will return a report on the array variable passed 30 | as argument to it: 31 | 32 | krumo(array('a1'=> 'A1', 3, 'red')); 33 | 34 | You can dump simultaneously more then one variable - here's another example: 35 | 36 | krumo($_SERVER, $_REQUEST); 37 | 38 | You probably saw from the examples above that some of the nodes are expandable, 39 | so if you want to inspect the nested information, click on them and they will 40 | expand; if you do not need that information shown simply click again on it to 41 | collapse it. Here's an example to test this: 42 | 43 | $x1->x2->x3->x4->x5->x6->x7->x8->x9 = 'X10'; 44 | krumo($x1); 45 | 46 | The krumo() is the only standalone function from the package, and this is 47 | because basic dumps about variables (like print_r() or var_dump()) are the most 48 | common tasks such functionality is used for. The rest of the functionality can 49 | be called using static calls to the Krumo class. Here are several more examples: 50 | 51 | // print a debug backgrace 52 | krumo::backtrace(); 53 | 54 | // print all the included(or required) files 55 | krumo::includes(); 56 | 57 | // print all the included functions 58 | krumo::functions(); 59 | 60 | // print all the declared classes 61 | krumo::classes(); 62 | 63 | // print all the defined constants 64 | krumo::defines(); 65 | 66 | ... and so on, etc. 67 | 68 | A full PHPDocumenter API documentation exists both in this package and at the 69 | project's website. 70 | 71 | INSTALL 72 | ------------------------------------------------------------------------------ 73 | Read the INSTALL file. 74 | 75 | DOCUMENTATION 76 | ------------------------------------------------------------------------------ 77 | As I said, a full PHPDocumenter API documentation can be found both in this 78 | package and at the project's website. 79 | 80 | SKINS 81 | ------------------------------------------------------------------------------ 82 | There are several skins pre-installed with this package, but if you wish you can 83 | create skins of your own. The skins are simply CSS files that are prepended to 84 | the result that Krumo prints. If you want to use images in your CSS (for 85 | background, list-style, etc), you have to put "%URL%" in front of the image URL 86 | in order hook it up to the skin folder and make the image web-accessible. 87 | 88 | Here's an example: 89 | 90 | ul.krumo-first {background: url(%url%bg.gif);} 91 | 92 | TODO 93 | ------------------------------------------------------------------------------ 94 | You can find the list of stuff that is going to be added to this project in the 95 | TODO file from this very package. 96 | 97 | CONTRIBUTION 98 | ----------------------------------------------------------------------------- 99 | If you download and use and possibly even extend this tool, please let us know. 100 | Any feedback, even bad, is always welcome and your suggestions are going to be 101 | considered for our next release. Please use our SourceForge page for that: 102 | 103 | http://www.sourceforge.net/projects/krumo/ 104 | -------------------------------------------------------------------------------- /krumo/TODO: -------------------------------------------------------------------------------- 1 | ****************************************************************************** 2 | 3 | Krumo: TODO 4 | 5 | ****************************************************************************** 6 | 7 | BUGS 8 | ---------------- 9 | - watch the SourceForge.net Bug Tracker 10 | 11 | Features: PHP 12 | ---------------- 13 | - Try to detect anonymous (lambda) functions 14 | - Try to detect whether an array is indexed or associated 15 | - Add var_export support for arrays and objects 16 | - Add JSON support for arrays and objects 17 | 18 | Features: GUI 19 | ---------------- 20 | - Nicer and friendlier skin(s) 21 | - Add top-level links for collapsing and expanding the whole tree 22 | - Add object & array -level links for collapsing and expanding all the 23 | nested nodes 24 | - Print all parent classes for the rendered objects -------------------------------------------------------------------------------- /krumo/VERSION: -------------------------------------------------------------------------------- 1 | 0.2.1a -------------------------------------------------------------------------------- /krumo/class.krumo.php: -------------------------------------------------------------------------------- 1 | 10 | * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License Version 2.1 11 | * 12 | * @package Krumo 13 | * @version $Id: class.krumo.php 22 2007-12-02 07:38:18Z Mrasnika $ 14 | */ 15 | 16 | ////////////////////////////////////////////////////////////////////////////// 17 | 18 | /** 19 | * backward compatibility: the DIR_SEP constant isn't used anymore 20 | */ 21 | if(!defined('DIR_SEP')) { 22 | define('DIR_SEP', DIRECTORY_SEPARATOR); 23 | } 24 | /** 25 | * backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2 26 | */ 27 | if (!defined('PATH_SEPARATOR')) { 28 | define('PATH_SEPARATOR', OS_WINDOWS ? ';' : ':'); 29 | } 30 | 31 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 32 | 33 | /** 34 | * Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is 35 | * not defined, include_path will be used. Set KRUMO_DIR only if any other module 36 | * or application has not already set it up. 37 | */ 38 | if (!defined('KRUMO_DIR')) { 39 | define('KRUMO_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR); 40 | } 41 | 42 | /** 43 | * This constant sets the maximum strings of strings that will be shown 44 | * as they are. Longer strings will be truncated with this length, and 45 | * their `full form` will be shown in a child node. 46 | */ 47 | if (!defined('KRUMO_TRUNCATE_LENGTH')) { 48 | define('KRUMO_TRUNCATE_LENGTH', 50); 49 | } 50 | 51 | ////////////////////////////////////////////////////////////////////////////// 52 | 53 | /** 54 | * Krumo API 55 | * 56 | * This class stores the Krumo API for rendering and 57 | * displaying the structured information it is reporting 58 | * 59 | * @package Krumo 60 | */ 61 | Class krumo { 62 | 63 | /** 64 | * Return Krumo version 65 | * 66 | * @return string 67 | * @access public 68 | * @static 69 | */ 70 | Public Static Function version() { 71 | return '0.2.1a'; 72 | } 73 | 74 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 75 | 76 | /** 77 | * Prints a debug backtrace 78 | * 79 | * @access public 80 | * @static 81 | */ 82 | Public Static Function backtrace() { 83 | 84 | // disabled ? 85 | // 86 | if (!krumo::_debug()) { 87 | return false; 88 | } 89 | 90 | // render it 91 | // 92 | return krumo::dump(debug_backtrace()); 93 | } 94 | 95 | /** 96 | * Prints a list of all currently declared classes. 97 | * 98 | * @access public 99 | * @static 100 | */ 101 | Public Static Function classes() { 102 | 103 | // disabled ? 104 | // 105 | if (!krumo::_debug()) { 106 | return false; 107 | } 108 | 109 | // render it 110 | // 111 | ?> 112 |
113 | This is a list of all currently declared classes. 114 |
115 | 136 |
137 | This is a list of all currently declared interfaces. 138 |
139 | 160 |
161 | This is a list of all currently included (or required) files. 162 |
163 | 184 |
185 | This is a list of all currently declared functions. 186 |
187 | 208 |
209 | This is a list of all currently declared constants (defines). 210 |
211 | 232 |
233 | This is a list of all currently loaded PHP extensions. 234 |
235 | 256 |
257 | This is a list of all HTTP request headers. 258 |
259 | php.ini 265 | * 266 | * @access public 267 | * @static 268 | */ 269 | Public Static Function phpini() { 270 | 271 | // disabled ? 272 | // 273 | if (!krumo::_debug()) { 274 | return false; 275 | } 276 | 277 | if (!is_readable(get_cfg_var('cfg_file_path'))) { 278 | return false; 279 | } 280 | 281 | // render it 282 | // 283 | ?> 284 |
285 | This is a list of the configuration settings read from . 286 |
287 | 308 |
309 | This is a list of all your configuration settings. 310 |
311 | include_path option. 317 | * 318 | * @access public 319 | * @static 320 | */ 321 | Public Static Function path() { 322 | 323 | // disabled ? 324 | // 325 | if (!krumo::_debug()) { 326 | return false; 327 | } 328 | 329 | // render it 330 | // 331 | ?> 332 |
333 | This is a list of the specified directories under your include_path option. 334 |
335 | $_REQUEST array. 341 | * 342 | * @access public 343 | * @static 344 | */ 345 | Public Static Function request() { 346 | 347 | // disabled ? 348 | // 349 | if (!krumo::_debug()) { 350 | return false; 351 | } 352 | 353 | // render it 354 | // 355 | ?> 356 |
357 | This is a list of all the values from the $_REQUEST array. 358 |
359 | $_GET array. 365 | * 366 | * @access public 367 | * @static 368 | */ 369 | Public Static Function get() { 370 | 371 | // disabled ? 372 | // 373 | if (!krumo::_debug()) { 374 | return false; 375 | } 376 | 377 | // render it 378 | // 379 | ?> 380 |
381 | This is a list of all the values from the $_GET array. 382 |
383 | $_POST array. 389 | * 390 | * @access public 391 | * @static 392 | */ 393 | Public Static Function post() { 394 | 395 | // disabled ? 396 | // 397 | if (!krumo::_debug()) { 398 | return false; 399 | } 400 | 401 | // render it 402 | // 403 | ?> 404 |
405 | This is a list of all the values from the $_POST array. 406 |
407 | $_SERVER array. 413 | * 414 | * @access public 415 | * @static 416 | */ 417 | Public Static Function server() { 418 | 419 | // disabled ? 420 | // 421 | if (!krumo::_debug()) { 422 | return false; 423 | } 424 | 425 | // render it 426 | // 427 | ?> 428 |
429 | This is a list of all the values from the $_SERVER array. 430 |
431 | $_COOKIE array. 437 | * 438 | * @access public 439 | * @static 440 | */ 441 | Public Static Function cookie() { 442 | 443 | // disabled ? 444 | // 445 | if (!krumo::_debug()) { 446 | return false; 447 | } 448 | 449 | // render it 450 | // 451 | ?> 452 |
453 | This is a list of all the values from the $_COOKIE array. 454 |
455 | $_ENV array. 461 | * 462 | * @access public 463 | * @static 464 | */ 465 | Public Static Function env() { 466 | 467 | // disabled ? 468 | // 469 | if (!krumo::_debug()) { 470 | return false; 471 | } 472 | 473 | // render it 474 | // 475 | ?> 476 |
477 | This is a list of all the values from the $_ENV array. 478 |
479 | $_SESSION array. 485 | * 486 | * @access public 487 | * @static 488 | */ 489 | Public Static Function session() { 490 | 491 | // disabled ? 492 | // 493 | if (!krumo::_debug()) { 494 | return false; 495 | } 496 | 497 | // render it 498 | // 499 | ?> 500 |
501 | This is a list of all the values from the $_SESSION array. 502 |
503 | 532 |
533 | This is a list of all the values from the INI file. 534 |
535 | 1) { 559 | $_ = func_get_args(); 560 | foreach($_ as $d) { 561 | krumo::dump($d); 562 | } 563 | return; 564 | } 565 | 566 | // the css ? 567 | // 568 | krumo::_css(); 569 | 570 | // find caller 571 | // 572 | $_ = debug_backtrace(); 573 | while($d = array_pop($_)) { 574 | if ((strToLower($d['function']) == 'krumo') || (strToLower(@$d['class']) == 'krumo')) { 575 | break; 576 | } 577 | } 578 | 579 | // the content 580 | // 581 | ?> 582 |
583 |
    584 | 585 |
  • 586 |
    587 |
    Krumo version
    | http://krumo.sourceforge.net 590 |
    591 | 592 | 593 | 594 | Called from , 595 | line 596 | 597 |   598 |
  • 599 |
600 |
601 | $bee){ 607 | if (is_object($bee)) { 608 | unset($hive[$i]->$_recursion_marker); 609 | } else { 610 | unset($hive[$i][$_recursion_marker]); 611 | } 612 | } 613 | } 614 | 615 | // PHP 4.x.x array reference bug... 616 | // 617 | if (is_array($data) && version_compare(PHP_VERSION, "5", "<")) { 618 | unset($GLOBALS[krumo::_marker()]); 619 | } 620 | } 621 | 622 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 623 | 624 | /** 625 | * Returns values from Krumo's configuration 626 | * 627 | * @param string $group 628 | * @param string $name 629 | * @param mixed $fallback 630 | * @return mixed 631 | * 632 | * @access private 633 | * @static 634 | */ 635 | Private Static Function _config($group, $name, $fallback=null) { 636 | 637 | static $_config = array(); 638 | 639 | // not loaded ? 640 | // 641 | if (empty($_config)) { 642 | $_config = (array) @parse_ini_file( 643 | KRUMO_DIR . 'krumo.ini', 644 | true); 645 | } 646 | 647 | // exists ? 648 | // 649 | return (isset($_config[$group][$name])) 650 | ? $_config[$group][$name] 651 | : $fallback; 652 | } 653 | 654 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 655 | 656 | /** 657 | * Print the skin (CSS) 658 | * 659 | * @return boolean 660 | * @access private 661 | * @static 662 | */ 663 | Private Static Function _css() { 664 | 665 | static $_css = false; 666 | 667 | // already set ? 668 | // 669 | if ($_css) { 670 | return true; 671 | } 672 | 673 | $css = ''; 674 | $skin = krumo::_config('skin', 'selected', 'default'); 675 | 676 | // custom selected skin ? 677 | // 678 | $_ = KRUMO_DIR . "skins/{$skin}/skin.css"; 679 | if ($fp = @fopen($_, 'r', 1)) { 680 | $css = fread($fp, filesize($_)); 681 | fclose($fp); 682 | } 683 | 684 | // defautl skin ? 685 | // 686 | if (!$css && ($skin != 'default')) { 687 | $skin = 'default'; 688 | $_ = KRUMO_DIR . "skins/default/skin.css"; 689 | $css = join('', @file($_)); 690 | } 691 | 692 | // print ? 693 | // 694 | if ($_css = $css != '') { 695 | 696 | // fix the urls 697 | // 698 | $css_url = krumo::_config('css', 'url') . "skins/{$skin}/"; 699 | $css = preg_replace('~%url%~Uis', $css_url, $css); 700 | 701 | // the CSS 702 | // 703 | ?> 704 | 705 | 711 | 715 | 721 | 865 |
  • 866 |
    869 | 870 | 871 | (NULL) 872 |
    873 |
  • 874 | $_recursion_marker++) 922 | : @($bee[$_recursion_marker]++); 923 | 924 | $_[0][] =& $bee; 925 | } 926 | 927 | // return all bees 928 | // 929 | return $_[0]; 930 | } 931 | 932 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 933 | 934 | /** 935 | * Render a dump for the properties of an array or objeect 936 | * 937 | * @param mixed &$data 938 | * @access private 939 | * @static 940 | */ 941 | Private Static Function _vars(&$data) { 942 | 943 | $_is_object = is_object($data); 944 | 945 | // test for references in order to 946 | // prevent endless recursion loops 947 | // 948 | $_recursion_marker = krumo::_marker(); 949 | $_r = ($_is_object) 950 | ? @$data->$_recursion_marker 951 | : @$data[$_recursion_marker] ; 952 | $_r = (integer) $_r; 953 | 954 | // recursion detected 955 | // 956 | if ($_r > 0) { 957 | return krumo::_recursion(); 958 | } 959 | 960 | // stain it 961 | // 962 | krumo::_hive($data); 963 | 964 | // render it 965 | // 966 | ?> 967 | 999 | 1012 | 1025 | 1040 |
  • 1041 | 1042 |
    0) {?> onClick="krumo.toggle(this);" 1044 | onMouseOver="krumo.over(this);" 1045 | onMouseOut="krumo.out(this);"> 1046 | 1047 | 1048 | (Array, ) 1053 | 1054 | 1055 | 1061 | | 1062 | (Callback) 1063 | ::(); 1066 | 1069 | 1070 |
    1071 | 1072 | 1075 |
  • 1076 | 1091 |
  • 1092 | 1093 |
    0) {?> onClick="krumo.toggle(this);" 1095 | onMouseOver="krumo.over(this);" 1096 | onMouseOut="krumo.out(this);"> 1097 | 1098 | 1099 | (Object) 1100 | 1101 |
    1102 | 1103 | 1106 |
  • 1107 | 1122 |
  • 1123 | 1124 |
    1127 | 1128 | 1129 | (Resource) 1130 | 1131 |
    1132 | 1133 |
  • 1134 | 1149 |
  • 1150 | 1151 |
    1154 | 1155 | 1156 | (Boolean) 1157 | 1158 |
    1159 | 1160 |
  • 1161 | 1176 |
  • 1177 | 1178 |
    1181 | 1182 | 1183 | (Integer) 1184 | 1185 |
    1186 | 1187 |
  • 1188 | 1203 |
  • 1204 | 1205 |
    1208 | 1209 | 1210 | (Float) 1211 | 1212 |
    1213 | 1214 |
  • 1215 | KRUMO_TRUNCATE_LENGTH) { 1235 | $_ = substr($data, 0, KRUMO_TRUNCATE_LENGTH - 3) . '...'; 1236 | $_extra = true; 1237 | } 1238 | ?> 1239 |
  • 1240 | 1241 |
    onClick="krumo.toggle(this);" 1243 | onMouseOver="krumo.over(this);" 1244 | onMouseOut="krumo.out(this);"> 1245 | 1246 | 1247 | (String, 1248 | characters ) 1250 | 1251 | 1252 | 1257 | | 1258 | (Callback) 1259 | (); 1260 | 1263 | 1264 |
    1265 | 1266 | 1267 | 1276 | 1277 |
  • 1278 | 1305 | -------------------------------------------------------------------------------- /krumo/krumo.ini: -------------------------------------------------------------------------------- 1 | ; 2 | ; KRUMO CONFIGURATION FILE 3 | ; 4 | 5 | [skin] 6 | selected = "schablon.com" 7 | ; 8 | ; Change the above value to set the CSS skin used to render 9 | ; Krumo layout. If the skin is not found, then the "default" one 10 | ; is going to be used. 11 | ; 12 | 13 | [css] 14 | url = "krumo/" 15 | ; 16 | ; This value is used to set the URL path to 17 | ; where the Krumo folder is. This is required in 18 | ; order to have web access to Krumo's CSS and 19 | ; image files. 20 | ; -------------------------------------------------------------------------------- /krumo/krumo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * JavaScript routines for Krumo 3 | * 4 | * @version $Id: krumo.js 22 2007-12-02 07:38:18Z Mrasnika $ 5 | * @link http://sourceforge.net/projects/krumo 6 | */ 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | 10 | /** 11 | * Krumo JS Class 12 | */ 13 | function krumo() { 14 | } 15 | 16 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 17 | 18 | /** 19 | * Add a CSS class to an HTML element 20 | * 21 | * @param HtmlElement el 22 | * @param string className 23 | * @return void 24 | */ 25 | krumo.reclass = function(el, className) { 26 | if (el.className.indexOf(className) < 0) { 27 | el.className += (' ' + className); 28 | } 29 | } 30 | 31 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 32 | 33 | /** 34 | * Remove a CSS class to an HTML element 35 | * 36 | * @param HtmlElement el 37 | * @param string className 38 | * @return void 39 | */ 40 | krumo.unclass = function(el, className) { 41 | if (el.className.indexOf(className) > -1) { 42 | el.className = el.className.replace(className, ''); 43 | } 44 | } 45 | 46 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 47 | 48 | /** 49 | * Toggle the nodes connected to an HTML element 50 | * 51 | * @param HtmlElement el 52 | * @return void 53 | */ 54 | krumo.toggle = function(el) { 55 | var ul = el.parentNode.getElementsByTagName('ul'); 56 | for (var i=0; i 6 | */ 7 | 8 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 9 | 10 | ul.krumo-node { 11 | margin: 0px; 12 | padding: 0px; 13 | } 14 | ul.krumo-node ul { 15 | margin-left: 20px; 16 | } 17 | * html ul.krumo-node ul { 18 | margin-left: 24px; 19 | } 20 | div.krumo-root { 21 | border: solid 1px black; 22 | margin: 1em 0em; 23 | } 24 | ul.krumo-first { 25 | font: normal 12px arial; 26 | border: solid 2px white; 27 | border-top-width:1px; 28 | background: url(%url%bg.gif); 29 | } 30 | 31 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 32 | 33 | li.krumo-child { 34 | display:block; 35 | list-style: none; 36 | padding: 0px; 37 | margin: 0px; 38 | overflow:hidden; 39 | } 40 | div.krumo-element { 41 | cursor:default; 42 | 43 | line-height: 24px; 44 | display:block; 45 | 46 | clear:both; 47 | white-space:nowrap; 48 | 49 | border-top: solid 1px white; 50 | background: #BFDFFF; 51 | padding-left: 10px; 52 | } 53 | * html div.krumo-element { 54 | padding-bottom: 3px; 55 | } 56 | a.krumo-name { 57 | color:navy; 58 | font: bold 13px Arial; 59 | } 60 | a.krumo-name big { 61 | font: bold 20pt Georgia; 62 | line-height: 14px; 63 | position:relative; 64 | top:2px; 65 | left:-2px; 66 | } 67 | * html a.krumo-name big { 68 | font: bold 19pt Georgia; 69 | top: 5px; 70 | left: 0px; 71 | line-height: 9px; 72 | height: 12px; 73 | padding: 0px; 74 | margin: 0px; 75 | } 76 | div.krumo-expand { 77 | background: #AAD5FF; 78 | cursor:pointer; 79 | } 80 | div.krumo-hover { 81 | background: #FFBE7D; 82 | } 83 | 84 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 85 | 86 | div.krumo-preview { 87 | font: normal 13px courier new; 88 | padding: 5px 5px 14px 5px; 89 | background: white; 90 | border-top: 0px; 91 | overflow:auto; 92 | } 93 | * html div.krumo-preview { 94 | padding-top: 2px; 95 | } 96 | 97 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 98 | 99 | li.krumo-footnote { 100 | background:white; 101 | padding: 2px 5px; 102 | list-style:none; 103 | border-top: solid 1px #bebebe; 104 | margin-top:2px; 105 | cursor:default; 106 | } 107 | * html li.krumo-footnote { 108 | line-height: 13px; 109 | } 110 | div.krumo-version { 111 | float:right; 112 | } 113 | li.krumo-footnote h6 { 114 | font: bold 11px verdana; 115 | margin: 0px; 116 | padding: 0px; 117 | color:navy; 118 | display:inline; 119 | } 120 | * html li.krumo-footnote h6 { 121 | margin-right: 3px; 122 | } 123 | li.krumo-footnote a { 124 | font: bold 10px arial; 125 | color: #434343; 126 | text-decoration:none; 127 | } 128 | li.krumo-footnote a:hover { 129 | color:black; 130 | } 131 | 132 | li.krumo-footnote span.krumo-call { 133 | font:normal 11px verdana; 134 | position: relative; 135 | top: 1px; 136 | } 137 | li.krumo-footnote span.krumo-call code { 138 | font-weight:bold; 139 | } 140 | 141 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 142 | 143 | div.krumo-title { 144 | font: normal 11px verdana ; 145 | position:relative; 146 | top:9px; 147 | cursor:default; 148 | line-height:2px; 149 | } 150 | 151 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 152 | 153 | strong.krumo-array-length, 154 | strong.krumo-string-length { 155 | font-weight: normal; 156 | } 157 | 158 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 159 | -------------------------------------------------------------------------------- /krumo/skins/default/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seldaek/php-console/06d1d7be7dfbb03b562bcf837b51d0e4a21dadb7/krumo/skins/default/bg.gif -------------------------------------------------------------------------------- /krumo/skins/default/skin.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Krumo Default Skin 3 | * 4 | * @version $Id: skin.css 6 2007-06-16 06:37:27Z mrasnika $ 5 | * @author Kaloyan K. Tsvetkov 6 | */ 7 | 8 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 9 | 10 | ul.krumo-node { 11 | margin: 0px; 12 | padding: 0px; 13 | } 14 | ul.krumo-node ul { 15 | margin-left: 20px; 16 | } 17 | * html ul.krumo-node ul { 18 | margin-left: 24px; 19 | } 20 | div.krumo-root { 21 | border: solid 1px black; 22 | margin: 1em 0em; 23 | } 24 | ul.krumo-first { 25 | font: normal 12px arial; 26 | border: solid 2px white; 27 | border-top-width:1px; 28 | background: url(%url%bg.gif); 29 | } 30 | 31 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 32 | 33 | li.krumo-child { 34 | display:block; 35 | list-style: none; 36 | padding: 0px; 37 | margin: 0px; 38 | overflow:hidden; 39 | } 40 | div.krumo-element { 41 | cursor:default; 42 | 43 | line-height: 24px; 44 | display:block; 45 | 46 | clear:both; 47 | white-space:nowrap; 48 | 49 | border-top: solid 1px white; 50 | background: #E8E8E8; 51 | padding-left: 10px; 52 | } 53 | * html div.krumo-element { 54 | padding-bottom: 3px; 55 | } 56 | a.krumo-name { 57 | color:#2C5858; 58 | font: bold 13px Arial; 59 | } 60 | a.krumo-name big { 61 | font: bold 20pt Georgia; 62 | line-height: 14px; 63 | position:relative; 64 | top:2px; 65 | left:-2px; 66 | } 67 | * html a.krumo-name big { 68 | font: bold 19pt Georgia; 69 | top: 5px; 70 | left: 0px; 71 | line-height: 9px; 72 | height: 12px; 73 | padding: 0px; 74 | margin: 0px; 75 | } 76 | div.krumo-expand { 77 | background: #CCCCCC; 78 | cursor:pointer; 79 | } 80 | div.krumo-hover { 81 | background: #B7DBDB; 82 | } 83 | 84 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 85 | 86 | div.krumo-preview { 87 | font: normal 13px courier new; 88 | padding: 5px 5px 14px 5px; 89 | background: white; 90 | border-top: 0px; 91 | overflow:auto; 92 | } 93 | * html div.krumo-preview { 94 | padding-top: 2px; 95 | } 96 | 97 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 98 | 99 | li.krumo-footnote { 100 | background:white; 101 | padding: 2px 5px; 102 | list-style:none; 103 | border-top: solid 1px #bebebe; 104 | margin-top:2px; 105 | cursor:default; 106 | } 107 | * html li.krumo-footnote { 108 | line-height: 13px; 109 | } 110 | div.krumo-version { 111 | float:right; 112 | } 113 | li.krumo-footnote h6 { 114 | font: bold 11px verdana; 115 | margin: 0px; 116 | padding: 0px; 117 | color:#366D6D; 118 | display:inline; 119 | } 120 | * html li.krumo-footnote h6 { 121 | margin-right: 3px; 122 | } 123 | li.krumo-footnote a { 124 | font: bold 10px arial; 125 | color: #434343; 126 | text-decoration:none; 127 | } 128 | li.krumo-footnote a:hover { 129 | color:black; 130 | } 131 | 132 | li.krumo-footnote span.krumo-call { 133 | font:normal 11px verdana; 134 | position: relative; 135 | top: 1px; 136 | } 137 | li.krumo-footnote span.krumo-call code { 138 | font-weight:bold; 139 | } 140 | 141 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 142 | 143 | div.krumo-title { 144 | font: normal 11px verdana ; 145 | position:relative; 146 | top:9px; 147 | cursor:default; 148 | line-height:2px; 149 | } 150 | 151 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 152 | 153 | strong.krumo-array-length, 154 | strong.krumo-string-length { 155 | font-weight: normal; 156 | } 157 | 158 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 159 | -------------------------------------------------------------------------------- /krumo/skins/green/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seldaek/php-console/06d1d7be7dfbb03b562bcf837b51d0e4a21dadb7/krumo/skins/green/bg.gif -------------------------------------------------------------------------------- /krumo/skins/green/skin.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Krumo "Green" Skin 3 | * 4 | * @version $Id: skin.css 6 2007-06-16 06:37:27Z mrasnika $ 5 | * @author Kaloyan K. Tsvetkov 6 | */ 7 | 8 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 9 | 10 | ul.krumo-node { 11 | margin: 0px; 12 | padding: 0px; 13 | } 14 | ul.krumo-node ul { 15 | margin-left: 20px; 16 | } 17 | * html ul.krumo-node ul { 18 | margin-left: 24px; 19 | } 20 | div.krumo-root { 21 | border: solid 1px black; 22 | margin: 1em 0em; 23 | } 24 | ul.krumo-first { 25 | font: normal 12px arial; 26 | border: solid 2px white; 27 | border-top-width:1px; 28 | background: url(%url%bg.gif); 29 | } 30 | 31 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 32 | 33 | li.krumo-child { 34 | display:block; 35 | list-style: none; 36 | padding: 0px; 37 | margin: 0px; 38 | overflow:hidden; 39 | } 40 | div.krumo-element { 41 | cursor:default; 42 | 43 | line-height: 24px; 44 | display:block; 45 | 46 | clear:both; 47 | white-space:nowrap; 48 | 49 | border-top: solid 1px white; 50 | background: #D7F4CA; 51 | padding-left: 10px; 52 | } 53 | * html div.krumo-element { 54 | padding-bottom: 3px; 55 | } 56 | a.krumo-name { 57 | color:#004000; 58 | font: bold 13px Arial; 59 | } 60 | a.krumo-name big { 61 | font: bold 20pt Georgia; 62 | line-height: 14px; 63 | position:relative; 64 | top:2px; 65 | left:-2px; 66 | } 67 | * html a.krumo-name big { 68 | font: bold 19pt Georgia; 69 | top: 5px; 70 | left: 0px; 71 | line-height: 9px; 72 | height: 12px; 73 | padding: 0px; 74 | margin: 0px; 75 | } 76 | div.krumo-expand { 77 | background: #C0EEAC; 78 | cursor:pointer; 79 | } 80 | div.krumo-hover { 81 | background: gold; 82 | } 83 | 84 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 85 | 86 | div.krumo-preview { 87 | font: normal 13px courier new; 88 | padding: 5px 5px 14px 5px; 89 | background: white; 90 | border-top: 0px; 91 | overflow:auto; 92 | } 93 | * html div.krumo-preview { 94 | padding-top: 2px; 95 | } 96 | 97 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 98 | 99 | li.krumo-footnote { 100 | background:white; 101 | padding: 2px 5px; 102 | list-style:none; 103 | border-top: solid 1px #bebebe; 104 | margin-top:2px; 105 | cursor:default; 106 | } 107 | * html li.krumo-footnote { 108 | line-height: 13px; 109 | } 110 | div.krumo-version { 111 | float:right; 112 | } 113 | li.krumo-footnote h6 { 114 | font: bold 11px verdana; 115 | margin: 0px; 116 | padding: 0px; 117 | color:#008040; 118 | display:inline; 119 | } 120 | * html li.krumo-footnote h6 { 121 | margin-right: 3px; 122 | } 123 | li.krumo-footnote a { 124 | font: bold 10px arial; 125 | color: #434343; 126 | text-decoration:none; 127 | } 128 | li.krumo-footnote a:hover { 129 | color:black; 130 | } 131 | 132 | li.krumo-footnote span.krumo-call { 133 | font:normal 11px verdana; 134 | position: relative; 135 | top: 1px; 136 | } 137 | li.krumo-footnote span.krumo-call code { 138 | font-weight:bold; 139 | } 140 | 141 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 142 | 143 | div.krumo-title { 144 | font: normal 11px verdana ; 145 | position:relative; 146 | top:9px; 147 | cursor:default; 148 | line-height:2px; 149 | } 150 | 151 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 152 | 153 | strong.krumo-array-length, 154 | strong.krumo-string-length { 155 | font-weight: normal; 156 | } 157 | 158 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 159 | -------------------------------------------------------------------------------- /krumo/skins/orange/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seldaek/php-console/06d1d7be7dfbb03b562bcf837b51d0e4a21dadb7/krumo/skins/orange/bg.gif -------------------------------------------------------------------------------- /krumo/skins/orange/skin.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Krumo "Orange" Skin 3 | * 4 | * @version $Id: skin.css 6 2007-06-16 06:37:27Z mrasnika $ 5 | * @author Kaloyan K. Tsvetkov 6 | */ 7 | 8 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 9 | 10 | ul.krumo-node { 11 | margin: 0px; 12 | padding: 0px; 13 | } 14 | ul.krumo-node ul { 15 | margin-left: 20px; 16 | } 17 | * html ul.krumo-node ul { 18 | margin-left: 24px; 19 | } 20 | div.krumo-root { 21 | border: solid 1px black; 22 | margin: 1em 0em; 23 | } 24 | ul.krumo-first { 25 | font: normal 12px arial; 26 | border: solid 2px white; 27 | border-top-width:1px; 28 | background: url(%url%bg.gif); 29 | } 30 | 31 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 32 | 33 | li.krumo-child { 34 | display:block; 35 | list-style: none; 36 | padding: 0px; 37 | margin: 0px; 38 | overflow:hidden; 39 | } 40 | div.krumo-element { 41 | cursor:default; 42 | 43 | line-height: 24px; 44 | display:block; 45 | 46 | clear:both; 47 | white-space:nowrap; 48 | 49 | border-top: solid 1px white; 50 | background: #FCEBA9; 51 | padding-left: 10px; 52 | } 53 | * html div.krumo-element { 54 | padding-bottom: 3px; 55 | } 56 | a.krumo-name { 57 | color:#404000; 58 | font: bold 13px Arial; 59 | } 60 | a.krumo-name big { 61 | font: bold 20pt Georgia; 62 | line-height: 14px; 63 | position:relative; 64 | top:2px; 65 | left:-2px; 66 | } 67 | * html a.krumo-name big { 68 | font: bold 19pt Georgia; 69 | top: 5px; 70 | left: 0px; 71 | line-height: 9px; 72 | height: 12px; 73 | padding: 0px; 74 | margin: 0px; 75 | } 76 | div.krumo-expand { 77 | background: #FADB61; 78 | cursor:pointer; 79 | } 80 | div.krumo-hover { 81 | background: #FF8A4B; 82 | } 83 | 84 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 85 | 86 | div.krumo-preview { 87 | font: normal 13px courier new; 88 | padding: 5px 5px 14px 5px; 89 | background: white; 90 | border-top: 0px; 91 | overflow:auto; 92 | } 93 | * html div.krumo-preview { 94 | padding-top: 2px; 95 | } 96 | 97 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 98 | 99 | li.krumo-footnote { 100 | background:white; 101 | padding: 2px 5px; 102 | list-style:none; 103 | border-top: solid 1px #bebebe; 104 | margin-top:2px; 105 | cursor:default; 106 | } 107 | * html li.krumo-footnote { 108 | line-height: 13px; 109 | } 110 | div.krumo-version { 111 | float:right; 112 | } 113 | li.krumo-footnote h6 { 114 | font: bold 11px verdana; 115 | margin: 0px; 116 | padding: 0px; 117 | color:#E87400; 118 | display:inline; 119 | } 120 | * html li.krumo-footnote h6 { 121 | margin-right: 3px; 122 | } 123 | li.krumo-footnote a { 124 | font: bold 10px arial; 125 | color: #434343; 126 | text-decoration:none; 127 | } 128 | li.krumo-footnote a:hover { 129 | color:black; 130 | } 131 | 132 | li.krumo-footnote span.krumo-call { 133 | font:normal 11px verdana; 134 | position: relative; 135 | top: 1px; 136 | } 137 | li.krumo-footnote span.krumo-call code { 138 | font-weight:bold; 139 | } 140 | 141 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 142 | 143 | div.krumo-title { 144 | font: normal 11px verdana ; 145 | position:relative; 146 | top:9px; 147 | cursor:default; 148 | line-height:2px; 149 | } 150 | 151 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 152 | 153 | strong.krumo-array-length, 154 | strong.krumo-string-length { 155 | font-weight: normal; 156 | } 157 | 158 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 159 | -------------------------------------------------------------------------------- /krumo/skins/schablon.com/collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seldaek/php-console/06d1d7be7dfbb03b562bcf837b51d0e4a21dadb7/krumo/skins/schablon.com/collapsed.gif -------------------------------------------------------------------------------- /krumo/skins/schablon.com/dotted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seldaek/php-console/06d1d7be7dfbb03b562bcf837b51d0e4a21dadb7/krumo/skins/schablon.com/dotted.gif -------------------------------------------------------------------------------- /krumo/skins/schablon.com/empty.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seldaek/php-console/06d1d7be7dfbb03b562bcf837b51d0e4a21dadb7/krumo/skins/schablon.com/empty.gif -------------------------------------------------------------------------------- /krumo/skins/schablon.com/expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seldaek/php-console/06d1d7be7dfbb03b562bcf837b51d0e4a21dadb7/krumo/skins/schablon.com/expanded.gif -------------------------------------------------------------------------------- /krumo/skins/schablon.com/skin.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Krumo `Schablon.com` Skin 3 | * 4 | * @version $Id: skin.css 6 2007-06-16 06:37:27Z mrasnika $ 5 | * @author Kaloyan K. Tsvetkov 6 | */ 7 | 8 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 9 | 10 | ul.krumo-node { 11 | margin: 0px; 12 | padding: 0px; 13 | background-color: white; 14 | } 15 | ul.krumo-node ul { 16 | margin-left: 20px; 17 | } 18 | * html ul.krumo-node ul { 19 | margin-left: 24px; 20 | } 21 | div.krumo-root { 22 | border: solid 1px black; 23 | margin: 1em 0em; 24 | } 25 | ul.krumo-first { 26 | font: normal 11px tahoma, verdana; 27 | border: solid 1px white; 28 | } 29 | 30 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 31 | 32 | li.krumo-child { 33 | display:block; 34 | list-style: none; 35 | padding: 0px; 36 | margin: 0px; 37 | overflow:hidden; 38 | } 39 | div.krumo-element { 40 | cursor:default; 41 | display:block; 42 | clear:both; 43 | white-space:nowrap; 44 | 45 | background-color: white; 46 | background-image: url(%url%empty.gif); 47 | background-repeat: no-repeat; 48 | background-position: 6px 5px; 49 | padding: 2px 0px 3px 20px; 50 | } 51 | * html div.krumo-element { 52 | padding-bottom: 3px; 53 | line-height: 13px; 54 | } 55 | div.krumo-expand { 56 | background-image: url(%url%collapsed.gif); 57 | cursor:pointer; 58 | } 59 | div.krumo-hover { 60 | background-color: #BFDFFF; 61 | } 62 | div.krumo-opened { 63 | background-image: url(%url%expanded.gif); 64 | } 65 | a.krumo-name { 66 | color:navy; 67 | font: bold 13px courier new; 68 | line-height:12px; 69 | } 70 | a.krumo-name big { 71 | font: bold 16pt Georgia; 72 | line-height: 10px; 73 | position:relative; 74 | top:2px; 75 | left:-2px; 76 | } 77 | * html a.krumo-name big { 78 | font: bold 15pt Georgia; 79 | float:left; 80 | top: -5px; 81 | left: 0px; 82 | padding: 0px; 83 | margin: 0px; 84 | } 85 | em.krumo-type { 86 | font-style:normal; 87 | margin: 0px 2px; 88 | } 89 | 90 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 91 | 92 | div.krumo-preview { 93 | font: normal 13px courier new; 94 | padding: 5px ; 95 | background: lightyellow; 96 | border: solid 1px #808000; 97 | overflow:auto; 98 | margin: 5px 1em 1em 0px; 99 | } 100 | * html div.krumo-preview { 101 | padding-top: 2px; 102 | } 103 | 104 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 105 | 106 | li.krumo-footnote { 107 | background: white url(%url%dotted.gif) repeat-x; 108 | padding: 4px 5px 3px 5px; 109 | list-style:none; 110 | cursor:default; 111 | } 112 | * html li.krumo-footnote { 113 | line-height: 13px; 114 | } 115 | div.krumo-version { 116 | float:right; 117 | } 118 | li.krumo-footnote h6 { 119 | font: bold 11px verdana; 120 | margin: 0px; 121 | padding: 0px; 122 | color:navy; 123 | display:inline; 124 | } 125 | * html li.krumo-footnote h6 { 126 | margin-right: 3px; 127 | } 128 | li.krumo-footnote a { 129 | font: bold 10px arial; 130 | color: #434343; 131 | text-decoration:none; 132 | } 133 | li.krumo-footnote a:hover { 134 | color:black; 135 | } 136 | 137 | 138 | li.krumo-footnote span.krumo-call { 139 | font:normal 11px tahoma, verdana; 140 | position: relative; 141 | top: 1px; 142 | } 143 | li.krumo-footnote span.krumo-call code { 144 | font-weight:bold; 145 | } 146 | 147 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 148 | 149 | div.krumo-title { 150 | font: normal 11px tahoma, verdana; 151 | position:relative; 152 | top:9px; 153 | cursor:default; 154 | line-height:2px; 155 | } 156 | 157 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 158 | 159 | strong.krumo-array-length, 160 | strong.krumo-string-length { 161 | font-weight: normal; 162 | color: #000099; 163 | } 164 | 165 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 166 | -------------------------------------------------------------------------------- /lib/MelodyPlugin.php: -------------------------------------------------------------------------------- 1 | find($candidateName, null, array(getcwd()))) { 27 | return true; 28 | } 29 | } 30 | 31 | return false; 32 | } 33 | 34 | public function runScript($__source_code, $__bootstrap_file) 35 | { 36 | $tmpDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'melody-composer'; 37 | 38 | // make sure the melody subprocess has a composer home, 39 | // which is not the case when running from webcontext 40 | $_ENV['COMPOSER_HOME'] = $tmpDir; 41 | 42 | $melody = new Melody(); 43 | $runConfiguration = new RunConfiguration(/*true, true*/); 44 | $userConfiguration = new UserConfiguration(); 45 | $executor = function (Process $process, $verbose) 46 | { 47 | $callback = function ($type, $text) 48 | { 49 | // we only have one output channel to the browser, just echo "all the things" 50 | echo $text; 51 | }; 52 | $process->setTimeout($this->timeout); 53 | $process->run($callback); 54 | }; 55 | 56 | //TODO missing $__bootstrap_file support 57 | /* 58 | if ($__bootstrap_file) { 59 | require $__bootstrap_file; 60 | } 61 | */ 62 | 63 | $tmpFile = tempnam($tmpDir, '_script'); 64 | register_shutdown_function(function() use ($tmpFile) { 65 | @unlink($tmpFile); 66 | }); 67 | file_put_contents($tmpFile, $__source_code); 68 | $melody->run($tmpFile, array(), $runConfiguration, $userConfiguration, $executor); 69 | } 70 | 71 | public function setTimeout($timeout) { 72 | $this->timeout = $timeout; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Seldaek/php-console/06d1d7be7dfbb03b562bcf837b51d0e4a21dadb7/loader.gif -------------------------------------------------------------------------------- /php-console.js: -------------------------------------------------------------------------------- 1 | /*jslint browser: true */ 2 | /*global ace, jQuery */ 3 | /** 4 | * PHP Console 5 | * 6 | * A web-based php debug console 7 | * 8 | * Copyright (C) 2010, Jordi Boggiano 9 | * http://seld.be/ - j.boggiano@seld.be 10 | * 11 | * Licensed under the new BSD License 12 | * See the LICENSE file for details 13 | * 14 | * Source on Github http://github.com/Seldaek/php-console 15 | */ 16 | (function (require, $, ace) { 17 | "use strict"; 18 | 19 | var updateStatusBar, prepareClippyButton, refreshKrumoState, handleSubmit, initializeAce, handleAjaxError, 20 | options, editor; 21 | options = { 22 | tabsize: 4, 23 | editor: 'editor' 24 | }; 25 | 26 | /** 27 | * updates the text of the status bar 28 | */ 29 | updateStatusBar = function (e) { 30 | var cursor_position = editor.getCursorPosition(); 31 | $('.statusbar .position').text('Line: ' + (1 + cursor_position.row) + ', Column: ' + cursor_position.column); 32 | }; 33 | 34 | /** 35 | * prepares a clippy button for clipboard access 36 | */ 37 | prepareClippyButton = function (e) { 38 | var selection = editor.getSession().doc.getTextRange(editor.getSelectionRange()); 39 | if (!selection) { 40 | $('.statusbar .copy').hide(); 41 | return; 42 | } 43 | $('#clippy embed').attr('FlashVars', 'text=' + selection); 44 | $('#clippy param[name="FlashVars"]').attr('value', 'text=' + selection); 45 | $('.statusbar .copy').html($('.statusbar .copy').html()).show(); 46 | }; 47 | 48 | /** 49 | * adds a toggle button to expand/collapse all krumo sub-trees at once 50 | */ 51 | refreshKrumoState = function () { 52 | if ($('.krumo-expand').length > 0) { 53 | $('Toggle all') 54 | .click(function (e) { 55 | $('div.krumo-element.krumo-expand').each(function (idx, el) { 56 | window.krumo.toggle(el); 57 | }); 58 | e.preventDefault(); 59 | }) 60 | .prependTo('.output'); 61 | } 62 | }; 63 | 64 | /** 65 | * does an async request to eval the php code and displays the result 66 | */ 67 | handleSubmit = function (e) { 68 | e.preventDefault(); 69 | $('div.output').html(' Loading ...'); 70 | 71 | // store session 72 | if (window.localStorage) { 73 | localStorage.setItem('phpCode', editor.getSession().getValue()); 74 | } 75 | 76 | var controlChars = { 77 | 'NUL' : /\x00/g, // Null char 78 | 'SOH' : /\x01/g, // Start of Heading 79 | 'STX' : /\x02/g, // Start of Text 80 | 'ETX' : /\x03/g, // End of Text 81 | 'EOT' : /\x04/g, // End of Transmission 82 | 'ENQ' : /\x05/g, // Enquiry 83 | 'ACK' : /\x06/g, // Acknowledgment 84 | 'BEL' : /\x07/g, // Bell 85 | 'BS' : /\x08/g, // Back Space 86 | 'SO' : /\x0E/g, // Shift Out / X-On 87 | 'SI' : /\x0F/g, // Shift In / X-Off 88 | 'DLE' : /\x10/g, // Data Line Escape 89 | 'DC1' : /\x11/g, // Device Control 1 (oft. XON) 90 | 'DC2' : /\x12/g, // Device Control 2 91 | 'DC3' : /\x13/g, // Device Control 3 (oft. XOFF) 92 | 'DC4' : /\x14/g, // Device Control 4 93 | 'NAK' : /\x15/g, // Negative Acknowledgement 94 | 'SYN' : /\x16/g, // Synchronous Idle 95 | 'ETB' : /\x17/g, // End of Transmit Block 96 | 'CAN' : /\x18/g, // Cancel 97 | 'EM' : /\x19/g, // End of Medium 98 | 'SUB' : /\x1A/g, // Substitute 99 | 'ESC' : /\x1B/g, // Escape 100 | 'FS' : /\x1C/g, // File Separator 101 | 'GS' : /\x1D/g, // Group Separator 102 | 'RS' : /\x1E/g, // Record Separator 103 | 'US' : /\x1F/g // Unit Separator 104 | }; 105 | 106 | // eval server-side 107 | $.post('?js=1', { code: editor.getSession().getValue() }, function (res, status, jqXHR) { 108 | var mem = jqXHR.getResponseHeader("X-Memory-Usage") || "", 109 | rendertime = jqXHR.getResponseHeader("X-Rendertime") || ""; 110 | 111 | if (mem || rendertime) { 112 | $('.statusbar .runtime-info').text('Memory usage: '+ mem + ' MB, Rendertime: ' + rendertime + 'ms'); 113 | } else { 114 | $('.statusbar .runtime-info').text(''); 115 | } 116 | 117 | if (res.match(/#end-php-console-output#$/)) { 118 | var result = res.substring(0, res.length - 24); 119 | $.each(controlChars, function (identifier, regex) { 120 | result = result.replace(regex, '' + identifier + ''); 121 | }); 122 | $('div.output').html(result); 123 | } else { 124 | $('div.output').html(res + "

    Script ended unexpectedly."); 125 | } 126 | refreshKrumoState(); 127 | }); 128 | }; 129 | 130 | handleAjaxError = function (event, jqxhr, settings, exception) { 131 | $('div.output').html("Error occurred while posting your code."); 132 | refreshKrumoState(); 133 | }; 134 | 135 | initializeAce = function () { 136 | var PhpMode, code, storedCode; 137 | 138 | code = $('#' + options.editor).text(); 139 | 140 | // reload last session 141 | if (window.localStorage && code.match(/(<\?php)?\s*/)) { 142 | storedCode = localStorage.getItem('phpCode'); 143 | if (storedCode) { 144 | code = storedCode; 145 | } 146 | } 147 | 148 | $('#' + options.editor).replaceWith('
    '); 149 | $('#' + options.editor).text(code); 150 | 151 | editor = ace.edit(options.editor); 152 | 153 | editor.focus(); 154 | editor.gotoLine(3, 0); 155 | 156 | // set mode 157 | PhpMode = require("ace/mode/php").Mode; 158 | editor.getSession().setMode(new PhpMode()); 159 | 160 | // tab size 161 | if (options.tabsize) { 162 | editor.getSession().setTabSize(options.tabsize); 163 | editor.getSession().setUseSoftTabs(true); 164 | } else { 165 | editor.getSession().setUseSoftTabs(false); 166 | } 167 | 168 | // events 169 | editor.getSession().selection.on('changeCursor', updateStatusBar); 170 | if (window.navigator.userAgent.indexOf('Opera/') === 0) { 171 | editor.getSession().selection.on('changeSelection', prepareClippyButton); 172 | } 173 | 174 | // reset button 175 | if (window.localStorage) { 176 | $('.statusbar .reset').on('click', function (e) { 177 | editor.getSession().setValue('