-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.1.0 Continuous improve and modernize.
PHP version is now required v 5.4. Rundiz/number is no more required but suggested. PHP section now showing extensions and ini settings. Logs section currently have summaries for each log type. Time Load section can use `matchKey` to check self cost and have 1 morer column. It is self time. Memory Usage section can also use `matchKey` and have 1 more column. It is self memory. Database section is now always using self time and self memory. Any devs must add memory_get_usage() while calling to profiling the database otherwise the PHP will trigger the errors. Due to the `memory` array key in the Database section will be removed in the future so devs have to remove it and use `memory_start` and `memory_end` instead. Change how display.php template works. Now it is a lot looks easier. You can check between `matchKey` in each section for beginning and end value by click on the matchKey name.
- Loading branch information
Showing
17 changed files
with
657 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
// This file is included by display.php | ||
// Set document for helper in IDE. | ||
/* @var $this \Rundiz\Profiler\Profiler */ | ||
|
||
$summary = count($data_array); | ||
|
||
echo "\n"; | ||
?> | ||
<li id="Section<?php echo $section_to_id; ?>" class="rdprofiler-see-details"> | ||
<a class="see-details" title="<?php echo $summary; ?>"><strong><?php echo $section; ?></strong> <?php echo $summary; ?></a> | ||
<ul> | ||
<li class="rdprofiler-log-summary-row"> | ||
<div class="rdprofiler-log-data">SQL statement</div> | ||
<div class="rdprofiler-log-db-timetake">Self Time</div> | ||
<div class="rdprofiler-log-memory">Self Memory</div> | ||
</li><!--.rdprofiler-log-summary-row--> | ||
<?php | ||
if (is_array($data_array) && !empty($data_array)) { | ||
foreach ($data_array as $data_key => $data_values) { | ||
if (is_numeric($data_key) && is_array($data_values) && array_key_exists('data', $data_values)) { | ||
// if contain data then display, otherwise just skip it. | ||
?> | ||
<li> | ||
<?php | ||
echo "\n"; | ||
echo rdProfilerIndent(6).'<pre class="rdprofiler-log-data">'."\n".htmlspecialchars(trim(print_r($data_values['data'], true)), ENT_QUOTES)."\n".rdProfilerIndent(6).'</pre>'."\n"; | ||
|
||
if ($section == 'Database') { | ||
call_user_func($display_db_function, $this, $dbh, $data_values); | ||
} | ||
?> | ||
</li> | ||
<?php | ||
} | ||
}// endforeach; $data_array | ||
// endforeach of loop display each section's log detail. | ||
unset($data_key, $data_values); | ||
} else { | ||
?> | ||
<li><pre class="rdprofiler-log-data">There is no data to display.</pre></li> | ||
<?php } ?> | ||
</ul> | ||
</li><!--#SectionXXXX--> | ||
<?php | ||
unset($summary); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
// This file is included by display.php | ||
// Set document for helper in IDE. | ||
/* @var $this \Rundiz\Profiler\Profiler */ | ||
|
||
$summary = (count($data_array)-2); | ||
|
||
echo "\n"; | ||
?> | ||
<li id="Section<?php echo $section_to_id; ?>" class="rdprofiler-see-details"> | ||
<a class="see-details" title="<?php echo $summary; ?>"><strong><?php echo $section; ?></strong> <?php echo $summary; ?></a> | ||
<ul> | ||
<li class="rdprofiler-log-summary-row"> | ||
<div class="rdprofiler-log-file-totalsize">File</div> | ||
<div class="rdprofiler-log-file-totalsize-value">Size</div> | ||
</li><!--.rdprofiler-log-summary-row--> | ||
<?php if (isset($data_array['total_size'])) { ?> | ||
<li class="rdprofiler-log-summary-row"> | ||
<div class="rdprofiler-log-file-totalsize">Total size</div> | ||
<div class="rdprofiler-log-file-totalsize-value"><?php | ||
echo "\n"; | ||
if (isset($number)) { | ||
echo rdProfilerIndent(7).$number->fromBytes($data_array['total_size']); | ||
} else { | ||
echo rdProfilerIndent(7).$this->getReadableFileSize($data_array['total_size']); | ||
} | ||
?> | ||
</div> | ||
</li><!--.rdprofiler-log-summary-row--> | ||
<?php }// endif; total size ?> | ||
<?php if (isset($data_array['largest_size'])) { ?> | ||
<li class="rdprofiler-log-summary-row"> | ||
<div class="rdprofiler-log-file-largestsize">Largest size</div> | ||
<div class="rdprofiler-log-file-largestsize-value"><?php | ||
echo "\n"; | ||
if (isset($number)) { | ||
echo rdProfilerIndent(7).$number->fromBytes($data_array['largest_size']); | ||
} else { | ||
echo rdProfilerIndent(7).$this->getReadableFileSize($data_array['largest_size']); | ||
} | ||
?> | ||
</div> | ||
</li><!--.rdprofiler-log-summary-row--> | ||
<?php }// endif; largest size ?> | ||
<?php | ||
if (is_array($data_array) && !empty($data_array)) { | ||
foreach ($data_array as $data_key => $data_values) { | ||
if (is_numeric($data_key) && is_array($data_values) && array_key_exists('data', $data_values)) { | ||
// if contain data then display, otherwise just skip it. | ||
?> | ||
<li> | ||
<?php | ||
echo "\n"; | ||
echo rdProfilerIndent(6).'<pre class="rdprofiler-log-data">'."\n".htmlspecialchars(trim(print_r($data_values['data'], true)), ENT_QUOTES)."\n".rdProfilerIndent(6).'</pre>'."\n"; | ||
|
||
if (isset($data_values['size'])) { | ||
echo rdProfilerIndent(6).'<div class="rdprofiler-log-filesize">'; | ||
if (isset($number)) { | ||
echo $number->fromBytes($data_values['size']); | ||
} else { | ||
echo $this->getReadableFileSize($data_values['size']); | ||
} | ||
echo '</div>'."\n"; | ||
} | ||
?> | ||
</li> | ||
<?php | ||
} | ||
}// endforeach; $data_array | ||
// endforeach of loop display each section's log detail. | ||
unset($data_key, $data_values); | ||
} else { | ||
?> | ||
<li><pre class="rdprofiler-log-data">There is no data to display.</pre></li> | ||
<?php } ?> | ||
</ul> | ||
</li><!--#SectionXXXX--> | ||
<?php | ||
unset($summary); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
// This file is included by display.php | ||
// Set document for helper in IDE. | ||
/* @var $this \Rundiz\Profiler\Profiler */ | ||
|
||
$summary = count($data_array); | ||
|
||
echo "\n"; | ||
?> | ||
<li id="Section<?php echo $section_to_id; ?>" class="rdprofiler-see-details"> | ||
<a class="see-details" title="<?php echo $summary; ?>"><strong><?php echo $section; ?></strong> <?php echo $summary; ?></a> | ||
<ul> | ||
<li class="rdprofiler-log-summary-row"> | ||
<table class="rdprofiler-log-logtypes"> | ||
<tr> | ||
<td class="rdprofiler-log-logtype debug">Debug (<?php echo $this->countTotalLogType('debug'); ?>)</td> | ||
<td class="rdprofiler-log-logtype info">Info (<?php echo $this->countTotalLogType('info'); ?>)</td> | ||
<td class="rdprofiler-log-logtype notice">Notice (<?php echo $this->countTotalLogType('notice'); ?>)</td> | ||
<td class="rdprofiler-log-logtype warning">Warning (<?php echo $this->countTotalLogType('warning'); ?>)</td> | ||
<td class="rdprofiler-log-logtype error">Error (<?php echo $this->countTotalLogType('error'); ?>)</td> | ||
<td class="rdprofiler-log-logtype critical">Critical (<?php echo $this->countTotalLogType('critical'); ?>)</td> | ||
<td class="rdprofiler-log-logtype alert">Alert (<?php echo $this->countTotalLogType('alert'); ?>)</td> | ||
<td class="rdprofiler-log-logtype emergency">Emergency (<?php echo $this->countTotalLogType('emergency'); ?>)</td> | ||
</tr> | ||
</table> | ||
</li><!--.rdprofiler-log-summary-row--> | ||
<?php | ||
if (is_array($data_array) && !empty($data_array)) { | ||
foreach ($data_array as $data_key => $data_values) { | ||
if (is_numeric($data_key) && is_array($data_values) && array_key_exists('data', $data_values)) { | ||
// if contain data then display, otherwise just skip it. | ||
?> | ||
<li> | ||
<?php | ||
echo "\n"; | ||
if (isset($data_values['logtype'])) { | ||
// if log type exists. this is only for Logs section. | ||
echo rdProfilerIndent(6).'<div class="rdprofiler-log-logtype '.strip_tags($data_values['logtype']).'">'.strip_tags(ucfirst($data_values['logtype'])).'</div>'."\n"; | ||
} | ||
|
||
echo rdProfilerIndent(6).'<pre class="rdprofiler-log-data">'."\n".htmlspecialchars(trim(print_r($data_values['data'], true)), ENT_QUOTES)."\n".rdProfilerIndent(6).'</pre>'."\n"; | ||
|
||
if ((isset($data_values['file']) && $data_values['file'] != null) || (isset($data_values['line']) && $data_values['line'] != null)) { | ||
// if contain file and line data then display it. this appears in these sections: Logs, Time Load, Memory Usage. | ||
echo rdProfilerIndent(6).'<div class="rdprofiler-log-fileline">'; | ||
if (isset($data_values['file']) && $data_values['file'] != null) { | ||
echo htmlspecialchars($data_values['file'], ENT_QUOTES); | ||
} | ||
if ((isset($data_values['file']) && $data_values['file'] != null) && (isset($data_values['line']) && $data_values['line'] != null)) { | ||
echo ', line '; | ||
} | ||
if (isset($data_values['line']) && $data_values['line'] != null) { | ||
echo strip_tags($data_values['line']); | ||
} | ||
echo '</div>'."\n"; | ||
} | ||
?> | ||
</li> | ||
<?php | ||
} | ||
}// endforeach; $data_array | ||
// endforeach of loop display each section's log detail. | ||
unset($data_key, $data_values); | ||
} else { | ||
?> | ||
<li><pre class="rdprofiler-log-data">There is no data to display.</pre></li> | ||
<?php } ?> | ||
</ul> | ||
</li><!--#SectionXXXX--> | ||
<?php | ||
unset($summary); |
Oops, something went wrong.