Skip to content

Commit

Permalink
replace print with echo (small bit faster)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed Jul 22, 2011
1 parent 6fc1531 commit f705e67
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 80 deletions.
6 changes: 3 additions & 3 deletions config.inc.php
Expand Up @@ -3,12 +3,12 @@
$config = array(
'servers' => array(
array(
'name' => 'localhost', // Optional name.
'name' => 'local server', // Optional name.
'host' => '127.0.0.1',
'port' => 6379,

// Optional authentication.
//'auth' => 'redispasswordhere' // Warning: The password is send in plain-text to the redis server.
//'auth' => 'redispasswordhere' // Warning: The password is sent in plain-text to the redis server.
),

/*array(
Expand Down Expand Up @@ -40,4 +40,4 @@
'maxkeylen' => 100
);

?>
?>
4 changes: 2 additions & 2 deletions delete.php
Expand Up @@ -47,12 +47,12 @@

?>
<script>
top.location.href = top.location.pathname+'?view&s=<?php print $server['id']?>&key=<?php print urlencode($_GET['key'])?>';
top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&key=<?php echo urlencode($_GET['key'])?>';
</script>
<?php

require 'footer.inc.php';
die;
}

?>
?>
34 changes: 17 additions & 17 deletions edit.php
Expand Up @@ -68,7 +68,7 @@

?>
<script>
top.location.href = top.location.pathname+'?view&s=<?php print $server['id']?>&key=<?php print urlencode($_POST['key'])?>';
top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&key=<?php echo urlencode($_POST['key'])?>';
</script>
<?php

Expand Down Expand Up @@ -129,54 +129,54 @@
require 'header.inc.php';

?>
<h2><?php print $edit ? 'Edit' : 'Add'?></h2>
<form action="<?php print format_html($_SERVER['REQUEST_URI'])?>" method="post">
<h2><?php echo $edit ? 'Edit' : 'Add'?></h2>
<form action="<?php echo format_html($_SERVER['REQUEST_URI'])?>" method="post">

<p>
<label for="type">Type:</label>
<select name="type" id="type">
<option value="string" <?php print (isset($_GET['type']) && ($_GET['type'] == 'string')) ? 'selected="selected"' : ''?>>String</option>
<option value="hash" <?php print (isset($_GET['type']) && ($_GET['type'] == 'hash' )) ? 'selected="selected"' : ''?>>Hash</option>
<option value="list" <?php print (isset($_GET['type']) && ($_GET['type'] == 'list' )) ? 'selected="selected"' : ''?>>List</option>
<option value="set" <?php print (isset($_GET['type']) && ($_GET['type'] == 'set' )) ? 'selected="selected"' : ''?>>Set</option>
<option value="zset" <?php print (isset($_GET['type']) && ($_GET['type'] == 'zset' )) ? 'selected="selected"' : ''?>>ZSet</option>
<option value="string" <?php echo (isset($_GET['type']) && ($_GET['type'] == 'string')) ? 'selected="selected"' : ''?>>String</option>
<option value="hash" <?php echo (isset($_GET['type']) && ($_GET['type'] == 'hash' )) ? 'selected="selected"' : ''?>>Hash</option>
<option value="list" <?php echo (isset($_GET['type']) && ($_GET['type'] == 'list' )) ? 'selected="selected"' : ''?>>List</option>
<option value="set" <?php echo (isset($_GET['type']) && ($_GET['type'] == 'set' )) ? 'selected="selected"' : ''?>>Set</option>
<option value="zset" <?php echo (isset($_GET['type']) && ($_GET['type'] == 'zset' )) ? 'selected="selected"' : ''?>>ZSet</option>
</select>
</p>

<p>
<label for="key">Key:</label>
<input type="text" name="key" id="key" size="30" maxlength="30" <?php print isset($_GET['key']) ? 'value="'.format_html($_GET['key']).'"' : ''?>>
<input type="text" name="key" id="key" size="30" maxlength="30" <?php echo isset($_GET['key']) ? 'value="'.format_html($_GET['key']).'"' : ''?>>
</p>

<p id="hkeyp">
<label for="khey">Hash key:</label>
<input type="text" name="hkey" id="hkey" size="30" maxlength="30" <?php print isset($_GET['hkey']) ? 'value="'.format_html($_GET['hkey']).'"' : ''?>>
<input type="text" name="hkey" id="hkey" size="30" maxlength="30" <?php echo isset($_GET['hkey']) ? 'value="'.format_html($_GET['hkey']).'"' : ''?>>
</p>

<p id="indexp">
<label for="index">Index:</label>
<input type="text" name="index" id="index" size="30" <?php print isset($_GET['index']) ? 'value="'.format_html($_GET['index']).'"' : ''?>> <span class="info">empty to append, -1 to prepend</span>
<input type="text" name="index" id="index" size="30" <?php echo isset($_GET['index']) ? 'value="'.format_html($_GET['index']).'"' : ''?>> <span class="info">empty to append, -1 to prepend</span>
</p>

<p id="scorep">
<label for="score">Score:</label>
<input type="text" name="score" id="score" size="30" <?php print isset($_GET['score']) ? 'value="'.format_html($_GET['score']).'"' : ''?>>
<input type="text" name="score" id="score" size="30" <?php echo isset($_GET['score']) ? 'value="'.format_html($_GET['score']).'"' : ''?>>
</p>

<p>
<label>Value:</label>
<textarea name="value" cols="80" rows="20"><?php print nl2br(format_html($value))?></textarea>
<label for="value">Value:</label>
<textarea name="value" id="value" cols="80" rows="20"><?php echo nl2br(format_html($value))?></textarea>
</p>

<input type="hidden" name="oldvalue" value="<?php print format_html($value)?>">
<input type="hidden" name="oldvalue" value="<?php echo format_html($value)?>">

<p>
<input type="submit" class="button" value="<?php print $edit ? 'Edit' : 'Add'?>">
<input type="submit" class="button" value="<?php echo $edit ? 'Edit' : 'Add'?>">
</p>

</form>
<?php

require 'footer.inc.php';

?>
?>
12 changes: 6 additions & 6 deletions export.php
Expand Up @@ -37,7 +37,7 @@ function export_redis($key) {
$size = $redis->lSize($key);

for ($i = 0; $i < $size; ++$i) {
echo 'LPUSH "',addslashes($key),'" "',addslashes($redis->lGet($key, $i)),'"',PHP_EOL;
echo 'RPUSH "',addslashes($key),'" "',addslashes($redis->lGet($key, $i)),'"',PHP_EOL;
}
}

Expand Down Expand Up @@ -173,15 +173,15 @@ function export_json($key) {
require 'header.inc.php';

?>
<h2>Export <?php print isset($_GET['key']) ? format_html($_GET['key']) : ''?></h2>
<h2>Export <?php echo isset($_GET['key']) ? format_html($_GET['key']) : ''?></h2>

<form action="<?php print format_html($_SERVER['REQUEST_URI'])?>" method="post">
<form action="<?php echo format_html($_SERVER['REQUEST_URI'])?>" method="post">

<p>
<label for="type">Type:</label>
<select name="type" id="type">
<option value="redis" <?php print (isset($_GET['type']) && ($_GET['type'] == 'redis')) ? 'selected="selected"' : ''?>>Redis</option>
<option value="json" <?php print (isset($_GET['type']) && ($_GET['type'] == 'json' )) ? 'selected="selected"' : ''?>>JSON</option>
<option value="redis" <?php echo (isset($_GET['type']) && ($_GET['type'] == 'redis')) ? 'selected="selected"' : ''?>>Redis</option>
<option value="json" <?php echo (isset($_GET['type']) && ($_GET['type'] == 'json' )) ? 'selected="selected"' : ''?>>JSON</option>
</select>
</p>

Expand All @@ -194,4 +194,4 @@ function export_json($key) {

require 'footer.inc.php';

?>
?>
6 changes: 3 additions & 3 deletions header.inc.php
Expand Up @@ -18,18 +18,18 @@
<?php /* I don't think we ever want this to be indexed*/ ?>
<meta name=robots content="noindex,nofollow,noarchive">

<title><?php print format_html($server['host'])?> - phpRedisAdmin</title>
<title><?php echo format_html($server['host'])?> - phpRedisAdmin</title>

<?php foreach ($page['css'] as $css) { ?>
<link rel=stylesheet href="css/<?php print $css; ?>.css?v1" media=all>
<link rel=stylesheet href="css/<?php echo $css; ?>.css?v1" media=all>
<?php } ?>

<link rel="shortcut icon" href="favicon.ico">

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>

<?php foreach ($page['js'] as $js) { ?>
<script src="js/<?php print $js; ?>.js?v1"></script>
<script src="js/<?php echo $js; ?>.js?v1"></script>
<?php } ?>

</head>
Expand Down
20 changes: 10 additions & 10 deletions index.php
Expand Up @@ -110,13 +110,13 @@ function print_namespace($item, $name, $fullkey, $islast) {


?>
<li<?php print empty($class) ? '' : ' class="'.implode(' ', $class).'"'?>>
<a href="?view&amp;s=<?php print $server['id']?>&amp;key=<?php print urlencode($fullkey)?>"><?php print format_html($name)?><?php if ($len !== false) { ?><span class="info">(<?php print $len?>)</span><?php } ?></a>
<li<?php echo empty($class) ? '' : ' class="'.implode(' ', $class).'"'?>>
<a href="?view&amp;s=<?php echo $server['id']?>&amp;key=<?php echo urlencode($fullkey)?>"><?php echo format_html($name)?><?php if ($len !== false) { ?><span class="info">(<?php echo $len?>)</span><?php } ?></a>
</li>
<?php
} else { // It's a namespace, recursively call this function on all it's members.
?>
<li class="folder<?php print empty($fullkey) ? '' : ' collapsed'?><?php print $islast ? ' last' : ''?>"><div class="icon"><?php print format_html($name)?> <span class="info">(<?php print count($item)?>)</span></div>
<li class="folder<?php echo empty($fullkey) ? '' : ' collapsed'?><?php echo $islast ? ' last' : ''?>"><div class="icon"><?php echo format_html($name)?> <span class="info">(<?php echo count($item)?>)</span></div>
<ul>
<?php

Expand Down Expand Up @@ -151,23 +151,23 @@ function print_namespace($item, $name, $fullkey, $islast) {
?>
<div id="sidebar">

<h1 class="logo"><a href="?overview&amp;s=<?php print $server['id']?>">phpRedisAdmin</a></h1>
<h1 class="logo"><a href="?overview&amp;s=<?php echo $server['id']?>">phpRedisAdmin</a></h1>

<p>
<select id="server">
<?php foreach ($config['servers'] as $i => $srv) { ?>
<option value="<?php print $i?>" <?php print ($server['id'] == $i) ? 'selected="selected"' : ''?>><?php print isset($srv['name']) ? format_html($srv['name']) : $srv['host'].':'.$srv['port']?></option>
<option value="<?php echo $i?>" <?php echo ($server['id'] == $i) ? 'selected="selected"' : ''?>><?php echo isset($srv['name']) ? format_html($srv['name']) : $srv['host'].':'.$srv['port']?></option>
<?php } ?>
</select>
</p>

<p>
<a href="?info&amp;s=<?php print $server['id']?>"><img src="images/info.png" width="16" height="16" title="Info" alt="[I]"></a>
<a href="?export&amp;s=<?php print $server['id']?>"><img src="images/export.png" width="16" height="16" title="Export" alt="[E]"></a>
<a href="?info&amp;s=<?php echo $server['id']?>"><img src="images/info.png" width="16" height="16" title="Info" alt="[I]"></a>
<a href="?export&amp;s=<?php echo $server['id']?>"><img src="images/export.png" width="16" height="16" title="Export" alt="[E]"></a>
</p>

<p>
<a href="?edit&amp;s=<?php print $server['id']?>" class="add">Add another key</a>
<a href="?edit&amp;s=<?php echo $server['id']?>" class="add">Add another key</a>
</p>

<div id="keys">
Expand All @@ -177,12 +177,12 @@ function print_namespace($item, $name, $fullkey, $islast) {
</div><!-- #keys -->

<div id="frame">
<iframe src="<?php print format_html($iframe)?>" id="iframe" frameborder="0" scrolling="0"></iframe>
<iframe src="<?php echo format_html($iframe)?>" id="iframe" frameborder="0" scrolling="0"></iframe>
</div><!-- #frame -->

</div><!-- #sidebar -->
<?php

require 'footer.inc.php';

?>
?>
6 changes: 3 additions & 3 deletions info.php
Expand Up @@ -31,7 +31,7 @@

<?php if (method_exists($redis, 'resetStat')) { ?>
<p>
<a href="?reset&amp;s=<?php print $server['id']?>" class="reset">Reset usage statistics</a>
<a href="?reset&amp;s=<?php echo $server['id']?>" class="reset">Reset usage statistics</a>
</p>
<?php } ?>

Expand All @@ -45,7 +45,7 @@
}

?>
<tr <?php print $alt ? 'class="alt"' : ''?>><td><div><?php print format_html($key)?></div></td><td><div><?php print nl2br(format_html($value))?></div></td></tr>
<tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo format_html($key)?></div></td><td><div><?php echo nl2br(format_html($value))?></div></td></tr>
<?php

$alt = !$alt;
Expand All @@ -57,4 +57,4 @@

require 'footer.inc.php';

?>
?>
4 changes: 2 additions & 2 deletions overview.php
Expand Up @@ -40,7 +40,7 @@

<?php foreach ($config['servers'] as $i => $server) { ?>
<div class="server">
<h2><?php print isset($server['name']) ? $server['name'] : format_html($server['host'])?></h2>
<h2><?php echo isset($server['name']) ? $server['name'] : format_html($server['host'])?></h2>

<table>

Expand Down Expand Up @@ -69,4 +69,4 @@

require 'footer.inc.php';

?>
?>
12 changes: 6 additions & 6 deletions rename.php
Expand Up @@ -18,7 +18,7 @@

?>
<script>
top.location.href = top.location.pathname+'?view&s=<?php print $server['id']?>&key=<?php print urlencode($_POST['key'])?>';
top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&key=<?php echo urlencode($_POST['key'])?>';
</script>
<?php

Expand All @@ -34,14 +34,14 @@
require 'header.inc.php';

?>
<h2>Edit Name of <?php print format_html($_GET['key'])?></h2>
<form action="<?php print format_html($_SERVER['REQUEST_URI'])?>" method="post">
<h2>Edit Name of <?php echo format_html($_GET['key'])?></h2>
<form action="<?php echo format_html($_SERVER['REQUEST_URI'])?>" method="post">

<input type="hidden" name="old" value="<?php print format_html($_GET['key'])?>">
<input type="hidden" name="old" value="<?php echo format_html($_GET['key'])?>">

<p>
<label for="key">Key:</label>
<input type="text" name="key" id="key" size="30" <?php print isset($_GET['key']) ? 'value="'.format_html($_GET['key']).'"' : ''?>>
<input type="text" name="key" id="key" size="30" <?php echo isset($_GET['key']) ? 'value="'.format_html($_GET['key']).'"' : ''?>>
</p>

<p>
Expand All @@ -53,4 +53,4 @@

require 'footer.inc.php';

?>
?>
8 changes: 4 additions & 4 deletions ttl.php
Expand Up @@ -26,16 +26,16 @@

?>
<h2>Edit TTL</h2>
<form action="<?php print format_html($_SERVER['REQUEST_URI'])?>" method="post">
<form action="<?php echo format_html($_SERVER['REQUEST_URI'])?>" method="post">

<p>
<label for="key">Key:</label>
<input type="text" name="key" id="key" size="30" <?php print isset($_GET['key']) ? 'value="'.format_html($_GET['key']).'"' : ''?>>
<input type="text" name="key" id="key" size="30" <?php echo isset($_GET['key']) ? 'value="'.format_html($_GET['key']).'"' : ''?>>
</p>

<p>
<label for="ttl"><abbr title="Time To Live">TTL</abbr>:</label>
<input type="text" name="ttl" id="ttl" size="30" <?php print isset($_GET['ttl']) ? 'value="'.format_html($_GET['ttl']).'"' : ''?>> <span class="info">(-1 to remove the TTL)</span>
<input type="text" name="ttl" id="ttl" size="30" <?php echo isset($_GET['ttl']) ? 'value="'.format_html($_GET['ttl']).'"' : ''?>> <span class="info">(-1 to remove the TTL)</span>
</p>

<p>
Expand All @@ -47,4 +47,4 @@

require 'footer.inc.php';

?>
?>

0 comments on commit f705e67

Please sign in to comment.