fix for new 3.1 features

This commit is contained in:
biakaveron 2011-02-19 00:28:18 +03:00
parent fc24a6154b
commit 43a81fee02
2 changed files with 13 additions and 13 deletions

View File

@ -87,7 +87,7 @@ class DebugToolbar
$template->set('benchmarks', self::get_benchmarks());
}
if ($output = Request::instance()->response and self::is_enabled())
if ($output = Request::initial()->response()->body() and self::is_enabled())
{
// Try to add css just before the </head> tag
if (stripos($output, '</head>') !== FALSE)
@ -111,7 +111,7 @@ class DebugToolbar
$output .= $template->render();
}
Request::instance()->response = $output;
Request::initial()->response()->body($output);
}
else
{
@ -146,7 +146,7 @@ class DebugToolbar
{
if (is_array($data) OR is_object($data))
{
$data = Kohana::dump($data);
$data = Debug::dump($data);
}
$result[$tab] = $data;
@ -385,7 +385,7 @@ class DebugToolbar
public static function is_enabled()
{
// Don't auto render toolbar for ajax requests
if (Request::$is_ajax)
if (Request::initial()->is_ajax())
return FALSE;
// Don't auto render toolbar if $_GET['debug'] = 'false'
@ -401,9 +401,9 @@ class DebugToolbar
if ($secret_key !== FALSE and isset($_GET[$secret_key]))
return TRUE;
// Don't auto render when IN_PRODUCTION (this can obviously be
// Don't auto render when in PRODUCTION (this can obviously be
// overridden by the above secret key)
if (IN_PRODUCTION)
if (Kohana::$environment == Kohana::PRODUCTION)
return FALSE;
return TRUE;

View File

@ -216,22 +216,22 @@
<li onclick="debugToolbar.showvar(this, 'vars-session'); return false;">SESSION</li>
</ul>
<div style="display: none;" id="vars-post">
<?php echo isset($_POST) ? Kohana::debug($_POST) : Kohana::debug(array()) ?>
<?php echo isset($_POST) ? Debug::vars($_POST) : Debug::vars(array()) ?>
</div>
<div style="display: none;" id="vars-get">
<?php echo isset($_GET) ? Kohana::debug($_GET) : Kohana::debug(array()) ?>
<?php echo isset($_GET) ? Debug::vars($_GET) : Debug::vars(array()) ?>
</div>
<div style="display: none;" id="vars-files">
<?php echo isset($_FILES) ? Kohana::debug($_FILES) : Kohana::debug(array()) ?>
<?php echo isset($_FILES) ? Debug::vars($_FILES) : Debug::vars(array()) ?>
</div>
<div style="display: none;" id="vars-server">
<?php echo isset($_SERVER) ? Kohana::debug($_SERVER) : Kohana::debug(array()) ?>
<?php echo isset($_SERVER) ? Debug::vars($_SERVER) : Debug::vars(array()) ?>
</div>
<div style="display: none;" id="vars-cookie">
<?php echo isset($_COOKIE) ? Kohana::debug($_COOKIE) : Kohana::debug(array()) ?>
<?php echo isset($_COOKIE) ? Debug::vars($_COOKIE) : Debug::vars(array()) ?>
</div>
<div style="display: none;" id="vars-session">
<?php echo isset($_SESSION) ? Kohana::debug($_SESSION) : Kohana::debug(array()) ?>
<?php echo isset($_SESSION) ? Debug::vars($_SESSION) : Debug::vars(array()) ?>
</div>
</div>
<?php endif ?>
@ -323,7 +323,7 @@
<th>name</th>
</tr>
<?php foreach($routes as $name => $route):
$class = ($route == Request::instance()->route ? ' current' : ''); ?>
$class = ($route == Request::initial()->route() ? ' current' : ''); ?>
<tr class="<?php echo text::alternate('odd','even').$class?>">
<td><?php echo ++$r_counter ?></td>
<td><?php echo $name ?></td>