diff options
Diffstat (limited to 'system/views/profiler')
-rw-r--r-- | system/views/profiler/profiler.php | 37 | ||||
-rw-r--r-- | system/views/profiler/table.css | 53 | ||||
-rw-r--r-- | system/views/profiler/table.php | 24 |
3 files changed, 114 insertions, 0 deletions
diff --git a/system/views/profiler/profiler.php b/system/views/profiler/profiler.php new file mode 100644 index 00000000..7b9ae951 --- /dev/null +++ b/system/views/profiler/profiler.php @@ -0,0 +1,37 @@ +<?php defined('SYSPATH') OR die('No direct access allowed.'); ?> +<style type="text/css"> +#kohana-profiler +{ + font-family: Monaco, 'Courier New'; + background-color: #F8FFF8; + margin-top: 20px; + clear: both; + padding: 10px 10px 0; + border: 1px solid #E5EFF8; + text-align: left; +} +#kohana-profiler pre +{ + margin: 0; + font: inherit; +} +#kohana-profiler .kp-meta +{ + margin: 0 0 10px; + padding: 4px; + background: #FFF; + border: 1px solid #E5EFF8; + color: #A6B0B8; + text-align: center; +} +<?php echo $styles ?> +</style> +<div id="kohana-profiler"> +<?php +foreach ($profiles as $profile) +{ + echo $profile->render(); +} +?> +<p class="kp-meta"><?php echo __('Profiler executed in :execution_timess', array(':execution_times' => number_format($execution_time, 3))) ?></p> +</div>
\ No newline at end of file diff --git a/system/views/profiler/table.css b/system/views/profiler/table.css new file mode 100644 index 00000000..41a1c9a3 --- /dev/null +++ b/system/views/profiler/table.css @@ -0,0 +1,53 @@ +#kohana-profiler .kp-table +{ + font-size: 1.0em; + color: #4D6171; + width: 100%; + border-collapse: collapse; + border-top: 1px solid #E5EFF8; + border-right: 1px solid #E5EFF8; + border-left: 1px solid #E5EFF8; + margin-bottom: 10px; +} +#kohana-profiler .kp-table td +{ + background-color: #FFFFFF; + border-bottom: 1px solid #E5EFF8; + padding: 3px; + vertical-align: top; +} +#kohana-profiler .kp-table .kp-title td +{ + font-weight: bold; + background-color: inherit; +} +#kohana-profiler .kp-table .kp-altrow td +{ + background-color: #F7FBFF; +} +#kohana-profiler .kp-table .kp-totalrow td +{ + background-color: #FAFAFA; + border-top: 1px solid #D2DCE5; + font-weight: bold; +} +#kohana-profiler .kp-table .kp-column +{ + width: 100px; + border-left: 1px solid #E5EFF8; + text-align: center; +} +#kohana-profiler .kp-table .kp-data, #kohana-profiler .kp-table .kp-name +{ + background-color: #FAFAFB; + vertical-align: top; +} +#kohana-profiler .kp-table .kp-name +{ + width: 200px; + border-right: 1px solid #E5EFF8; +} +#kohana-profiler .kp-table .kp-altrow .kp-data, #kohana-profiler .kp-table .kp-altrow .kp-name +{ + background-color: #F6F8FB; +}
\ No newline at end of file diff --git a/system/views/profiler/table.php b/system/views/profiler/table.php new file mode 100644 index 00000000..7cdf79dd --- /dev/null +++ b/system/views/profiler/table.php @@ -0,0 +1,24 @@ +<?php defined('SYSPATH') OR die('No direct access allowed.'); ?> +<table class="kp-table"> +<?php +foreach ($rows as $row): + +$class = empty($row['class']) ? '' : ' class="'.$row['class'].'"'; +$style = empty($row['style']) ? '' : ' style="'.$row['style'].'"'; +?> + <tr<?php echo $class; echo $style; ?>> + <?php + foreach ($columns as $index => $column) + { + $class = empty($column['class']) ? '' : ' class="'.$column['class'].'"'; + $style = empty($column['style']) ? '' : ' style="'.$column['style'].'"'; + $value = $row['data'][$index]; + $value = (is_array($value) OR is_object($value)) ? '<pre>'.htmlspecialchars(print_r($value, TRUE), ENT_QUOTES, Kohana::CHARSET).'</pre>' : htmlspecialchars($value, ENT_QUOTES, Kohana::CHARSET); + echo '<td' . $style . $class . '>' . wordwrap($value, 100, '<br />', true) . '</td>'; + } + ?> + </tr> +<?php +endforeach; +?> +</table> |