From ac286daf38c69e4248f71d3decdfdac123b6b549 Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 19 Jun 2014 00:06:58 +0200 Subject: [PATCH 1/4] update git ignore file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index daf3eea..deb58b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ config.inc.php *.phar vendor +*.idea From 1796fe05d65e183836949dff5a2e53100b487716 Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 23 Jun 2014 23:25:56 +0200 Subject: [PATCH 2/4] Return relative file URL with actual timestamp (last mod) --- includes/functions.inc.php | 12 ++++++++++++ includes/header.inc.php | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/includes/functions.inc.php b/includes/functions.inc.php index 3f49f4b..5e10ded 100644 --- a/includes/functions.inc.php +++ b/includes/functions.inc.php @@ -64,3 +64,15 @@ function str_rand($length) { return $r; } +/** + * Return relative file URL with actual timestamp (last mod) + * + * @author Fabian Lenczewski + * @since 2014-06-23 + * + * @param $name + * @return string + */ +function loadStaticFile($name) { + return file_exists($name) ? $name .'?rev='. filemtime($name) : $name; +} \ No newline at end of file diff --git a/includes/header.inc.php b/includes/header.inc.php index 368da14..1c48db9 100644 --- a/includes/header.inc.php +++ b/includes/header.inc.php @@ -3,6 +3,7 @@ header('Content-Type: text/html; charset=utf-8'); header('Cache-Control: private'); + ?> @@ -24,13 +25,13 @@ <?php echo format_html($server['host'])?> - phpRedisAdmin - + - + From d9eae2937e9f265773073dab8af19e49ccb46a23 Mon Sep 17 00:00:00 2001 From: Fabian Date: Tue, 24 Jun 2014 23:21:32 +0200 Subject: [PATCH 3/4] eg. for 500k key it will be 500k requests less :) (in faster mode) --- index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 5f1be31..9feaad2 100644 --- a/index.php +++ b/index.php @@ -49,7 +49,6 @@ function print_namespace($item, $name, $fullkey, $islast) { // Unset it so we won't loop over it when printing this namespace. unset($item['__phpredisadmin__']); - $type = $redis->type($fullkey); $class = array(); $len = false; @@ -62,6 +61,8 @@ function print_namespace($item, $name, $fullkey, $islast) { // Get the number of items in the key. if (!isset($config['faster']) || !$config['faster']) { + + $type = $redis->type($fullkey); switch ($type) { case 'hash': $len = $redis->hLen($fullkey); From 7890e590818fbc142a9edc29d81bd7cf9a3e10ab Mon Sep 17 00:00:00 2001 From: Erik Dubbelboer Date: Thu, 26 Jun 2014 18:07:04 +0000 Subject: [PATCH 4/4] Fixed the idea of #49 --- composer.json | 2 +- includes/header.inc.php | 7 ++++--- index.php | 4 +--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 24fb027..fd6edaf 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "erik-dubbelboer/php-redis-admin", "description": "Simple web interface to manage Redis databases.", - "version": "1.1.0", + "version": "1.1.1", "license": "CC-BY-ND", "homepage": "https://github.com/ErikDubbelboer/phpRedisAdmin", "authors": [ diff --git a/includes/header.inc.php b/includes/header.inc.php index 1c48db9..aa618f1 100644 --- a/includes/header.inc.php +++ b/includes/header.inc.php @@ -1,9 +1,10 @@ @@ -25,13 +26,13 @@ <?php echo format_html($server['host'])?> - phpRedisAdmin - + - + diff --git a/index.php b/index.php index 9feaad2..d142f99 100644 --- a/index.php +++ b/index.php @@ -61,9 +61,7 @@ function print_namespace($item, $name, $fullkey, $islast) { // Get the number of items in the key. if (!isset($config['faster']) || !$config['faster']) { - - $type = $redis->type($fullkey); - switch ($type) { + switch ($redis->type($fullkey)) { case 'hash': $len = $redis->hLen($fullkey); break;