Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

v@0.5a, added lite version, minor fixes

  • Loading branch information...
commit 30cb198a0a750027018614e9cb1000e732a2dfe3 1 parent 380883e
@jordifreek authored
View
96 CHANGELOG
@@ -1,46 +1,50 @@
-An unknow day in April - 0.5
-
- Add. Trace Panel, show vars on local scope
- Add. Watch Panel for view changes on vars
- Add. Eval Panel, execute php code from console
- Add. File Viewer, view source code of files
- Add. SQLite3 and PDO support
- Add. View type of sql querys
-
-
-29 January - 0.3 Beta 1
-
- Add. Profile Panel
- Add. _bl_allow_ip for restrict access
- Add. _bl_debug_on and _bl_monitor_on
- Fix. Can't serialize some objects
- Del. is_dir, is_file and is_executable on bl_var_type()
-
-23 January - 0.2 Beta 2
- Add. Keyboard Shortcuts
- Add. Delete _SESSION and _COOKIE vars
- Add. Save console state
- Add. New UI Rediseing
- Add. Bookmarklets and JS/CSS files
-
-09 January - 0.2 Beta 1
-
- Add. Filter Input for search
- Add. Backtrace php errors
- Add. Add functions to panel vars
- Add. PHP Panel
- Add. Highlight (top/right corner alert) when errors
- Add. Initial memory usage
- Fix. Panel special vars when log an object
- Fix. Jss/CSS Redesigned, compatibility with IE8+
- Fix. Ajax panel sometimes don't show send params
- Add. _bl_html_viewer
- Del. _bl_start_mode
-
-01 September - 0.1 Beta 2
-
- Add. Monitoring options
- Add. _bl_start_mode
- Add. _bl_css_file and _bl_js_file
- Add. _bl_delete_long_vars
- 11 Agoust 2011 - First Version 0.1 Beta
+## 30 August - 0.5a
+- Add. PHP Bug Lost Lite
+- New Wiki on Github
+- New web
+- Minor changes
+
+## An unknow day in April 2012 - 0.5
+- Add. Trace Panel, show vars on local scope
+- Add. Watch Panel for view changes on vars
+- Add. Eval Panel, execute php code from console
+- Add. File Viewer, view source code of files
+- Add. SQLite3 and PDO support
+- Add. View type of sql querys
+
+
+## 29 January - 0.3 Beta 1
+- Add. Profile Panel
+- Add. _bl_allow_ip for restrict access
+- Add. _bl_debug_on and _bl_monitor_on
+- Fix. Can't serialize some objects
+- Del. is_dir, is_file and is_executable on bl_var_type()
+
+## 23 January - 0.2 Beta 2
+- Add. Keyboard Shortcuts
+- Add. Delete _SESSION and _COOKIE vars
+- Add. Save console state
+- Add. New UI Rediseing
+- Add. Bookmarklets and JS/CSS files
+
+## 09 January - 0.2 Beta 1
+- Add. Filter Input for search
+- Add. Backtrace php errors
+- Add. Add functions to panel vars
+- Add. PHP Panel
+- Add. Highlight (top/right corner alert) when errors
+- Add. Initial memory usage
+- Fix. Panel special vars when log an object
+- Fix. Jss/CSS Redesigned, compatibility with IE8+
+- Fix. Ajax panel sometimes don't show send params
+- Add. _bl_html_viewer
+- Del. _bl_start_mode
+
+## 01 September - 0.1 Beta 2
+
+- Add. Monitoring options
+- Add. _bl_start_mode
+- Add. _bl_css_file and _bl_js_file
+- Add. _bl_delete_long_vars
+
+## 11 Agoust 2011 - First Version 0.1 Beta
View
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2012 Jordi Enguídanos
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
94 README
@@ -1,23 +1,71 @@
-|----------------------------------------------------------------|
-|note: phpbuglost.php contains the latest version in development.|
-|This is a beta version with some experimental features, don't |
-|recommended for production sites. Please, report errors :) |
-|################################################################|
-
-PHP Bug Lost is a one-file script PHP debug and monitoring console.
-Include it in your script and: send log messages, view SQL queries
-(sends an email to the admin if there's an error), measure times and
-memory usage (sends emails for long loading times or excessive memory
-usage), see all the vars in your scripts and view all your AJAX queries
-(send params and responses).
-
-PHP Bug Lost can run in a console or in a monitor. Use it like a console
-for developing sites to help you in your daily work, and as a monitor for
-production sites for controlling errors, load times and memory usage.
-Find those bugs!
-
-PHP Bug Lost is free, open source. At the moment I'm experimenting with it,
-trying new features, thinking what is good and what not... etc. let me know
-if you found any bug or see a better way to do anything.
-
-See more info and documentation at http://pbl.elgatonaranja.com/docs
+# PHP Bug Lost
+
+PHP Bug Lost is a one-file script for debug and monitoring web sites. It's an inline console running in the browser.
+
+## Quicklinks
+
+- [Demo and official site](http://phpbuglost.com)
+- [Downloads](https://github.com/jordifreek/PHP-Bug-Lost/downloads)
+- [Wiki Documentation](https://github.com/jordifreek/PHP-Bug-Lost/wiki)
+
+## Features
+
+- A web console
+- Two versions, standard and lite with minimal info (both open source)
+- Log messages (errors, warnings, info and user)
+- View SQL query (mysql, sqlite3, PDO) with errors info and execution time
+- View user and internal vars, functions and classes
+- Load times and time marks
+- Total memory usage, included files and individual vars memory
+- Monitoring options, Send emails to the admins when SQL errors occur, also on excessive load times and memory usage
+- Ajax panel (_standard version_)
+- Profile (meassure execution time of functions and methods) (_standard version_)
+- Eval panel, run php code whitin the console (_standard version_)
+- Vars watcher, see how a var is getting different values during the execution of a script (_standard version_)
+- File viewer for php files (_standard version_)
+
+## Requeriments
+
+PHPBugLost is a one-file library without dependencies, works with PHP5 and requires a modern browser.
+
+- PHP5
+- SQLite works with SQLite 3 extension
+- Run in a modern browser: IE8+, Firefox, Ch....
+- Min. resolution 1024x768
+- Tested on WAMP / LAMP environments (Apache/Nginx)
+
+## Installation
+
+Basically, include PHP Bug Lost at top of your code and call _bl_debug()_ before </body> tag. See documentation for more examples.
+
+```php
+<?php
+// include php bug lost
+include 'phpbuglost.php';
+// other libraries in your code
+include 'config.php';
+include 'functions.php';
+?>
+<html>
+<head>
+ <title>This is a PHPBugLost example</title>
+</head>
+<body>
+
+<!-- Rest of your code -->
+
+<?php
+// set true to show console or false to hide
+echo bl_debug(true);
+?>
+</body>
+</html>
+```
+
+## Why two versions?
+
+The standard version includes many options that do not need to use continuously. In the lite version have been removed to reduce memory usage and load times in production environments. Use the standard version if you want to use all the features of PHP Bug Lost in development environments. Use the lite version if you prefer the speed and simplicity.
+
+## License
+
+PHP Bug Lost was created by Jordi Enguídanos and released under the MIT License.
View
0  source/README → assets/README
File renamed without changes
View
223 assets/lite/presentation_lite.css
@@ -0,0 +1,223 @@
+#bl_debug * {margin:0; padding:0; color:#111; z-index:100000;
+ background-color: transparent; font-size:100%; text-align:left;}
+#bl_debug a {text-decoration:none;}
+
+#bl_debug_wrap {width:95%; margin:0 auto 0; position:fixed; bottom:0;
+ margin-left:2%; margin-right:5px;
+ font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif; font-size:13px;
+ z-index:999999999;
+ position: fixed; left: 0px; bottom: 0px;
+}
+body > div#bl_debug_wrap{ position: fixed; left: 0px; bottom: 0px; }
+
+.bl_opacity {opacity:0.1;}
+#bl_debug span.error {color:#f00;}
+
+#bl_debug_header { padding:10px; color:#fff;
+ height:20px; overflow:hidden;
+ background: #ea0105; /* Old browsers */
+ background: -moz-linear-gradient(top, #ea0105 1%, #ad0008 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#ea0105), color-stop(100%,#ad0008)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ea0105 1%,#ad0008 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ea0105 1%,#ad0008 100%); /* Opera11.10+ */
+ background: -ms-linear-gradient(top, #ea0105 1%,#ad0008 100%); /* IE10+ */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ea0105', endColorstr='#ad0008',GradientType=0 ); /* IE6-9 */
+ background: linear-gradient(top, #ea0105 1%,#ad0008 100%); /* W3C */}
+
+
+/* nav menu */
+#bl_debug_menu {float:left; }
+#bl_debug_menu * {color:#fff !important;}
+#bl_debug_menu ul {overflow:hidden; list-style-type:none;}
+#bl_debug_menu li, #bl_debug_menu a {display:block; float:left;}
+#bl_debug_menu a {padding:3px; float:left; margin:0 10px;color:#fff !important; outline:none;}
+#bl_debug_menu a.bl_debug_activo, #bl_debug_toggle a {
+ background-color:#BA0106; border:1px solid #222;
+ border-radius:5px;}
+#bl_debug_menu sup {font-size:8px;}
+
+
+/* nav menu right. buttons close, opacity, maximize... etc.*/
+#bl_debug_toggle {float:right; width:250px; font-size:10px;}
+#bl_debug_toggle_buttons a {float:right; margin:0 3px; padding:2px 3px;
+ color: #fff; text-decoration:none; outline:none;}
+#bl_debug_toggle_buttons a {text-decoration:none;}
+
+/* bookmarklets box */
+#bl_tool_box {position:absolute; bottom:40px; right:100px; width:460px;
+ height:400px; border:3px solid #E80005; background-color:#fff;
+ border-bottom:none; overflow:auto; overflow:hidden; opacity:0.9}
+#bl_debug_toggle #bl_tool_box a {background:none; border:none; text-decoration:none;}
+#bl_debug_toggle #bl_tool_box a {color:#f33; font-size:12px;}
+ #bl_debug_toggle #bl_tool_box a:hover {color:#f00; text-decoration:underline}
+#bl_debug_toggle #bl_tool_box ul {margin:0 0 10px 5px}
+#bl_debug_toggle #bl_tool_box h3 {margin-bottom:5px; font-size:14px;}
+#bl_js_css {width:200px; float:left; word-wrap: break-word;
+ border-left:1px solid #ccc; padding:15px}
+#bl_bookmarks {width:200px; float:left; padding:10px}
+
+
+/* panel wrapper */
+.bl_half_panel {height:300px;}
+.bl_close_panel {height:0; display:none;}
+.bl_full_panel {height:600px;}
+#bl_debug_content {border:5px solid #EA0105; border-bottom:none; background-color:#fff;}
+
+
+/* tables */
+#bl_debug table {font-size:11px;}
+#bl_debug table th {text-align:left; padding:10px; background-color:#ddf1fb;
+ border-bottom:1px dashed #ccc;}
+#bl_debug table td {padding:5px; border-bottom:1px dashed #555;
+ vertical-align:top; text-align:left;}
+#bl_debug table td.bl_col_title {background-color:#f6f6f6; font-weight:bold;
+ border-right:1px dashed #ccc;}
+
+
+/* PANELS*/
+#bl_debug_panels {background-color:#fff; overflow:auto;}
+.bl_half_panel #bl_debug_panels {height:300px;}
+.bl_full_panel #bl_debug_panels {height:600px;}
+#bl_debug_panels div.bl_debug_panel_active {display:block; }
+#bl_debug .bl_panel_info a {color:#008000; text-decoration:none;}
+.bl_panel_info {width:85%; float:left;}
+.bl_debug_panel {display:none; overflow:auto; }
+.bl_full_panel .bl_debug_panel {display:none; height:600px;}
+
+#bl_debug_var_panels, #bl_debug_php_panels
+ {background-color:#fff; overflow:auto;}
+
+.bl_debug_var_panel, .bl_debug_php_panel
+ {display:none; overflow:auto;}
+#bl_debug_var_panels div.bl_debug_var_panel_activo,
+#bl_debug_php_panels div.bl_debug_php_panel_activo
+ {display:block;}
+
+#bl_debug #bl_debug_info h3, #bl_debug #bl_debug_info p, #bl_debug #bl_debug_info ul {margin-bottom:15px;}
+#bl_debug #bl_debug_info ul {margin-left:15px !important;}
+
+
+/* vertical menus */
+#bl_debug .bl_menu_vertical {background-color:#880400; width:auto;
+ overflow:hidden; min-width: 100px; float:left;}
+#bl_debug .bl_menu_vertical li, .bl_menu_vertical a {display:block;}
+#bl_debug .bl_menu_vertical a {display:block; background-color:#DA1010;
+ padding:3px; border-bottom:1px solid #ea0105; color:#fff;}
+#bl_debug .bl_menu_vertical a:hover {background-color:#C92929;}
+
+#bl_debug_msg_menu a.bl_debug_msg_btn_activo,
+#bl_debug_var_menu a.bl_debug_var_btn_activo,
+#bl_debug_php_menu a.bl_debug_php_btn_activo {
+ background-color:#fff; color:#333;}
+#bl_debug_msg_menu a.bl_debug_msg_btn_activo:hover,
+#bl_debug_var_menu a.bl_debug_var_btn_activo:hover,
+#bl_debug_php_menu a.bl_debug_php_btn_activo:hover {
+ background-color:#fff; color:#333;}
+
+
+/* VARIOS */
+#bl_debug .in20 {padding:20px;}
+#bl_debug .bl_debug_var_content .no_top_in {padding-top:0 !important;}
+#bl_debug .in10 {padding:10px;}
+#bl_debug .bl_border_top {border-top-left-radius:0.8ex; border-top-right-radius:0.8ex;}
+#bl_debug .bl_right {text-align:right;}
+#bl_debug .bl_nothing p {color:#666 !important; font-size:3em; text-align:center; padding:20px;}
+#bl_debug .bl_opacity {opacity:0.3; filter: alpha(opacity = 30);}
+
+
+/* var box */
+.bl_vars_box {width: 250px; height: 250px; float:left; margin:20px;}
+.bl_vars_box_title {background-color:#222; color:#fff;}
+
+
+#bl_debug td.bl_msg_error {background-color:#ff3333; color:#000;}
+#bl_debug td.bl_msg_warn {background-color:#FF9900; color:#000;}
+#bl_debug td.bl_msg_info {background-color:#3366FF; color:#000;}
+#bl_debug td.bl_msg_user {background-color:#333; color:#000;}
+
+#bl_debug .bl_normal_td .bl_td {background-color:transparent;}
+#bl_debug .bl_hover_td .bl_td {background-color:#999;}
+
+
+/* Formatear mensajes */
+#bl_debug .bl_msg_info {font-weight:bold;}
+#bl_debug .bl_msg_file {font-style:italic;}
+#bl_debug .bl_msg_line {font-style:italic;}
+#bl_debug .bl_msg_separator {color:#f00; margin:0 10px;}
+
+/* MSG TABLE */
+#bl_debug .bl_msg_table tbody tr {display:none;}
+#bl_debug .bl_msg_table tr.bl_highlight_row td.bl_td {background-color:#eee;}
+#bl_debug .bl_msg_table tbody tr.bl_msg_activo {display:table-row;}
+#bl_debug table.bl_backtrace tr {display:table-row;}
+#bl_debug table.bl_backtrace th,
+ #bl_debug table.bl_backtrace td
+ {border-bottom:none; padding:2px}
+
+#bl_memory_box {width:200px;}
+#bl_memory_box, #bl_included {padding:5px; background-color:#f6f6f6; border:1px solid #ccc;
+ float:left; margin:0 10px;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;}
+#bl_memory_box h3, #bl_included h3 {padding:5px; border-bottom:1px dashed #666; margin-bottom:10px}
+#bl_memory_box span {display:block;}
+
+
+/* View HTML on vars */
+#bl_debug .bl_view_html {display:none; margin:10px;}
+#bl_debug .bl_view_html_title {width:100px; margin-right:20px; padding:5px; background-color:#ccc;}
+#bl_debug .bl_view_html_content {border:1px solid #ccc; padding:10px;}
+
+#bl_debug_heatmap {text-align:left;}
+
+
+#bl_debug .bl_box {width:200px; margin-bottom:15px;}
+#bl_debug .bl_box2 {width:400px;}
+#bl_debug .bl_box, #bl_debug .bl_box2, #bl_included {padding:5px; background-color:#f6f6f6; border:1px solid #ccc;
+ float:left; margin:0 10px 15px;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;}
+#bl_debug .bl_box h3, #bl_debug .bl_box2 h3, #bl_included h3 {
+ padding:5px; border-bottom:1px dashed #666; margin-bottom:10px}
+#bl_debug .bl_box span, #bl_debug .bl_box2 span {display:block;}
+
+
+/* View HTML on vars */
+#bl_debug .bl_view_html {display:none; margin:10px;}
+#bl_debug .bl_view_html_title {width:100px; margin-right:20px; padding:5px; background-color:#ccc;}
+#bl_debug .bl_view_html_content {border:1px solid #ccc; padding:10px;}
+
+#bl_debug .bl_filter_box {background-color:#f3f3f3; border-radius:3px;
+ width:200px; padding:5px; margin-bottom:5px; border:1px solid #ccc;}
+#bl_debug .bl_filter_box input { border:1px solid #444; }
+
+#bl_show_errors {padding:5px; background-color:#fff; border:2px solid #f00;
+ position:fixed; top:10px; right:10px; display:block; font-size:14px;
+ font-weight:bold;}
+
+#bl_debug .bl_blue {color:#0000FF;}
+#bl_debug .bl_blue strong {color:#0000FF;}
+#bl_debug .bl_grey {color:#999999;}
+#bl_debug .bl_orange {color:#FF6600;}
+
+#bl_debug #bl_file_container {position:fixed; width:90%; height:80%;
+ top:50px; left:50px;
+ border:4px solid #333; background-color:#fff;
+ display:none; overflow:hidden;
+ -webkit-box-shadow: 0px 0px 30px rgba(15, 15, 15, 1);
+ -moz-box-shadow: 0px 0px 30px rgba(15, 15, 15, 1);
+ box-shadow: 0px 0px 30px rgba(15, 15, 15, 1);}
+
+#bl_debug #bl_file_explorer {overflow:auto; height:95%;}
+#bl_debug #bl_header_browser {overflow:hidden; height:5%; background-color:#333;
+ font-size:1.2em; font-weight:bold; color:#eee !important;}
+#bl_debug #bl_header_browser p, #bl_debug #bl_header_browser a {color:#fff !important;}
+#bl_debug #bl_file_container .highlight_line {background-color:#C3E9FF;}
+
+#bl_debug #bl_loading {display:none; padding:5px;
+ background-color:#fff; color:#fff; font-weight:bold;
+ position:fixed; margin-left:45%; width:100px; text-align:center;
+ border:4px solid #ea0105; border-top:none;}
+
View
536 assets/lite/presentation_lite.js
@@ -0,0 +1,536 @@
+var bl_shortcuts = true,
+ bl_key_msg = 49,
+ bl_key_sql = 50,
+ bl_key_vars = 51,
+ bl_key_time = 52,
+ bl_key_memory = 52,
+ bl_key_opacity = 79,
+ bl_key_info = 73,
+ bl_key_plus = 77,
+ bl_key_close = 88;
+
+////////////////////////////////////
+//// SOME STANDARD FUNCTIONS
+var $bl = function (id) {
+ return document.getElementById(id);
+};
+String.prototype.trim = function () {
+ return this.replace(/^\s+|\s+$/g, "");
+};
+String.prototype.ltrim = function () {
+ return this.replace(/^\s+/, "");
+};
+String.prototype.rtrim = function () {
+ return this.replace(/\s+$/, "");
+};
+Element.prototype.hasClass = function (class_name) {
+ this.className = this.className.replace(/^\s+|\s+$/g, "");
+ this.className = " " + this.className + " ";
+ if (this.className.search(" " + class_name + " ") !== -1) {
+ return true;
+ }
+ this.className = this.className.replace(/^\s+|\s+$/g, "");
+ return false;
+};
+Element.prototype.removeClass = function (class_name) {
+ this.className = this.className.replace(class_name, '');
+ this.className = this.className.replace(/^\s+|\s+$/g, "");
+};
+Element.prototype.addClass = function (class_name) {
+ this.className = this.className + ' ' + class_name;
+ this.className = this.className.replace(/^\s+|\s+$/g, "");
+};
+
+function bl_toggle(obj, mode) {
+ var el = document.getElementById(obj);
+ if (mode === 'more') {
+ document.getElementById("bl_debug_content").style.display = 'block';
+ if (el.className === 'bl_full_panel') {
+ el.className = 'bl_half_panel';
+ } else {
+ el.className = 'bl_full_panel';
+ }
+ } else {
+ if (el.style.display !== 'block') {
+ el.style.display = 'block';
+ } else {
+ el.style.display = 'none';
+ }
+ }
+}
+
+function randomString(length) {
+ var str,
+ i,
+ chars = 'abcdefghiklmnopqrstuvwxyz'.split('');
+ if (!length) {
+ length = Math.floor(Math.random() * chars.length);
+ }
+ for (i = 0; i < length; i += 1) {
+ str += chars[Math.floor(Math.random() * chars.length)];
+ }
+ return str;
+}
+
+function time(ms) {
+ var t = ms / 1000;
+ return Math.round(t * 100) / 100;
+}
+
+// cros-browser event listener
+function bl_listen(event, elem, func, id) {
+ if (id) {
+ elem = $bl(elem);
+ } else {
+ elem = document;
+ }
+
+ if (elem) {
+ if (elem.addEventListener) {
+ elem.addEventListener(event, func, false);
+ } else if (elem.attachEvent) { // IE DOM
+ var r = elem.attachEvent("on" + event, func);
+ return r;
+ } else {
+ throw 'No es posible añadir evento';
+ }
+ }
+}
+bl_listen('keyup', 'body', bl_keydown);
+
+function bl_keydown(e) {
+
+ var target;
+
+ if (!bl_shortcuts) {
+ return;
+ }
+
+
+ if (navigator.appName === 'Microsoft Internet Explorer') {
+ e = window.event;
+ target = e.srcElement.nodeName.toLowerCase();
+ } else {
+ target = e.target.localName;
+ }
+
+ if (target === 'html' || target === 'body') {
+
+ if (e.keyCode === bl_key_msg) {
+ bl_debug_set_panel('msg');
+
+ } else if (e.keyCode === bl_key_sql) {
+ bl_debug_set_panel('sql');
+
+ } else if (e.keyCode === bl_key_vars) {
+ bl_debug_set_panel('vars');
+
+ } else if (e.keyCode === bl_key_time) {
+ bl_debug_set_panel('time');
+
+ } else if (e.keyCode === bl_key_memory) {
+ bl_debug_set_panel('memory');
+
+ } else if (e.keyCode === bl_key_opacity) {
+ bl_opacity();
+
+ } else if (e.keyCode === bl_key_info) {
+ bl_debug_set_panel('info');
+
+ } else if (e.keyCode === bl_key_plus) { // + maximizar
+ bl_setPanelSize('plus');
+
+ } else if (e.keyCode === bl_key_close) {
+ bl_setPanelSize('close');
+ }
+ }
+}
+
+////////////////////////////////////
+//// TOGGLE VIEW HTML ON VARS PANEL
+
+function bl_view_html(el) {
+ var el1 = document.getElementById('bl_view_html_' + el),
+ el2 = document.getElementById('bl_view_' + el),
+ el3 = document.getElementById('bl_view_more_' + el);
+ if (el1.style.display === 'block') {
+ el1.style.display = 'none';
+ el2.style.display = 'block';
+ el3.style.display = 'none';
+ } else {
+ el1.style.display = 'block';
+ el2.style.display = 'none';
+ el3.style.display = 'none';
+ }
+}
+////////////////////////////////////
+//// TOP/RIGHT ALERT WHEN ERRORS
+
+function bl_show_errors() {
+ bl_toggle('bl_show_errors');
+}
+
+function bl_alert_errors() {
+ var bl_interval = setInterval(bl_show_errors(), 500);
+ setTimeout("clearInterval(" + bl_interval + ")", 3000);
+}
+////////////////////////////////////
+//// SET OPACITY (BUTTON opacity)
+
+function bl_opacity() {
+ var el = $bl('bl_debug');
+ if (el.hasClass('bl_opacity')) {
+ el.removeClass('bl_opacity');
+ } else {
+ el.addClass('bl_opacity');
+ }
+}
+/**
+ * Change the panel size when press button M or X
+ * @size string plus|close
+ */
+function bl_setPanelSize(size) {
+ var panel_size = 'close';
+
+ if (size === 'plus') {
+ if ($bl('bl_debug_content').className === 'bl_half_panel') {
+ $bl('bl_debug_content').className = 'bl_full_panel';
+ panel_size = 'full';
+ } else {
+ $bl('bl_debug_content').className = 'bl_half_panel';
+ panel_size = 'half';
+ }
+ } else if (size === 'close') {
+ $bl('bl_debug_content').className = 'bl_close_panel';
+ panel_size = 'close';
+ } else {
+ $bl('bl_debug_content').className = 'bl_' + size + '_panel';
+ panel_size = 'half';
+ }
+
+ if (panel_size === 'close') {
+ bl_setCookie('__bl_panel_active', 'none', 1);
+ }
+
+ bl_setCookie('panel_size_bl', panel_size, 1);
+
+}
+/**
+ * Change the active panel
+ * @panel string msg|sql|vars|time|memory|info...
+ */
+
+function bl_debug_set_panel(panel) {
+ var c1 = "bl_debug_panel",
+ c2 = "bl_debug_panel_active",
+ c3 = "bl_debug_btn",
+ c4 = "bl_debug_activo";
+ if ($bl("bl_debug_" + panel).hasClass("bl_debug_panel_active")) {
+ $bl("bl_debug_" + panel).className = c1;
+ $bl("bl_debug_content").className = 'bl_close_panel';
+ $bl(c3 + "_" + panel).className = c3;
+ bl_setPanelSize('close');
+ } else {
+ // show panel
+ $bl("bl_debug_msg").className = c1;
+ $bl("bl_debug_sql").className = c1;
+ $bl("bl_debug_vars").className = c1;
+ $bl("bl_debug_time").className = c1;
+ $bl("bl_debug_memory").className = c1;
+ $bl("bl_debug_info").className = c1;
+ $bl("bl_debug_" + panel).className = c1 + " " + c2;
+ // set button active
+ $bl("bl_debug_btn_msg").className = c3;
+ $bl(c3 + "_sql").className = c3;
+ $bl(c3 + "_vars").className = c3;
+ $bl(c3 + "_time").className = c3;
+ $bl(c3 + "_memory").className = c3;
+ $bl(c3 + "_" + panel).className = c3 + " " + c4;
+ if ($bl("bl_debug_content").hasClass('bl_close_panel')) {
+ $bl("bl_debug_content").className = 'bl_half_panel';
+ bl_setPanelSize('half');
+ }
+ }
+ bl_setCookie('__bl_panel_active', panel, 1);
+}
+
+/**
+ * Show or hidde messesages by type
+ * @type string all|error|info|warn|user
+ */
+function bl_debug_set_msg(type) {
+ var i,
+ bl_search,
+ bl_search2,
+ e,
+ allHTMLTags = document.getElementsByTagName("tr");
+
+ for (i = 0; i < allHTMLTags.length; i += 1) {
+ if (allHTMLTags[i].className.search('bl_normal_tr') !== -1) {
+ allHTMLTags[i].className = allHTMLTags[i].className.replace('bl_msg_activo', '');
+ bl_search = allHTMLTags[i].className.search('bl_debug_msg_' + type);
+ bl_search2 = allHTMLTags[i].className.search('bl_msg_activo');
+ if (bl_search !== -1) {
+ if (bl_search2 === -1) {
+ allHTMLTags[i].className = allHTMLTags[i].className + ' bl_msg_activo';
+ }
+ } else {
+ if (type === 'all') {
+ if (bl_search2 === -1) {
+ allHTMLTags[i].className = allHTMLTags[i].className + ' bl_msg_activo';
+ }
+ }
+ }
+ }
+ }
+ allHTMLTags = document.getElementsByTagName("a");
+ for (i = 0; i < allHTMLTags.length; i += 1) {
+ if (allHTMLTags[i].className.search('bl_debug_msg_btn') !== -1) {
+ allHTMLTags[i].className = 'bl_debug_msg_btn';
+ }
+ }
+ // añadir la clase al elemento actual
+ e = document.getElementById('bl_debug_msg_btn_' + type);
+ e.addClass('bl_debug_msg_btn_activo');
+}
+
+/**
+ * Change the active vars panel
+ * @size string A vars panel: vars|special|get|post... etc.
+ */
+function bl_debug_set_var(panel) {
+ // obtener todos los links del menu y eliminar la clase activo
+ var i,
+ e,
+ allHTMLTags = document.getElementsByTagName("div");
+
+ for (i = 0; i < allHTMLTags.length; i += 1) {
+ if (allHTMLTags[i].className.search('bl_debug_var_panel') !== -1) {
+ allHTMLTags[i].className = 'bl_debug_var_panel';
+ }
+ }
+
+ allHTMLTags = document.getElementsByTagName("a");
+ for (i = 0; i < allHTMLTags.length; i += 1) {
+ if (allHTMLTags[i].className.search('bl_debug_var_btn') !== -1) {
+ allHTMLTags[i].className = 'bl_debug_var_btn';
+ }
+ }
+
+ // añadir la clase al elemento actual
+ e = document.getElementById('bl_debug_var_btn_' + panel);
+ e.addClass('bl_debug_var_btn_activo');
+ // activar el panel de elemento
+ e = document.getElementById('bl_debug_var_' + panel);
+ e.addClass('bl_debug_var_panel_activo');
+}
+
+
+/**
+ * Expand methods and properties on classes panel
+ */
+function bl_expand(count) {
+ // obtener todos los links del menu y eliminar la clase activo
+ var i,
+ allHTMLTags = document.getElementsByTagName("span");
+ for (i = 0; i < allHTMLTags.length; i += 1) {
+ if (allHTMLTags[i].className.search('bl_class_' + count) !== -1) {
+ if (allHTMLTags[i].style.display !== 'block') {
+ allHTMLTags[i].style.display = 'block';
+ $bl('bl_method_comments_expand_' + count).style.display = 'none';
+ $bl('bl_method_comments_' + count).style.display = 'block';
+ } else {
+ allHTMLTags[i].style.display = 'inline';
+ $bl('bl_method_comments_expand_' + count).style.display = 'block';
+ $bl('bl_method_comments_' + count).style.display = 'none';
+ }
+
+ }
+ }
+}
+
+////////////////////////////////////
+//// ACTIONS FOR INPUT FILTER ON VARS PANEL
+
+// filter function by vonloesch.de
+function filter(phrase, id) {
+
+ var words = $bl(phrase).value.toLowerCase().split(" "),
+ table = document.getElementById(id),
+ ele,
+ r,
+ i,
+ displayStyle;
+
+ for (r = 1; r < table.rows.length; r += 1) {
+ ele = table.rows[r].innerHTML.replace(/<[^>]+>/g, "");
+ displayStyle = "none";
+ for (i = 0; i < words.length; i += 1) {
+ if (ele.toLowerCase().indexOf(words[i]) >= 0) {
+ displayStyle = "";
+ } else {
+ displayStyle = "none";
+ break;
+ }
+ }
+ table.rows[r].style.display = displayStyle;
+ }
+}
+
+function filterUser() {
+ filter('bl_filter_user', 'bl_table_user');
+}
+
+function filterSpecial() {
+ filter('bl_filter_special', 'bl_table_special');
+}
+
+function filterFunctions() {
+ filter('bl_filter_functions', 'bl_table_functions');
+}
+
+function filterUclasses() {
+ filter('bl_filter_uclasses', 'bl_table_uclasses');
+}
+
+function filterIclasses() {
+ filter('bl_filter_iclasses', 'bl_table_iclasses');
+}
+
+function filterConstants() {
+ filter('bl_filter_constants', 'bl_table_constants');
+}
+
+function filterGet() {
+ filter('bl_filter_get', 'bl_table_get');
+}
+
+function filterPost() {
+ filter('bl_filter_post', 'bl_table_post');
+}
+
+function filterSession() {
+ filter('bl_filter_session', 'bl_table_session');
+}
+
+function filterCookie() {
+ filter('bl_filter_cookie', 'bl_table_cookie');
+}
+
+function filterFiles() {
+ filter('bl_filter_files', 'bl_table_files');
+}
+
+function filterServer() {
+ filter('bl_filter_server', 'bl_table_server');
+}
+
+bl_listen('keyup', 'bl_filter_user', filterUser, true);
+bl_listen('keyup', 'bl_filter_special', filterSpecial, true);
+bl_listen('keyup', 'bl_filter_functions', filterFunctions, true);
+bl_listen('keyup', 'bl_filter_uclasses', filterUclasses, true);
+bl_listen('keyup', 'bl_filter_iclasses', filterIclasses, true);
+bl_listen('keyup', 'bl_filter_constants', filterConstants, true);
+bl_listen('keyup', 'bl_filter_get', filterGet, true);
+bl_listen('keyup', 'bl_filter_post', filterPost, true);
+bl_listen('keyup', 'bl_filter_session', filterSession, true);
+bl_listen('keyup', 'bl_filter_cookie', filterCookie, true);
+bl_listen('keyup', 'bl_filter_files', filterFiles, true);
+bl_listen('keyup', 'bl_filter_server', filterServer, true);
+
+////////////////////////////////////
+//// AJAX FOR DELETE SESSIONS AND COOKIES
+
+function bl_ajax() {
+ var xmlhttp = false;
+ try {
+ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e) {
+ try {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (E) {
+ xmlhttp = false;
+ }
+ }
+
+ if (!xmlhttp && typeof XMLHttpRequest !== 'undefined') {
+ xmlhttp = new XMLHttpRequest();
+ }
+ return xmlhttp;
+}
+function bl_del_var(var_name, url, type, key, tr_id, url_var_name) {
+
+ var ajax;
+ url = url + '?' + url_var_name + '=1&var=' + var_name + '&type=' + type + '&bl_key=' + key;
+
+ $bl('bl_loading').style.display = 'block';
+
+ ajax = bl_ajax();
+ ajax.open("GET", url, true);
+ ajax.onreadystatechange = function () {
+ if (ajax.readyState === 4) {
+
+ $bl('bl_loading').style.display = 'none';
+
+ if (ajax.responseText === 'ok') {
+ // delete table row
+ var tr = $bl(tr_id);
+ tr.innerHTML = '<td colspan="5">var $' + type + '["' + var_name + '"] deleted</td>';
+
+ } else if (ajax.responseText === 'error-key') {
+ alert('There\'re a problem with your secret key');
+
+ } else if (ajax.responseText === 'error-cookie') {
+ alert('Sorry, I can\t delete this cookie.');
+
+ } else {
+ alert('Error. No vars deleted!');
+ }
+ }
+ };
+ ajax.send(null);
+}
+
+
+////////////////////////////////////
+//// HIGHLIGHT A TABLE ROW. FIRE WHEN MOUSEOVER (inline code on <tr>)
+
+function bl_highlight_row(highlight, el) {
+ if (highlight === true) {
+ el.addClass('bl_highlight_row');
+ } else {
+ el.removeClass('bl_highlight_row');
+ }
+}
+////////////////////////////////////
+//// TOGGLE FOR VIEW ARRAY OPTION ON VARS PANEL
+
+function view_array(id) {
+ var div = document.getElementById(id),
+ a = document.getElementById(id.replace('div_', 'a_'));
+ if (div.style.display === 'block') {
+ div.style.display = 'none';
+ a.style.display = 'block';
+ } else {
+ div.style.display = 'block';
+ a.style.display = 'none';
+ }
+}
+////////////////////////////////////
+//// LIKE PHP HTMLENTITES. USED FOR SHOW HTML ON VARS PANEL
+
+function htmlentities(str) {
+ return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
+}
+
+////////////////////////////////////
+//// SET COOKIE | SAVE CONSOLE STATE
+
+function bl_setCookie(c_name, value, exdays) {
+ var c_value,
+ exdate = new Date();
+ exdate.setDate(exdate.getDate() + exdays);
+ c_value = escape(value) + ((exdays === null) ? "" : "; expires=" + exdate.toUTCString());
+ document.cookie = c_name + "=" + c_value + '; path=/';
+}
+
View
7 source/presentation.css → assets/presentation.css
@@ -259,7 +259,12 @@ body > div#bl_debug_wrap{ position: fixed; left: 0px; bottom: 0px; }
#bl_debug .bl_trace_time {font-weight:bold; color:green;}
#bl_debug .bl_trace_memory {font-weight:bold; color:red;}
#bl_debug .bl_trace_info {display:none; margin:-1px 0 0 20px; }
-#bl_debug .bl_trace_info table {border:1px solid #ccc; border-top:0;}
+#bl_debug .bl_trace_info table {border:none !important; border-top:0; width:100%;}
+#bl_debug .bl_trace_info table td {border:1px solid #ccc;}
+#bl_debug .bl_trace_info .bl_var_type {color:#f37}
+#bl_debug .bl_trace_info .bl_col_title {width:25%;}
+#bl_debug .bl_trace_info .bl_var_value {width:55%;}
+#bl_debug .bl_trace_info .bl_watch_value {width:70%;}
#bl_debug .bl_trace_info caption {background-color:#eee; border-left:1px solid #ccc;
border-right:1px solid #ccc; padding:3px;}
#bl_debug .bl_trace_info th {background-color:#eee; padding:3px; font-weight:normal;}
View
18 source/presentation.js → assets/presentation.js
@@ -93,7 +93,7 @@ function bl_listen(event, elem, func, id) {
if (elem) {
if (elem.addEventListener) {
elem.addEventListener(event, func, false);
- } else if (elem.attachEvent) { // IE DOM
+ } else if (elem.attachEvent) {
var r = elem.attachEvent("on" + event, func);
return r;
} else {
@@ -191,7 +191,7 @@ function bl_show_errors() {
}
function bl_alert_errors() {
- var bl_interval = setInterval('bl_show_errors()', 500);
+ var bl_interval = setInterval(bl_show_errors(), 500);
setTimeout("clearInterval(" + bl_interval + ")", 3000);
}
////////////////////////////////////
@@ -793,7 +793,7 @@ function bl_setCookie(c_name, value, exdays) {
function bl_params_to_html(params, id) {
if (params) {
-
+
var param,
i,
p,
@@ -982,8 +982,8 @@ s_ajaxListener.callback = function () {
cXMLHttpRequest.onabort = null;
// Public Methods
cXMLHttpRequest.prototype.open = function (sMethod, sUrl, bAsync, sUser, sPassword) {
-
-
+
+
/* code for PHP BUG LOST */
var d1 = new Date(), // time mark
el_id = randomString(12), // random id for handle toggle event
@@ -1013,11 +1013,11 @@ s_ajaxListener.callback = function () {
if (bl_url_ex[1] !== 'undefined') {
data.params = bl_url_ex[1];
}
-
+
bl_msg_ajax(data, el_id);
/* end PHP BUG LOST */
-
-
+
+
// Delete headers, required when object is reused
delete this._headers;
// When bAsync parameter value is omitted, use true as default
@@ -1055,7 +1055,7 @@ s_ajaxListener.callback = function () {
fReadyStateChange(this);
this._object.onreadystatechange = function (dd) {
-
+
var d2 = new Date(),
d3 = d2 - d1, // tiempo de la query en milisengundos
View
509 phpbuglost.php
255 additions, 254 deletions not shown
Please sign in to comment.
Something went wrong with that request. Please try again.