Skip to content

Commit

Permalink
Updated predis to 0.8, fixed bug with numeric namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed Jun 27, 2013
1 parent cf6d88c commit 661bb4a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,17 @@ function print_namespace($item, $name, $fullkey, $islast) {
// Does this namespace also contain subkeys?
if (count($item) > 0) {
?>
<li class="folder<?php echo empty($fullkey) ? '' : ' collapsed'?><?php echo $islast ? ' last' : ''?>">
<li class="folder<?php echo ($fullkey === '') ? '' : ' collapsed'?><?php echo $islast ? ' last' : ''?>">
<div class="icon"><?php echo format_html($name)?>&nbsp;<span class="info">(<?php echo count($item)?>)</span>
<?php if (!empty($fullkey)) { ?><a href="delete.php?s=<?php echo $server['id']?>&amp;tree=<?php echo urlencode($fullkey)?>:" class="deltree"><img src="images/delete.png" width="10" height="10" title="Delete tree" alt="[X]"></a><?php } ?>
<?php if ($fullkey !== '') { ?><a href="delete.php?s=<?php echo $server['id']?>&amp;tree=<?php echo urlencode($fullkey)?>:" class="deltree"><img src="images/delete.png" width="10" height="10" title="Delete tree" alt="[X]"></a><?php } ?>
</div><ul>
<?php

$l = count($item);

foreach ($item as $childname => $childitem) {
// $fullkey will be empty on the first call.
if (empty($fullkey)) {
if ($fullkey === '') {
$childfullkey = $childname;
} else {
$childfullkey = $fullkey.$config['seperator'].$childname;
Expand Down
20 changes: 4 additions & 16 deletions overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@

$info[$i] = $redis->info();
$info[$i]['size'] = $redis->dbSize();

if (!isset($info[$i]['redis_version']) && isset($info[$i]['Server']['redis_version'])) {
$info[$i]['redis_version'] = $info[$i]['Server']['redis_version'];
}

if ((floatval($info[$i]['redis_version']) < 2.6) && isset($info[$i]['last_save_time'])) {
$info[$i]['rdb_last_save_time'] = $info[$i]['last_save_time'];
}

if (!isset($info[$i]['used_memory']) && isset($info[$i]['Memory']['used_memory'])) {
$info[$i]['used_memory'] = $info[$i]['Memory']['used_memory'];
}
}


Expand All @@ -62,15 +50,15 @@

<table>

<tr><td><div>Redis version:</div></td><td><div><?php echo $info[$i]['redis_version']?></div></td></tr>
<tr><td><div>Redis version:</div></td><td><div><?php echo $info[$i]['Server']['redis_version']?></div></td></tr>

<tr><td><div>Keys:</div></td><td><div><?php echo $info[$i]['size']?></div></td></tr>

<tr><td><div>Memory used:</div></td><td><div><?php echo format_size($info[$i]['used_memory'])?></div></td></tr>
<tr><td><div>Memory used:</div></td><td><div><?php echo format_size($info[$i]['Memory']['used_memory'])?></div></td></tr>

<tr><td><div>Uptime:</div></td><td><div><?php echo format_ago($info[$i]['uptime_in_seconds'])?></div></td></tr>
<tr><td><div>Uptime:</div></td><td><div><?php echo format_ago($info[$i]['Server']['uptime_in_seconds'])?></div></td></tr>

<tr><td><div>Last save:</div></td><td><div><?php if (isset($info[$i]['rdb_last_save_time'])) { echo format_ago(time() - $info[$i]['rdb_last_save_time'], true); } else { echo 'never'; } ?> <a href="save.php?s=<?php echo $i?>"><img src="images/save.png" width="16" height="16" title="Save Now" alt="[S]" class="imgbut"></a></div></td></tr>
<tr><td><div>Last save:</div></td><td><div><?php if (isset($info[$i]['Persistence']['rdb_last_save_time'])) { echo format_ago(time() - $info[$i]['Persistence']['rdb_last_save_time'], true); } else { echo 'never'; } ?> <a href="save.php?s=<?php echo $i?>"><img src="images/save.png" width="16" height="16" title="Save Now" alt="[S]" class="imgbut"></a></div></td></tr>

</table>
</div>
Expand Down
2 changes: 1 addition & 1 deletion predis
Submodule predis updated from 585957 to 4576dc

0 comments on commit 661bb4a

Please sign in to comment.