From 55779d9d541aedd5a620435267cd3330d63c19a9 Mon Sep 17 00:00:00 2001 From: Lonnie Ezell Date: Tue, 14 Nov 2017 22:54:38 -0600 Subject: [PATCH] Toolbar cleanup. Fixes #773 --- application/Config/Events.php | 1 + application/Filters/DebugToolbar.php | 4 +- system/Debug/Toolbar.php | 101 +- system/Debug/Toolbar/toolbarloader.js.php | 10 +- writable/debugbar/.gitkeep | 0 writable/debugbar/debugbar_1510721238 | 1221 +++++++++++++++++++++ 6 files changed, 1285 insertions(+), 52 deletions(-) create mode 100644 writable/debugbar/.gitkeep create mode 100644 writable/debugbar/debugbar_1510721238 diff --git a/application/Config/Events.php b/application/Config/Events.php index 9a95f10539..47781585a4 100644 --- a/application/Config/Events.php +++ b/application/Config/Events.php @@ -31,5 +31,6 @@ if (ENVIRONMENT != 'production') { Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect'); + // Handles the display of the toolbar itself. MUST remain here for toolbar to be displayed. Events::on('pre_system', 'CodeIgniter\Debug\Toolbar::eventHandler'); } diff --git a/application/Filters/DebugToolbar.php b/application/Filters/DebugToolbar.php index 3fc4e1eac6..4362bbea8e 100644 --- a/application/Filters/DebugToolbar.php +++ b/application/Filters/DebugToolbar.php @@ -51,10 +51,10 @@ class DebugToolbar implements FilterInterface helper(['filesystem', 'url']); - // Updated to time() to can get history + // Updated to time() so we can get history $time = time(); - write_file(WRITEPATH . 'debugbar_' . $time, $output, 'w+'); + write_file(WRITEPATH .'debugbar/'.'debugbar_' . $time, $output, 'w+'); $script = PHP_EOL . ''); + exit(''); } - } + } } diff --git a/system/Debug/Toolbar/toolbarloader.js.php b/system/Debug/Toolbar/toolbarloader.js.php index 087745cacc..ef0a5377ed 100644 --- a/system/Debug/Toolbar/toolbarloader.js.php +++ b/system/Debug/Toolbar/toolbarloader.js.php @@ -1,3 +1,4 @@ + document.addEventListener('DOMContentLoaded', loadDoc, false); function loadDoc() { @@ -9,14 +10,13 @@ function loadDoc() { if (this.readyState == 4 && this.status == 200) { var x = document.body.innerHTML; document.body.innerHTML = x + this.responseText; - eval(document.getElementById("toolbar_js").innerHTML); - if(typeof ciDebugBar === 'object') - { - ciDebugBar.init(); + eval(document.getElementById("toolbar_js").innerHTML); + if (typeof ciDebugBar === 'object') { + ciDebugBar.init(); } } }; - xhttp.open("GET", url + "?debugbar_time="+ time, true); + xhttp.open("GET", url + "?debugbar_time=" + time, true); xhttp.send(); } diff --git a/writable/debugbar/.gitkeep b/writable/debugbar/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/writable/debugbar/debugbar_1510721238 b/writable/debugbar/debugbar_1510721238 new file mode 100644 index 0000000000..d5e8d0db24 --- /dev/null +++ b/writable/debugbar/debugbar_1510721238 @@ -0,0 +1,1221 @@ + + + + +
+ + + +
+ + + + + + + + + + + + + + +
NAMECOMPONENTDURATION0 ms5 ms10 ms15 ms
BootstrapTimer13.03 ms
RoutingTimer0.07 ms
ControllerTimer3.56 ms
Controller ConstructorTimer1.43 ms
View: welcome_message.phpViews0.61 ms
+
+ + +
+

Database (0 Queries across 0 Connection)

+ + + + + + + + + + + +
TimeQuery String
+
+
+

Logs

+ +

Nothing was logged. If you were expecting logged items, ensure that LoggerConfig file has the correct threshold set.

+
+

Files ( 86 )

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
App.phpAPPPATH/Config/App.php
Autoload.phpAPPPATH/Config/Autoload.php
Cache.phpAPPPATH/Config/Cache.php
ClassLoader.php/Users/kilishan/WebSites/CodeIgniter4/vendor/composer/ClassLoader.php
Compat.php/Users/kilishan/WebSites/CodeIgniter4/vendor/paragonie/sodium_compat/src/Compat.php
Constants.phpAPPPATH/Config/Constants.php
Database.phpAPPPATH/Config/Database.php
DebugToolbar.phpAPPPATH/Filters/DebugToolbar.php
Events.phpAPPPATH/Config/Events.php
Exceptions.phpAPPPATH/Config/Exceptions.php
Filters.phpAPPPATH/Config/Filters.php
Home.phpAPPPATH/Controllers/Home.php
Kint.php/Users/kilishan/WebSites/CodeIgniter4/vendor/kint-php/kint/src/Kint.php
Logger.phpAPPPATH/Config/Logger.php
Paths.phpAPPPATH/Config/Paths.php
Routes.phpAPPPATH/Config/Routes.php
Services.phpAPPPATH/Config/Services.php
View.phpAPPPATH/Config/View.php
autoload.php/Users/kilishan/WebSites/CodeIgniter4/vendor/autoload.php
autoload.php/Users/kilishan/WebSites/CodeIgniter4/vendor/paragonie/sodium_compat/autoload.php
autoload_real.php/Users/kilishan/WebSites/CodeIgniter4/vendor/composer/autoload_real.php
autoload_static.php/Users/kilishan/WebSites/CodeIgniter4/vendor/composer/autoload_static.php
constants.php/Users/kilishan/WebSites/CodeIgniter4/vendor/paragonie/sodium_compat/lib/constants.php
development.phpAPPPATH/Config/Boot/development.php
index.phpFCPATH/index.php
init.php/Users/kilishan/WebSites/CodeIgniter4/vendor/kint-php/kint/init.php
init_footer.php/Users/kilishan/WebSites/CodeIgniter4/vendor/kint-php/kint/init_footer.php
init_header.php/Users/kilishan/WebSites/CodeIgniter4/vendor/kint-php/kint/init_header.php
init_helpers.php/Users/kilishan/WebSites/CodeIgniter4/vendor/kint-php/kint/init_helpers.php
namespaced.php/Users/kilishan/WebSites/CodeIgniter4/vendor/paragonie/sodium_compat/lib/namespaced.php
php72compat.php/Users/kilishan/WebSites/CodeIgniter4/vendor/paragonie/sodium_compat/lib/php72compat.php
random.php/Users/kilishan/WebSites/CodeIgniter4/vendor/paragonie/random_compat/lib/random.php
sodium_compat.php/Users/kilishan/WebSites/CodeIgniter4/vendor/paragonie/sodium_compat/lib/sodium_compat.php
welcome_message.phpAPPPATH/Views/welcome_message.php
AutoloadConfig.phpBASEPATH/Config/AutoloadConfig.php
Autoloader.phpBASEPATH/Autoloader/Autoloader.php
BaseCollector.phpBASEPATH/Debug/Toolbar/Collectors/BaseCollector.php
BaseConfig.phpBASEPATH/Config/BaseConfig.php
CacheFactory.phpBASEPATH/Cache/CacheFactory.php
CacheInterface.phpBASEPATH/Cache/CacheInterface.php
CodeIgniter.phpBASEPATH/CodeIgniter.php
Common.phpBASEPATH/Common.php
Config.phpBASEPATH/Database/Config.php
Controller.phpBASEPATH/Controller.php
CustomExceptions.phpBASEPATH/Debug/CustomExceptions.php
Database.phpBASEPATH/Debug/Toolbar/Collectors/Database.php
DotEnv.phpBASEPATH/Config/DotEnv.php
Escaper.phpBASEPATH/ThirdParty/ZendEscaper/Escaper.php
Events.phpBASEPATH/Debug/Toolbar/Collectors/Events.php
Events.phpBASEPATH/Events/Events.php
Exceptions.phpBASEPATH/Debug/Exceptions.php
FileHandler.phpBASEPATH/Cache/Handlers/FileHandler.php
FileLocator.phpBASEPATH/Autoloader/FileLocator.php
Files.phpBASEPATH/Debug/Toolbar/Collectors/Files.php
FilterInterface.phpBASEPATH/Filters/FilterInterface.php
Filters.phpBASEPATH/Filters/Filters.php
Header.phpBASEPATH/HTTP/Header.php
IncomingRequest.phpBASEPATH/HTTP/IncomingRequest.php
Logger.phpBASEPATH/Log/Logger.php
LoggerInterface.phpBASEPATH/ThirdParty/PSR/Log/LoggerInterface.php
Logs.phpBASEPATH/Debug/Toolbar/Collectors/Logs.php
Message.phpBASEPATH/HTTP/Message.php
Parser.phpBASEPATH/View/Parser.php
RendererInterface.phpBASEPATH/View/RendererInterface.php
Request.phpBASEPATH/HTTP/Request.php
RequestInterface.phpBASEPATH/HTTP/RequestInterface.php
Response.phpBASEPATH/HTTP/Response.php
ResponseInterface.phpBASEPATH/HTTP/ResponseInterface.php
RouteCollection.phpBASEPATH/Router/RouteCollection.php
RouteCollectionInterface.phpBASEPATH/Router/RouteCollectionInterface.php
Router.phpBASEPATH/Router/Router.php
RouterInterface.phpBASEPATH/Router/RouterInterface.php
Routes.phpBASEPATH/Config/Routes.php
Routes.phpBASEPATH/Debug/Toolbar/Collectors/Routes.php
Services.phpBASEPATH/Config/Services.php
Timer.phpBASEPATH/Debug/Timer.php
Timers.phpBASEPATH/Debug/Toolbar/Collectors/Timers.php
Toolbar.phpBASEPATH/Debug/Toolbar.php
URI.phpBASEPATH/HTTP/URI.php
View.phpBASEPATH/Config/View.php
View.phpBASEPATH/View/View.php
Views.phpBASEPATH/Debug/Toolbar/Collectors/Views.php
bootstrap.phpBASEPATH/bootstrap.php
kint.phpBASEPATH/ThirdParty/Kint/kint.php
toolbar.tpl.phpBASEPATH/Debug/Toolbar/Views/toolbar.tpl.php
url_helper.phpBASEPATH/Helpers/url_helper.php
+
+
+

Routes

+ +

Matched Route

+ + + + + + + + + + + + + + + + + + + + + + + +
Directory:
Controller:\App\Controllers\Home
Method:index
Params:0 / 0
+ + +

Defined Routes

+ + + + + + + + + + +
/\App\Controllers\Home::index
+
+
+

Events

+ + + + + + + + + + + + + + + + + + +
TimeEvent NameTimes Called
0.05 mspre_system1
+
+ + +
+ + + + +

View Data

+
+ + + + + +
+ + + + +

Session User Data

+
+ +

Session doesn't seem to be active.

+ +

Request ( HTTP/1.1 )

+ + + + +

Headers

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Cache-Controlno-cache
Pragmano-cache
Upgrade-Insecure-Requests1
Connectionkeep-alive
Cookiedebug-bar-state=open
Accept-Encodinggzip, deflate
Accept-Languageen-US,en;q=0.5
Accepttext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-AgentMozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:58.0) Gecko/20100101 Firefox/58.0
Hostci4.dev
+ + +

Cookies

+
+ + + + + + + + + + +

Response ( 200 - OK )

+ + +

Headers

+
+ + + + + + + + + + + + +
Cache-controlno-store, max-age=0, no-cache
Content-Typetext/html; charset=UTF-8
+