Skip to content

Commit

Permalink
move all include files to subfolder /includes
Browse files Browse the repository at this point in the history
  • Loading branch information
d1rk committed Nov 22, 2012
1 parent c117ebe commit bfc7d91
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions delete.php
Expand Up @@ -6,7 +6,7 @@
}


require_once 'common.inc.php';
require_once 'includes/common.inc.php';


if (isset($_GET['key'])) {
Expand Down Expand Up @@ -56,7 +56,7 @@
foreach ($keys as $key) {
$redis->del($key);
}

die('?&s='.$server['id']);
}

Expand Down
10 changes: 5 additions & 5 deletions edit.php
@@ -1,6 +1,6 @@
<?php

require_once 'common.inc.php';
require_once 'includes/common.inc.php';



Expand Down Expand Up @@ -84,15 +84,15 @@


// Refresh the top so the key tree is updated.
require 'header.inc.php';
require 'includes/header.inc.php';

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

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

Expand Down Expand Up @@ -130,7 +130,7 @@
$page['css'][] = 'frame';
$page['js'][] = 'frame';

require 'header.inc.php';
require 'includes/header.inc.php';

?>
<h2><?php echo $edit ? 'Edit' : 'Add'?></h2>
Expand Down Expand Up @@ -181,6 +181,6 @@
</form>
<?php

require 'footer.inc.php';
require 'includes/footer.inc.php';

?>
14 changes: 7 additions & 7 deletions export.php
@@ -1,13 +1,13 @@
<?php

require_once 'common.inc.php';
require_once 'includes/common.inc.php';




// Export to redis-cli commands
function export_redis($key) {
global $redis;
global $redis;

$type = $redis->type($key);

Expand Down Expand Up @@ -115,9 +115,9 @@ function export_json($key) {

header('Content-type: '.$ct.'; charset=utf-8');
header('Content-Disposition: inline; filename="export.'.$ext.'"');
// JSON


// JSON
if ($_POST['type'] == 'json') {
// Single key
if (isset($_GET['key'])) {
Expand Down Expand Up @@ -158,7 +158,7 @@ function export_json($key) {
$page['css'][] = 'frame';
$page['js'][] = 'frame';

require 'header.inc.php';
require 'includes/header.inc.php';

?>
<h2>Export <?php echo isset($_GET['key']) ? format_html($_GET['key']) : ''?></h2>
Expand All @@ -180,6 +180,6 @@ function export_json($key) {
</form>
<?php

require 'footer.inc.php';
require 'includes/footer.inc.php';

?>
12 changes: 6 additions & 6 deletions import.php
@@ -1,6 +1,6 @@
<?php

require_once 'common.inc.php';
require_once 'includes/common.inc.php';



Expand Down Expand Up @@ -34,7 +34,7 @@
$i += 3;
break;
}

case 'LPUSH': {
$redis->lPush($commands[$i+1], $commands[$i+2]);
$i += 2;
Expand Down Expand Up @@ -69,15 +69,15 @@


// Refresh the top so the key tree is updated.
require 'header.inc.php';
require 'includes/header.inc.php';

?>
<script>
top.location.href = top.location.pathname+'?overview&s=<?php echo $server['id']?>';
</script>
<?php

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

Expand All @@ -87,7 +87,7 @@
$page['css'][] = 'frame';
$page['js'][] = 'frame';

require 'header.inc.php';
require 'includes/header.inc.php';

?>
<h2>Import</h2>
Expand Down Expand Up @@ -117,6 +117,6 @@
</form>
<?php

require 'footer.inc.php';
require 'includes/footer.inc.php';

?>
16 changes: 8 additions & 8 deletions common.inc.php → includes/common.inc.php
@@ -1,10 +1,10 @@
<?php

<?php
define('PHPREDIS_ADMIN_PATH', dirname(__DIR__));

// Undo magic quotes (both in keys and values)
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST);

while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
Expand All @@ -25,14 +25,14 @@


// These includes are needed by each script.
require_once 'config.inc.php';
require_once 'functions.inc.php';
require_once 'page.inc.php';
require_once 'predis/autoload.php';
require_once PHPREDIS_ADMIN_PATH . '/includes/config.inc.php';
require_once PHPREDIS_ADMIN_PATH . '/includes/functions.inc.php';
require_once PHPREDIS_ADMIN_PATH . '/includes/page.inc.php';
require_once PHPREDIS_ADMIN_PATH . '/predis/autoload.php';


if (isset($config['login'])) {
require_once 'login.inc.php';
require_once PHPREDIS_ADMIN_PATH . '/includes/login.inc.php';
}


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions index.php
@@ -1,6 +1,6 @@
<?php

require_once 'common.inc.php';
require_once 'includes/common.inc.php';



Expand Down Expand Up @@ -113,7 +113,7 @@ function print_namespace($item, $name, $fullkey, $islast) {
</li>
<?php
}

// Does this namespace also contain subkeys?
if (count($item) > 0) {
?>
Expand Down Expand Up @@ -149,7 +149,7 @@ function print_namespace($item, $name, $fullkey, $islast) {
$page['css'][] = 'index';
$page['js'][] = 'index';

require 'header.inc.php';
require 'includes/header.inc.php';

?>
<div id="sidebar">
Expand Down Expand Up @@ -194,6 +194,6 @@ function print_namespace($item, $name, $fullkey, $islast) {
</div><!-- #sidebar -->
<?php

require 'footer.inc.php';
require 'includes/footer.inc.php';

?>
6 changes: 3 additions & 3 deletions info.php
@@ -1,6 +1,6 @@
<?php

require_once 'common.inc.php';
require_once 'includes/common.inc.php';



Expand All @@ -24,7 +24,7 @@
$page['css'][] = 'frame';
$page['js'][] = 'frame';

require 'header.inc.php';
require 'includes/header.inc.php';

?>
<h2>Info</h2>
Expand Down Expand Up @@ -55,6 +55,6 @@
</table>
<?php

require 'footer.inc.php';
require 'includes/footer.inc.php';

?>
2 changes: 1 addition & 1 deletion logout.php
Expand Up @@ -31,7 +31,7 @@
if ($data['nonce'] == $_GET['nonce']) {
unset($_SERVER['PHP_AUTH_DIGEST']);

require 'login.inc.php';
require 'includes/login.inc.php';
}


Expand Down
10 changes: 5 additions & 5 deletions overview.php
@@ -1,6 +1,6 @@
<?php

require_once 'common.inc.php';
require_once 'includes/common.inc.php';



Expand Down Expand Up @@ -32,10 +32,10 @@

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

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


Expand All @@ -44,7 +44,7 @@
$page['css'][] = 'frame';
$page['js'][] = 'frame';

require 'header.inc.php';
require 'includes/header.inc.php';

?>

Expand Down Expand Up @@ -77,6 +77,6 @@
</p>
<?php

require 'footer.inc.php';
require 'includes/footer.inc.php';

?>
10 changes: 5 additions & 5 deletions rename.php
@@ -1,6 +1,6 @@
<?php

require_once 'common.inc.php';
require_once 'includes/common.inc.php';



Expand All @@ -14,15 +14,15 @@


// Refresh the top so the key tree is updated.
require 'header.inc.php';
require 'includes/header.inc.php';

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

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

Expand All @@ -31,7 +31,7 @@
$page['css'][] = 'frame';
$page['js'][] = 'frame';

require 'header.inc.php';
require 'includes/header.inc.php';

?>
<h2>Edit Name of <?php echo format_html($_GET['key'])?></h2>
Expand All @@ -51,6 +51,6 @@
</form>
<?php

require 'footer.inc.php';
require 'includes/footer.inc.php';

?>
6 changes: 3 additions & 3 deletions save.php
@@ -1,14 +1,14 @@
<?php

require_once 'common.inc.php';
require_once 'includes/common.inc.php';




$page['css'][] = 'frame';
$page['js'][] = 'frame';

require 'header.inc.php';
require 'includes/header.inc.php';

?>
<h2>Saving</h2>
Expand All @@ -25,6 +25,6 @@
done.
<?php

require 'footer.inc.php';
require 'includes/footer.inc.php';

?>
6 changes: 3 additions & 3 deletions ttl.php
@@ -1,6 +1,6 @@
<?php

require_once 'common.inc.php';
require_once 'includes/common.inc.php';



Expand All @@ -22,7 +22,7 @@
$page['css'][] = 'frame';
$page['js'][] = 'frame';

require 'header.inc.php';
require 'includes/header.inc.php';

?>
<h2>Edit TTL</h2>
Expand All @@ -45,6 +45,6 @@
</form>
<?php

require 'footer.inc.php';
require 'includes/footer.inc.php';

?>

0 comments on commit bfc7d91

Please sign in to comment.