-
Notifications
You must be signed in to change notification settings - Fork 4
/
MY_Profiler.php
486 lines (486 loc) · 28.1 KB
/
MY_Profiler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
<?php
/**
* Authors : - virutmath <https://github.com/virutmath>
* - PX Webdesign
* - Khairul Anwar <https://github.com/iruwl>
*
* Base on : - https://github.com/virutmath/codeigniter-custom/blob/master/MY_Profiler.php
* - http://lab.clearpixel.com.au/2008/06/list-duplicate-database-queries-in-codeigniter/
*
* Link : https://github.com/iruwl/simple-ci-profiler
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Profiler extends CI_Profiler
{
protected $_available_sections = array(
'benchmarks',
'memory_usage',
'controller_info',
'uri_string',
'get',
'post',
'queries',
'duplicate_queries',
'http_headers',
'session_data',
'config'
);
// http://php.net/manual/de/function.filesize.php
private function human_filesize($bytes, $decimals = 2) {
$sz = 'BKMGTP';
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
}
protected function _compile_memory_usage()
{
return "\n\n"
.'<fieldset id="ci_profiler_memory_usage" style="border:1px solid #5a0099;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee;">'
."\n"
.'<legend style="color:#5a0099;"> '.$this->CI->lang->line('profiler_memory_usage')." </legend>\n"
.'<div style="color:#5a0099;font-weight:normal;padding:4px 0 4px 0;">'
// .(($usage = memory_get_usage()) != '' ? number_format($usage).' bytes' : $this->CI->lang->line('profiler_no_memory'))
.(($usage = memory_get_usage()) != '' ? $this->human_filesize($usage).' bytes' : $this->CI->lang->line('profiler_no_memory'))
.'</div></fieldset>';
}
//fix complete queries fieldset
protected function _compile_queries()
{
$dbs = array();
// Let's determine which databases are currently connected to
foreach (get_object_vars($this->CI) as $name => $cobject)
{
if (is_object($cobject))
{
if ($cobject instanceof CI_DB)
{
$dbs[get_class($this->CI).':$'.$name] = $cobject;
}
elseif ($cobject instanceof CI_Model)
{
foreach (get_object_vars($cobject) as $mname => $mobject)
{
if ($mobject instanceof CI_DB)
{
$dbs[get_class($cobject).':$'.$mname] = $mobject;
}
}
}
}
}
if (count($dbs) === 0)
{
return "\n\n"
.'<fieldset id="ci_profiler_queries" style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee;">'
."\n"
.'<legend style="color:#0000FF;"> '.$this->CI->lang->line('profiler_queries').' </legend>'
."\n\n\n<table style=\"border:none; width:100%;\">\n"
.'<tr><td style="width:100%;color:#0000FF;font-weight:normal;background-color:#eee;padding:5px;">'
.$this->CI->lang->line('profiler_no_db')
."</td></tr>\n</table>\n</fieldset>";
}
// Load the text helper so we can highlight the SQL
$this->CI->load->helper('text');
// Key words we want bolded
$highlight = array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'AND', 'LEFT JOIN', 'ORDER BY', 'GROUP BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR ', 'HAVING', 'OFFSET', 'NOT IN', 'IN', 'LIKE', 'NOT LIKE', 'COUNT', 'MAX', 'MIN', 'ON', 'AS', 'AVG', 'SUM', '(', ')');
$output = "\n\n";
$count = 0;
foreach ($dbs as $name => $db)
{
$hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : '';
$total_time = number_format(array_sum($db->query_times), 4).' '.$this->CI->lang->line('profiler_seconds');
$show_hide_js = '(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_queries_db_'.$count.'\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_hide').'\'?\''.$this->CI->lang->line('profiler_section_show').'\':\''.$this->CI->lang->line('profiler_section_hide').'\';">'.$this->CI->lang->line('profiler_section_hide').'</span>)';
if ($hide_queries !== '')
{
$show_hide_js = '(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_queries_db_'.$count.'\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)';
}
$output .= '<fieldset id="ci_profiler_queries" style="border:1px solid #0000FF;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee;">'
."\n"
.'<legend style="color:#0000FF;"> '.$this->CI->lang->line('profiler_database')
.': '.$db->database.' ('.$name.') '.$this->CI->lang->line('profiler_queries')
.': '.count($db->queries).' ('.$total_time.') '.$show_hide_js."</legend>\n\n\n"
.'<table style="width:100%;'.$hide_queries.'" id="ci_profiler_queries_db_'.$count."\">\n";
if (count($db->queries) === 0)
{
$output .= '<tr><td style="width:100%;color:#0000FF;font-weight:normal;background-color:#eee;padding:5px;">'
.$this->CI->lang->line('profiler_no_queries')."</td></tr>\n";
}
else
{
foreach ($db->queries as $key => $val)
{
$time = number_format($db->query_times[$key], 4);
$val = highlight_code($val);
foreach ($highlight as $bold)
{
$val = str_replace($bold, '<strong>'.$bold.'</strong>', $val);
}
$output .= '<tr><td style="padding:5px;vertical-align:top;width:1%;color:#900;font-weight:normal;background-color:#ddd;">'
.$time.' </td><td style="padding:5px;color:#000;font-weight:normal;background-color:#ddd;">'
.$val."</td></tr>\n";
}
}
$output .= "</table>\n</fieldset>";
$count++;
}
return $output;
}
protected function _compile_duplicate_queries() {
$output = '';
if ( ! class_exists('CI_DB_driver'))
{
$output .= "\n\n";
$output .= '<fieldset id="ci_profiler_duplicate_queries" style="border:1px solid #e01dc7;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
$output .= '<legend style="color:#e01dc7;"> DUPLICATE QUERIES </legend>';
$output .= "\n";
$output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n";
$output .="<tr><td width='100%' style='color:#e01dc7;font-weight:normal;background-color:#eee;'>".$this->CI->lang->line('profiler_no_db')."</td></tr>\n";
$output .= "</table>\n";
$output .= "</fieldset>";
}
else
{
$dbs = array();
// Let's determine which databases are currently connected to
foreach (get_object_vars($this->CI) as $name => $cobject)
{
if (is_object($cobject))
{
if ($cobject instanceof CI_DB)
{
$dbs[get_class($this->CI).':$'.$name] = $cobject;
}
elseif ($cobject instanceof CI_Model)
{
foreach (get_object_vars($cobject) as $mname => $mobject)
{
if ($mobject instanceof CI_DB)
{
$dbs[get_class($cobject).':$'.$mname] = $mobject;
}
}
}
}
}
foreach ($dbs as $name => $db)
{
$queries['original'] = $db->queries;
$queries['unique'] = array_unique($db->queries);
$queries['duplicates'] = array_diff_assoc($queries['original'],$queries['unique']);
$duplicateOutput = '';
$duplicates = array();
$duplicatesCount = array();
// Append number of dupes
if ($queries['duplicates']) {
$highlight = array('SELECT', 'FROM', 'WHERE', 'AND', 'LEFT JOIN', 'ORDER BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR');
// Build the duplicates array
$i = 0;
foreach ($queries['duplicates'] as $duplicateQuery) {
if (is_numeric($key = array_search($duplicateQuery,$duplicates))) {
// Found query so just increment
$duplicatesCount[$key]++;
} else {
// Query not found so add and increment
$duplicates[$i] = $duplicateQuery;
$duplicatesCount[$i] = 2;
$i++;
}
}
foreach ($duplicates as $key => $val)
{
$val = htmlspecialchars($val, ENT_QUOTES);
foreach ($highlight as $bold)
{
$val = str_replace($bold, '<strong>'.$bold.'</strong>', $val);
}
$duplicateOutput .= "<tr><td width='1%' valign='top' style='color:#990000;font-weight:normal;background-color:#ddd;'>[".$duplicatesCount[$key]."] </td><td style='color:#000;font-weight:normal;background-color:#ddd;'>".$val."</td></tr>\n";
}
}
// Calculate number of dupes
$duplicateNum = count($duplicates);
if (count($db->queries) > 1 && $duplicateNum > 0) {
$output .= "\n\n";
$output .= '<fieldset id="ci_profiler_duplicate_queries" style="border:1px solid #e01dc7;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
$output .= '<legend style="color:#e01dc7;"> DUPLICATE QUERIES: '.$db->database.' ('.$name.') </legend>';
$output .= "\n";
$output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n";
$output .= $duplicateOutput;
$output .= "</table>\n";
$output .= "</fieldset>";
}
// If no dupes then don't output
if (!count($queries['duplicates'])) {
$output .= "\n\n";
$output .= '<fieldset id="ci_profiler_duplicate_queries" style="border:1px solid #e01dc7;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
$output .= '<legend style="color:#e01dc7;"> DUPLICATE QUERIES: '.$db->database.' ('.$name.') </legend>';
$output .= "\n";
$output .= "No duplicate queries";
$output .= "</fieldset>";
}
}
}
return $output;
}
public function run()
{
$output = '';
$output .= '
<style>
#codeigniter_wrap_profiler {
font-size: 12px;
font-family: \'Source Sans Pro\',\'Helvetica Neue\',Helvetica,Arial,sans-serif;
font-weight: 400;
position: fixed;
bottom : 0;
left: 0;
z-index: 1000;
width: 100%;
height: 230px;
overflow: hidden;
padding-top: 4px;
background: #fff;
border-top: 1px solid #ccc;
box-sizing : border-box;
}
#codeigniter_profiler_debug_bar {
height: 27px;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
background: #f0f0f0;
color: #333;
overflow-y: hidden;
overflow-x: auto;
}
#codeigniter_profiler_debug_bar_tab {
float: left;
border-right: 1px solid #f0f0f0;
text-align: center;
text-transform: uppercase;
}
#codeigniter_profiler_logo {
float: left;
padding: 4px;
background: red;
}
#codeigniter_profiler_logo img {
width: 16px;
height: 16px;
margin-top: -4px;
}
#codeigniter_profiler_title {
float: left;
line-height: 1.5em;
padding: 4px;
font-size: 12px;
background: #f0f0f0;
cursor: default;
}
#codeigniter_profiler_title a {
color: #666;
padding: 4px;
text-decoration: none;
cursor: pointer;
}
#codeigniter_profiler_title a:hover {
background-color: #cccccc;
padding: 4px;
}
#codeigniter_profiler_close {
float: right;
padding-right: 3px;
background: #fff;
padding-left: 3px;
border-radius: 50%;
line-height: 16px;
cursor: pointer;
font-size: 18px;
font-weight: bold;
margin-top: 3px;
border: 1px solid #ccc;
margin-left: 5px;
}
#codeigniter_profiler_x2 {
float: right;
padding-right: 3px;
padding-left: 3px;
cursor: pointer;
line-height: 16px;
text-align: center;
font-size: 12px;
border: 1px solid #ccc;
border-radius: 50%;
background: #fff;
margin-top: 3px;
}
#codeigniter_profiler {
overflow: auto;
height: 200px;
}
#codeigniter_profiler fieldset{
font-size: 12px;
margin: 0 0 6px !important;
padding: 1px 4px !important;
}
#codeigniter_profiler code {
word-break: break-all;
word-break: break-word;
}
#codeigniter_profiler fieldset legend {
border: none;
font-weight: bold;
padding: 0;
width: auto;
}
</style>';
$output .= '<div id="codeigniter_wrap_profiler">';
$output .= $this->addDebugBar();
$output .= parent::run();
$output .= '</div>';
//add script
$output .= '
<script>
var cookie_fn = {
set: function(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
} else
var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
},
get: function(name) {
/*
var nameEQ = name + "=";
var ca = document.cookie.split(\';\');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==\' \') {
c = c.substring(1,c.length);
}
if (c.indexOf(nameEQ) == 0) {
return c.substring(nameEQ.length,c.length);
}
}
return null;
*/
// one line code, awesome :)
return(document.cookie.match(\'(^|; )\'+name+\'=([^;]*)\')||0)[2];
},
del: function(name) {
this.set(name,"",-1);
},
check: function(name) {
var isset = this.get(name);
return (isset);
},
};
var ci_profiler_wrap = document.getElementById("codeigniter_wrap_profiler");
var ci_profiler = document.getElementById("codeigniter_profiler");
var ci_profiler_bar = document.getElementById("codeigniter_profiler_debug_bar");
var ci_profiler_height = ci_profiler_wrap.offsetHeight;
var ci_profiler_fn = {
defaultHeight: 230,
triggerZoom: false,
// triggerClose: false,
triggerClose: Boolean(parseInt(cookie_fn.get(\'ci_profile_close\'))),
minimalBar : function() {
ci_profiler_wrap.style.height = this.triggerClose ? ci_profiler_height + "px" : "31px";
this.triggerClose = !this.triggerClose;
cookie_fn.set(\'ci_profile_close\', this.triggerClose ? 1:0,1);
this.resizeBody();
},
zoomBar: function() {
if(this.triggerClose) {
this.minimalBar();
return;
}
ci_profiler_height = this.triggerZoom ? ci_profiler_wrap.offsetHeight / 2 : ci_profiler_wrap.offsetHeight * 2;
ci_profiler_wrap.style.height = ci_profiler_height + "px";
ci_profiler.style.height = (ci_profiler_height - ci_profiler_bar.offsetHeight - 25) + "px";
this.triggerZoom = !this.triggerZoom;
this.resizeBody();
},
resizeBody: function() {
document.body.style.marginBottom = ci_profiler_wrap.offsetHeight + "px";
},
restoreBody: function(section) {
cookie_fn.set(\'ci_profile_section\', section, 1);
if(this.triggerClose) {
this.zoomBar();
}
// this.scrollSection(section);
this.showSection(section);
},
scrollSection: function(section) {
// using scrollIntoView
// document.getElementById(section).scrollIntoView(true);
var ci_section = document.getElementById(section);
if(ci_section) {
ci_section.scrollIntoView(true);
}
},
showSection: function(section) {
// using display mode
this.hideSection(0);
var ci_section = document.getElementById(section);
if(ci_section) {
ci_section.style.display = "block";
}
},
hideSection: function(startFrom) {
var elements = document.getElementsByTagName("fieldset");
for(var i=startFrom; i<elements.length; i++) {
elements[i].style.display = "none";
}
},
};
// ci_profiler_fn.hideSection(1);
// ci_profiler_fn.resizeBody();
// ci_profiler_fn.minimalBar();
if(Boolean(parseInt(cookie_fn.get(\'ci_profile_close\')))) {
ci_profiler_wrap.style.height = "31px";
}
var last_section = cookie_fn.get(\'ci_profile_section\') || \'ci_profiler_benchmarks\';
ci_profiler_fn.showSection(last_section);
</script>';
return $output;
}
protected function addDebugBar() {
$debugBar = '';
$debugBar .= '<div id="codeigniter_profiler_debug_bar">';
$debugBar .= $this->debugBarTab();
$debugBar .= '<div id="codeigniter_profiler_close" onclick="ci_profiler_fn.minimalBar()">
<span>×</span>
</div>';
$debugBar .= '<div id="codeigniter_profiler_x2" onclick="ci_profiler_fn.zoomBar()">
<span>☐</span>
</div>';
$debugBar .= '</div>';
return $debugBar;
}
protected function debugBarTab() {
$tab = $this->debugIcon();
foreach ($this->_available_sections as $section)
if ($this->_compile_{$section} !== FALSE)
$tab .= $this->debugTabs($section);
return $tab;
}
protected function debugIcon() {
$tab = '<div id="codeigniter_profiler_debug_bar_tab">';
$tab .= '<span id="codeigniter_profiler_logo"><a href="https://www.codeigniter.com/docs" target="_blank"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCC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3pmcSKOSxkp0jpJwOxQtqJJ1bo9Zg3yhz+4gn8+FH8uWfxMy/0OYwB4Uqy7Po+r/w96KezV9TS47g/cullLeyzvJizooC6QvOvofnzDSizlfv91L/Qa69A0WqAZVmjannzm2W3Yra7Z05/RLoXWJgdoFkCHiClh5v+r7iLPL+JvACPsLyIFhfQubNoYR5Chp/sgcvzMc87ghD2kGU/AERdHyDFe4BXNtKTVHj6BnV5L/KzhOwg4jp43QkCxBotLeL/OYUWLzQSG8/wtUhPIHWpys8Q6/vAFjfeNBmQ0i+pypvw9BTwEBZuRGT9dtekuLEJaAdwC1l2P+JJ1eUNGL/Z/Mbd7LRitd/y1o1NWuM0xqv9jGj4lbT5fgfS20npIUL20ta+LDQSOoW0a3y1OA4gNdJJ0Pn+p8a1jv8NAE/pZw5YwnwUAAAAAElFTkSuQmCC"/></a></span>';
$tab .= '</div>';
return $tab;
}
protected function debugTabs($section) {
$tab = '<div id="codeigniter_profiler_debug_bar_tab">';
// $tab .= '<span id="codeigniter_profiler_title"><a href="#ci_profiler_'.$section.'">'.strtoupper($section).'</a></span>';
// $tab .= '<span id="codeigniter_profiler_title"><a href="#ci_profiler_'.$section.'">'.$section.'</a></span>';
// $tab .= '<span id="codeigniter_profiler_title"><a href="javascript:void(0);" onclick="document.getElementById(\'ci_profiler_'.$section.'\').scrollIntoView(true);">'.$section.'</a></span>';
$tab .= '<span id="codeigniter_profiler_title"><a href="javascript:void(0);" onclick="ci_profiler_fn.restoreBody(\'ci_profiler_'.$section.'\');">'.$section.'</a></span>';
$tab .= '</div>';
return $tab;
}
}