Added Kohana v3.0.9
This commit is contained in:
128
includes/kohana/system/views/kohana/error.php
Normal file
128
includes/kohana/system/views/kohana/error.php
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
// Unique error identifier
|
||||
$error_id = uniqid('error');
|
||||
|
||||
?>
|
||||
<style type="text/css">
|
||||
#kohana_error { background: #ddd; font-size: 1em; font-family:sans-serif; text-align: left; color: #111; }
|
||||
#kohana_error h1,
|
||||
#kohana_error h2 { margin: 0; padding: 1em; font-size: 1em; font-weight: normal; background: #911; color: #fff; }
|
||||
#kohana_error h1 a,
|
||||
#kohana_error h2 a { color: #fff; }
|
||||
#kohana_error h2 { background: #222; }
|
||||
#kohana_error h3 { margin: 0; padding: 0.4em 0 0; font-size: 1em; font-weight: normal; }
|
||||
#kohana_error p { margin: 0; padding: 0.2em 0; }
|
||||
#kohana_error a { color: #1b323b; }
|
||||
#kohana_error pre { overflow: auto; white-space: pre-wrap; }
|
||||
#kohana_error table { width: 100%; display: block; margin: 0 0 0.4em; padding: 0; border-collapse: collapse; background: #fff; }
|
||||
#kohana_error table td { border: solid 1px #ddd; text-align: left; vertical-align: top; padding: 0.4em; }
|
||||
#kohana_error div.content { padding: 0.4em 1em 1em; overflow: hidden; }
|
||||
#kohana_error pre.source { margin: 0 0 1em; padding: 0.4em; background: #fff; border: dotted 1px #b7c680; line-height: 1.2em; }
|
||||
#kohana_error pre.source span.line { display: block; }
|
||||
#kohana_error pre.source span.highlight { background: #f0eb96; }
|
||||
#kohana_error pre.source span.line span.number { color: #666; }
|
||||
#kohana_error ol.trace { display: block; margin: 0 0 0 2em; padding: 0; list-style: decimal; }
|
||||
#kohana_error ol.trace li { margin: 0; padding: 0; }
|
||||
.js .collapsed { display: none; }
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
document.documentElement.className = 'js';
|
||||
function koggle(elem)
|
||||
{
|
||||
elem = document.getElementById(elem);
|
||||
|
||||
if (elem.style && elem.style['display'])
|
||||
// Only works with the "style" attr
|
||||
var disp = elem.style['display'];
|
||||
else if (elem.currentStyle)
|
||||
// For MSIE, naturally
|
||||
var disp = elem.currentStyle['display'];
|
||||
else if (window.getComputedStyle)
|
||||
// For most other browsers
|
||||
var disp = document.defaultView.getComputedStyle(elem, null).getPropertyValue('display');
|
||||
|
||||
// Toggle the state of the "display" style
|
||||
elem.style.display = disp == 'block' ? 'none' : 'block';
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<div id="kohana_error">
|
||||
<h1><span class="type"><?php echo $type ?> [ <?php echo $code ?> ]:</span> <span class="message"><?php echo html::chars($message) ?></span></h1>
|
||||
<div id="<?php echo $error_id ?>" class="content">
|
||||
<p><span class="file"><?php echo Kohana::debug_path($file) ?> [ <?php echo $line ?> ]</span></p>
|
||||
<?php echo Kohana::debug_source($file, $line) ?>
|
||||
<ol class="trace">
|
||||
<?php foreach (Kohana::trace($trace) as $i => $step): ?>
|
||||
<li>
|
||||
<p>
|
||||
<span class="file">
|
||||
<?php if ($step['file']): $source_id = $error_id.'source'.$i; ?>
|
||||
<a href="#<?php echo $source_id ?>" onclick="return koggle('<?php echo $source_id ?>')"><?php echo Kohana::debug_path($step['file']) ?> [ <?php echo $step['line'] ?> ]</a>
|
||||
<?php else: ?>
|
||||
{<?php echo __('PHP internal call') ?>}
|
||||
<?php endif ?>
|
||||
</span>
|
||||
»
|
||||
<?php echo $step['function'] ?>(<?php if ($step['args']): $args_id = $error_id.'args'.$i; ?><a href="#<?php echo $args_id ?>" onclick="return koggle('<?php echo $args_id ?>')"><?php echo __('arguments') ?></a><?php endif ?>)
|
||||
</p>
|
||||
<?php if (isset($args_id)): ?>
|
||||
<div id="<?php echo $args_id ?>" class="collapsed">
|
||||
<table cellspacing="0">
|
||||
<?php foreach ($step['args'] as $name => $arg): ?>
|
||||
<tr>
|
||||
<td><code><?php echo $name ?></code></td>
|
||||
<td><pre><?php echo Kohana::dump($arg) ?></pre></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php if (isset($source_id)): ?>
|
||||
<pre id="<?php echo $source_id ?>" class="source collapsed"><code><?php echo $step['source'] ?></code></pre>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php unset($args_id, $source_id); ?>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
</div>
|
||||
<h2><a href="#<?php echo $env_id = $error_id.'environment' ?>" onclick="return koggle('<?php echo $env_id ?>')"><?php echo __('Environment') ?></a></h2>
|
||||
<div id="<?php echo $env_id ?>" class="content collapsed">
|
||||
<?php $included = get_included_files() ?>
|
||||
<h3><a href="#<?php echo $env_id = $error_id.'environment_included' ?>" onclick="return koggle('<?php echo $env_id ?>')"><?php echo __('Included files') ?></a> (<?php echo count($included) ?>)</h3>
|
||||
<div id="<?php echo $env_id ?>" class="collapsed">
|
||||
<table cellspacing="0">
|
||||
<?php foreach ($included as $file): ?>
|
||||
<tr>
|
||||
<td><code><?php echo Kohana::debug_path($file) ?></code></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php $included = get_loaded_extensions() ?>
|
||||
<h3><a href="#<?php echo $env_id = $error_id.'environment_loaded' ?>" onclick="return koggle('<?php echo $env_id ?>')"><?php echo __('Loaded extensions') ?></a> (<?php echo count($included) ?>)</h3>
|
||||
<div id="<?php echo $env_id ?>" class="collapsed">
|
||||
<table cellspacing="0">
|
||||
<?php foreach ($included as $file): ?>
|
||||
<tr>
|
||||
<td><code><?php echo Kohana::debug_path($file) ?></code></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php foreach (array('_SESSION', '_GET', '_POST', '_FILES', '_COOKIE', '_SERVER') as $var): ?>
|
||||
<?php if (empty($GLOBALS[$var]) OR ! is_array($GLOBALS[$var])) continue ?>
|
||||
<h3><a href="#<?php echo $env_id = $error_id.'environment'.strtolower($var) ?>" onclick="return koggle('<?php echo $env_id ?>')">$<?php echo $var ?></a></h3>
|
||||
<div id="<?php echo $env_id ?>" class="collapsed">
|
||||
<table cellspacing="0">
|
||||
<?php foreach ($GLOBALS[$var] as $key => $value): ?>
|
||||
<tr>
|
||||
<td><code><?php echo HTML::chars($key) ?></code></td>
|
||||
<td><pre><?php echo Kohana::dump($value) ?></pre></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
14
includes/kohana/system/views/kohana/generate_logo.php
Normal file
14
includes/kohana/system/views/kohana/generate_logo.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
// Get the latest logo contents
|
||||
$data = base64_encode(file_get_contents('http://kohanaframework.org/media/img/kohana.png'));
|
||||
|
||||
// Create the logo file
|
||||
file_put_contents('logo.php', "<?php
|
||||
/**
|
||||
* Kohana Logo, base64_encoded PNG
|
||||
*
|
||||
* @copyright (c) 2008-2010 Kohana Team
|
||||
* @license http://kohanaframework.org/license
|
||||
*/
|
||||
return array('mime' => 'image/png', 'data' => '{$data}'); ?>");
|
8
includes/kohana/system/views/kohana/logo.php
Normal file
8
includes/kohana/system/views/kohana/logo.php
Normal file
File diff suppressed because one or more lines are too long
74
includes/kohana/system/views/profiler/stats.php
Executable file
74
includes/kohana/system/views/profiler/stats.php
Executable file
@@ -0,0 +1,74 @@
|
||||
<?php defined('SYSPATH') or die('No direct script access.') ?>
|
||||
|
||||
<style type="text/css">
|
||||
<?php include Kohana::find_file('views', 'profiler/style', 'css') ?>
|
||||
</style>
|
||||
|
||||
<?php
|
||||
$group_stats = Profiler::group_stats();
|
||||
$group_cols = array('min', 'max', 'average', 'total');
|
||||
$application_cols = array('min', 'max', 'average', 'current');
|
||||
?>
|
||||
|
||||
<div class="kohana">
|
||||
<?php foreach (Profiler::groups() as $group => $benchmarks): ?>
|
||||
<table class="profiler">
|
||||
<tr class="group">
|
||||
<th class="name" rowspan="2"><?php echo __(ucfirst($group)) ?></th>
|
||||
<td class="time" colspan="4"><?php echo number_format($group_stats[$group]['total']['time'], 6) ?> <abbr title="seconds">s</abbr></td>
|
||||
</tr>
|
||||
<tr class="group">
|
||||
<td class="memory" colspan="4"><?php echo number_format($group_stats[$group]['total']['memory'] / 1024, 4) ?> <abbr title="kilobyte">kB</abbr></td>
|
||||
</tr>
|
||||
<tr class="headers">
|
||||
<th class="name"><?php echo __('Benchmark') ?></th>
|
||||
<?php foreach ($group_cols as $key): ?>
|
||||
<th class="<?php echo $key ?>"><?php echo __(ucfirst($key)) ?></th>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
<?php foreach ($benchmarks as $name => $tokens): ?>
|
||||
<tr class="mark time">
|
||||
<?php $stats = Profiler::stats($tokens) ?>
|
||||
<th class="name" rowspan="2" scope="rowgroup"><?php echo HTML::chars($name), ' (', count($tokens), ')' ?></th>
|
||||
<?php foreach ($group_cols as $key): ?>
|
||||
<td class="<?php echo $key ?>">
|
||||
<div>
|
||||
<div class="value"><?php echo number_format($stats[$key]['time'], 6) ?> <abbr title="seconds">s</abbr></div>
|
||||
<?php if ($key === 'total'): ?>
|
||||
<div class="graph" style="left: <?php echo max(0, 100 - $stats[$key]['time'] / $group_stats[$group]['max']['time'] * 100) ?>%"></div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
<tr class="mark memory">
|
||||
<?php foreach ($group_cols as $key): ?>
|
||||
<td class="<?php echo $key ?>">
|
||||
<div>
|
||||
<div class="value"><?php echo number_format($stats[$key]['memory'] / 1024, 4) ?> <abbr title="kilobyte">kB</abbr></div>
|
||||
<?php if ($key === 'total'): ?>
|
||||
<div class="graph" style="left: <?php echo max(0, 100 - $stats[$key]['memory'] / $group_stats[$group]['max']['memory'] * 100) ?>%"></div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
<?php endforeach ?>
|
||||
|
||||
<table class="profiler">
|
||||
<?php $stats = Profiler::application() ?>
|
||||
<tr class="final mark time">
|
||||
<th class="name" rowspan="2" scope="rowgroup"><?php echo __('Application Execution').' ('.$stats['count'].')' ?></th>
|
||||
<?php foreach ($application_cols as $key): ?>
|
||||
<td class="<?php echo $key ?>"><?php echo number_format($stats[$key]['time'], 6) ?> <abbr title="seconds">s</abbr></td>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
<tr class="final mark memory">
|
||||
<?php foreach ($application_cols as $key): ?>
|
||||
<td class="<?php echo $key ?>"><?php echo number_format($stats[$key]['memory'] / 1024, 4) ?> <abbr title="kilobyte">kB</abbr></td>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
27
includes/kohana/system/views/profiler/style.css
Normal file
27
includes/kohana/system/views/profiler/style.css
Normal file
@@ -0,0 +1,27 @@
|
||||
.kohana table.profiler { width: 99%; margin: 0 auto 1em; border-collapse: collapse; }
|
||||
.kohana table.profiler th,
|
||||
.kohana table.profiler td { padding: 0.2em 0.4em; background: #fff; border: solid 1px #999; border-width: 1px 0; text-align: left; font-weight: normal; font-size: 1em; color: #111; vertical-align: top; text-align: right; }
|
||||
.kohana table.profiler th.name { text-align: left; }
|
||||
.kohana table.profiler tr.group th { font-size: 1.4em; background: #222; color: #eee; border-color: #222; }
|
||||
.kohana table.profiler tr.group td { background: #222; color: #777; border-color: #222; }
|
||||
.kohana table.profiler tr.group td.time { padding-bottom: 0; }
|
||||
.kohana table.profiler tr.headers th { text-transform: lowercase; font-variant: small-caps; background: #ddd; color: #777; }
|
||||
.kohana table.profiler tr.mark th.name { width: 40%; font-size: 1.2em; background: #fff; vertical-align: middle; }
|
||||
.kohana table.profiler tr.mark td { padding: 0; }
|
||||
.kohana table.profiler tr.mark.final td { padding: 0.2em 0.4em; }
|
||||
.kohana table.profiler tr.mark td > div { position: relative; padding: 0.2em 0.4em; }
|
||||
.kohana table.profiler tr.mark td div.value { position: relative; z-index: 2; }
|
||||
.kohana table.profiler tr.mark td div.graph { position: absolute; top: 0; bottom: 0; right: 0; left: 100%; background: #71bdf0; z-index: 1; }
|
||||
.kohana table.profiler tr.mark.memory td div.graph { background: #acd4f0; }
|
||||
.kohana table.profiler tr.mark td.current { background: #eddecc; }
|
||||
.kohana table.profiler tr.mark td.min { background: #d2f1cb; }
|
||||
.kohana table.profiler tr.mark td.max { background: #ead3cb; }
|
||||
.kohana table.profiler tr.mark td.average { background: #ddd; }
|
||||
.kohana table.profiler tr.mark td.total { background: #d0e3f0; }
|
||||
.kohana table.profiler tr.time td { border-bottom: 0; font-weight: bold; }
|
||||
.kohana table.profiler tr.memory td { border-top: 0; }
|
||||
.kohana table.profiler tr.final th.name { background: #222; color: #fff; }
|
||||
.kohana table.profiler abbr { border: 0; color: #777; font-weight: normal; }
|
||||
.kohana table.profiler:hover tr.group td { color: #ccc; }
|
||||
.kohana table.profiler:hover tr.mark td div.graph { background: #1197f0; }
|
||||
.kohana table.profiler:hover tr.mark.memory td div.graph { background: #7cc1f0; }
|
Reference in New Issue
Block a user