lonnieezell / codeigniter-forensics

A high-powered, customizable Profiler replacement for CodeIgniter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in Profiler _compile_queries()

arclyte opened this issue · comments

I noticed that the queries output seemed to be missing a bunch of queries that I knew should have been there. Checking the code I found that it was being put into an array like this:

$output[$time] = $val;

If the time is the same across queries the new query will overwrite previous values. In my case this led me to have 3 instead of 10 queries in the profiler output.

I modified the code in my branch to this:

$output[][$time] = $val;

And added an extra foreach loop in the output template.

I'd do a pull request but I've made a bunch of other changes here and there that would come along with it, but let me know if you want to know exactly what changes were made to fix this or check out my fork. In my local version I've also added a total value so it displays "Total Query Execution Time" at the bottom of the query list for a quick check on total query time.

This issue is fixed in my latest pull request.