Welcome Guest, Not a member yet? Register   Sign In
The change on debugbar logging requests
#1

(This post was last modified: 01-27-2022, 01:31 AM by demirkaric. Edit Reason: Misconceived request )

Currently in the file vendor/codeigniter4/framework/system/Debug/Toolbar.php
In the method prepare() for generating debugbar_*.json  and history tracking the method time() is used.  

This con of using time() is that if we have multiple requests the file will get overwriten in the exact same second and the debugbar won't show all requests but only the last request.

My suggestion is using microtime() or something like random string that will be generated in the name of the file, thus we will have all logged requests in the debugbar.

Also when multiple developers works on different modules I suggest the option that developers can filter requests by session so that everyone can see it's own requests made by their browser.
Reply
#2

I think you're looking for microtime(true)

https://www.php.net/manual/en/function.microtime.php
Reply
#3

(01-25-2022, 06:50 PM)paulbalandan Wrote: I think you're looking for microtime(true)

https://www.php.net/manual/en/function.microtime.php

Just preformulated the request.
Reply
#4

This is reasonable.
Why don't you send a PR?
See https://github.com/codeigniter4/CodeIgni.../README.md
Reply
#5

These are both good suggestions. We'd love it if you could submit those changes!
Reply
#6

Just submitted PR https://github.com/codeigniter4/CodeIgniter4/pull/5643
Reply




Theme © iAndrew 2016 - Forum software by © MyBB