From 6300a6a0a24f4a7b063f264fdf356050960773a6 Mon Sep 17 00:00:00 2001 From: Steve Moretz Date: Sat, 16 Jul 2022 19:23:56 +0430 Subject: [PATCH 01/24] Update index.php (#83) * Update index.php * Update template.phps --- build/template.phps | 6 +++--- index.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/template.phps b/build/template.phps index 0ac1d3d..7a224c0 100644 --- a/build/template.phps +++ b/build/template.phps @@ -67,9 +67,9 @@ $opcache = (new Service($options))->handle(); OPcache statistics on <?= $opcache->getData('version', 'host'); ?> - - - + + + diff --git a/index.php b/index.php index b9d31bb..7052bee 100644 --- a/index.php +++ b/index.php @@ -469,9 +469,9 @@ $opcache = (new Service($options))->handle(); OPcache statistics on <?= $opcache->getData('version', 'host'); ?> - - - + + + @@ -1699,4 +1699,4 @@ function debounce(func, wait, immediate) { - \ No newline at end of file + From 19961a3447ec5d63f4194c3b3213f663ca750fbe Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 16 Jul 2022 16:19:55 +0100 Subject: [PATCH 02/24] Update version before I forget --- build/build.php | 2 +- build/template.phps | 2 +- composer.json | 1 + index.php | 11 ++++++----- package.json | 2 +- src/Opcache/Service.php | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build/build.php b/build/build.php index 8250b63..a990453 100644 --- a/build/build.php +++ b/build/build.php @@ -4,7 +4,7 @@ * OPcache GUI - build script * * @author Andrew Collington, andy@amnuts.com - * @version 3.3.1 + * @version 3.4.0 * @link https://github.com/amnuts/opcache-gui * @license MIT, https://acollington.mit-license.org/ */ diff --git a/build/template.phps b/build/template.phps index 7a224c0..4440269 100644 --- a/build/template.phps +++ b/build/template.phps @@ -8,7 +8,7 @@ namespace Amnuts\Opcache; * A simple but effective single-file GUI for the OPcache PHP extension. * * @author Andrew Collington, andy@amnuts.com - * @version 3.3.1 + * @version 3.4.0 * @link https://github.com/amnuts/opcache-gui * @license MIT, https://acollington.mit-license.org/ */ diff --git a/composer.json b/composer.json index d408acc..c4e2360 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,7 @@ "keywords": ["opcache", "cache", "gui", "opcodes", "interface"], "minimum-stability": "stable", "license": "MIT", + "version": "3.4.0", "authors": [ { "name": "Andrew Collington", diff --git a/index.php b/index.php index 7052bee..6703727 100644 --- a/index.php +++ b/index.php @@ -8,7 +8,7 @@ namespace Amnuts\Opcache; * A simple but effective single-file GUI for the OPcache PHP extension. * * @author Andrew Collington, andy@amnuts.com - * @version 3.3.1 + * @version 3.4.0 * @link https://github.com/amnuts/opcache-gui * @license MIT, https://acollington.mit-license.org/ */ @@ -62,7 +62,7 @@ use Exception; class Service { - public const VERSION = '3.3.1'; + public const VERSION = '3.4.0'; protected $data; protected $options; @@ -135,6 +135,7 @@ class Service /** * Service constructor. * @param array $options + * @throws Exception */ public function __construct(array $options = []) { @@ -354,7 +355,7 @@ class Service 'start_time' => (new DateTimeImmutable("@{$status['opcache_statistics']['start_time']}")) ->setTimezone(new DateTimeZone(date_default_timezone_get())) ->format('Y-m-d H:i:s'), - 'last_restart_time' => ($status['opcache_statistics']['last_restart_time'] == 0 + 'last_restart_time' => ($status['opcache_statistics']['last_restart_time'] === 0 ? 'never' : (new DateTimeImmutable("@{$status['opcache_statistics']['last_restart_time']}")) ->setTimezone(new DateTimeZone(date_default_timezone_get())) @@ -483,7 +484,7 @@ $opcache = (new Service($options))->handle(); - + \ No newline at end of file diff --git a/package.json b/package.json index c5e0c2c..8e7660e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "opcache-gui", "description": "A clean and responsive interface for Zend OPcache information, showing statistics, settings and cached files, and providing a real-time update for the information (using jQuery and React).", - "version": "3.3.0", + "version": "3.4.0", "main": "index.js", "devDependencies": { "@babel/cli": "^7.12.8", diff --git a/src/Opcache/Service.php b/src/Opcache/Service.php index 7040606..f521f4a 100644 --- a/src/Opcache/Service.php +++ b/src/Opcache/Service.php @@ -8,7 +8,7 @@ use Exception; class Service { - public const VERSION = '3.3.1'; + public const VERSION = '3.4.0'; protected $data; protected $options; From d87d89121d2e60fca1d365e3ae2e887b5d7810c7 Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 16 Jul 2022 16:21:09 +0100 Subject: [PATCH 03/24] Updated node-sass due to CVE-2020-24025 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8e7660e..a395a49 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "@babel/cli": "^7.12.8", "@babel/core": "^7.12.9", "@babel/preset-react": "^7.12.7", - "node-sass": "^4.14.1" + "node-sass": ">=7.0.0" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", From 17e8f6e708ce2e133cf2340ba44bb2fafe1b035c Mon Sep 17 00:00:00 2001 From: Andrew Collington Date: Sat, 16 Jul 2022 18:46:15 +0100 Subject: [PATCH 04/24] Date/time updates Added new config option to change the format of the date/time strings throughout the interface. Added `last modified` date/time output to the file cache list, and added the last modified as a sorting option (fixes PR#82). --- README.md | 42 ++++++++++++++----------- build/_frontend/interface.jsx | 2 ++ index.php | 58 ++++++++++++++++++++++------------- src/Opcache/Service.php | 57 +++++++++++++++++++++------------- 4 files changed, 97 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index cd59a91..1842ebe 100644 --- a/README.md +++ b/README.md @@ -73,24 +73,25 @@ The default configuration for the interface looks like this: ```php $options = [ - 'allow_filelist' => true, // show/hide the files tab - 'allow_invalidate' => true, // give a link to invalidate files - 'allow_reset' => true, // give option to reset the whole cache - 'allow_realtime' => true, // give option to enable/disable real-time updates - 'refresh_time' => 5, // how often the data will refresh, in seconds - 'size_precision' => 2, // Digits after decimal point - 'size_space' => false, // have '1MB' or '1 MB' when showing sizes - 'charts' => true, // show gauge chart or just big numbers - 'debounce_rate' => 250, // milliseconds after key press to send keyup event when filtering - 'per_page' => 200, // How many results per page to show in the file list, false for no pagination - 'cookie_name' => 'opcachegui', // name of cookie - 'cookie_ttl' => 365, // days to store cookie - 'highlight' => [ - 'memory' => true, // show the memory chart/big number - 'hits' => true, // show the hit rate chart/big number - 'keys' => true, // show the keys used chart/big number - 'jit' => true // show the jit buffer chart/big number - ] + 'allow_filelist' => true, // show/hide the files tab + 'allow_invalidate' => true, // give a link to invalidate files + 'allow_reset' => true, // give option to reset the whole cache + 'allow_realtime' => true, // give option to enable/disable real-time updates + 'refresh_time' => 5, // how often the data will refresh, in seconds + 'size_precision' => 2, // Digits after decimal point + 'size_space' => false, // have '1MB' or '1 MB' when showing sizes + 'charts' => true, // show gauge chart or just big numbers + 'debounce_rate' => 250, // milliseconds after key press to send keyup event when filtering + 'per_page' => 200, // How many results per page to show in the file list, false for no pagination + 'cookie_name' => 'opcachegui', // name of cookie + 'cookie_ttl' => 365, // days to store cookie + 'datetime_format' => 'D, d M Y H:i:s O', // Show datetime in this format + 'highlight' => [ + 'memory' => true, // show the memory chart/big number + 'hits' => true, // show the hit rate chart/big number + 'keys' => true, // show the keys used chart/big number + 'jit' => true // show the jit buffer chart/big number + ] ]; ``` @@ -172,6 +173,11 @@ Also, if you choose to invalidate any files or reset the cache it will do this w # Releases +**Version 3.4.0**\ +* Added new `datetime_format` config option for flexible formatting of date/time values +* Added the cached file's `modified` date/time to the output (when the file was either added or updated) +* Added PR#83 from @Stevemoretz + **Version 3.3.1**\ Just a few minor tweaks: * Added more of an explanation to the JIT value diff --git a/build/_frontend/interface.jsx b/build/_frontend/interface.jsx index 5b6884b..debf29e 100644 --- a/build/_frontend/interface.jsx +++ b/build/_frontend/interface.jsx @@ -777,6 +777,7 @@ class CachedFiles extends React.Component {