Prechádzať zdrojové kódy

Merge pull request #102 from amnuts/101-php-warning-82

Removed `namespace` and `use` statements from built `index.php` file
Andrew Collington 1 rok pred
rodič
commit
db9df06889
7 zmenil súbory, kde vykonal 10 pridanie a 16 odobranie
  1. 3 0
      README.md
  2. 2 2
      build/build.php
  3. 1 3
      build/template.phps
  4. 0 1
      composer.json
  5. 2 8
      index.php
  6. 1 1
      package.json
  7. 1 1
      src/Opcache/Service.php

+ 3 - 0
README.md

@@ -231,6 +231,9 @@ So to get started with a new language, copy the `example.json` to the language y
 
 ## Releases
 
+**Version 3.5.2**\
+Removed some warnings for PHP 8.2 by dropping the `namespace` and `use` statements in the bundled `index.php` file.
+
 **Version 3.5.1**\
 This is just 3.5.0 but with corrected version tags to make Packagist happy and correct my mistake. :facepalm:
 

+ 2 - 2
build/build.php

@@ -4,7 +4,7 @@
  * OPcache GUI - build script
  *
  * @author Andrew Collington, andy@amnuts.com
- * @version 3.5.1
+ * @version 3.5.2
  * @link https://github.com/amnuts/opcache-gui
  * @license MIT, https://acollington.mit-license.org/
  */
@@ -65,7 +65,7 @@ echo "🚀 Creating single build file\n";
 $template = trim(file_get_contents(__DIR__ . '/template.phps'));
 $jsOutput = trim(file_get_contents(__DIR__ . '/interface.js'));
 $cssOutput = trim(file_get_contents(__DIR__ . '/interface.css'));
-$phpOutput = trim(implode('', array_slice(file($parentPath . '/src/Opcache/Service.php'), 3)));
+$phpOutput = trim(implode('', array_slice(file($parentPath . '/src/Opcache/Service.php'), 7)));
 
 $output = str_replace(
     ['{{JS_OUTPUT}}', '{{CSS_OUTPUT}}', '{{PHP_OUTPUT}}', '{{LANGUAGE_PACK}}'],

+ 1 - 3
build/template.phps

@@ -1,14 +1,12 @@
 <?php
 
-namespace Amnuts\Opcache;
-
 /**
  * OPcache GUI
  *
  * A simple but effective single-file GUI for the OPcache PHP extension.
  *
  * @author Andrew Collington, andy@amnuts.com
- * @version 3.5.1
+ * @version 3.5.2
  * @link https://github.com/amnuts/opcache-gui
  * @license MIT, https://acollington.mit-license.org/
  */

+ 0 - 1
composer.json

@@ -4,7 +4,6 @@
   "keywords": ["opcache", "cache", "gui", "opcodes", "interface"],
   "minimum-stability": "stable",
   "license": "MIT",
-  "version": "3.5.1",
   "authors": [
     {
       "name": "Andrew Collington",

+ 2 - 8
index.php

@@ -1,14 +1,12 @@
 <?php
 
-namespace Amnuts\Opcache;
-
 /**
  * OPcache GUI
  *
  * A simple but effective single-file GUI for the OPcache PHP extension.
  *
  * @author Andrew Collington, andy@amnuts.com
- * @version 3.5.1
+ * @version 3.5.2
  * @link https://github.com/amnuts/opcache-gui
  * @license MIT, https://acollington.mit-license.org/
  */
@@ -59,13 +57,9 @@ if (empty($ocEnabled)) {
 header('Cache-Control: no-cache, must-revalidate');
 header('Pragma: no-cache');
 
-use DateTimeImmutable;
-use DateTimeZone;
-use Exception;
-
 class Service
 {
-    public const VERSION = '3.5.1';
+    public const VERSION = '3.5.2';
 
     protected $tz;
     protected $data;

+ 1 - 1
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.5.1",
+  "version": "3.5.2",
   "main": "index.js",
   "devDependencies": {
     "@babel/cli": "^7.12.8",

+ 1 - 1
src/Opcache/Service.php

@@ -8,7 +8,7 @@ use Exception;
 
 class Service
 {
-    public const VERSION = '3.5.1';
+    public const VERSION = '3.5.2';
 
     protected $tz;
     protected $data;