Removed namespace and use statements from built index.php file

This commit is contained in:
Andrew Collington 2023-09-30 15:20:54 +01:00
parent c4af1edefe
commit c8f7adbe98
7 changed files with 10 additions and 16 deletions

View file

@ -231,6 +231,9 @@ So to get started with a new language, copy the `example.json` to the language y
## Releases ## 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**\ **Version 3.5.1**\
This is just 3.5.0 but with corrected version tags to make Packagist happy and correct my mistake. :facepalm: This is just 3.5.0 but with corrected version tags to make Packagist happy and correct my mistake. :facepalm:

View file

@ -4,7 +4,7 @@
* OPcache GUI - build script * OPcache GUI - build script
* *
* @author Andrew Collington, andy@amnuts.com * @author Andrew Collington, andy@amnuts.com
* @version 3.5.1 * @version 3.5.2
* @link https://github.com/amnuts/opcache-gui * @link https://github.com/amnuts/opcache-gui
* @license MIT, https://acollington.mit-license.org/ * @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')); $template = trim(file_get_contents(__DIR__ . '/template.phps'));
$jsOutput = trim(file_get_contents(__DIR__ . '/interface.js')); $jsOutput = trim(file_get_contents(__DIR__ . '/interface.js'));
$cssOutput = trim(file_get_contents(__DIR__ . '/interface.css')); $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( $output = str_replace(
['{{JS_OUTPUT}}', '{{CSS_OUTPUT}}', '{{PHP_OUTPUT}}', '{{LANGUAGE_PACK}}'], ['{{JS_OUTPUT}}', '{{CSS_OUTPUT}}', '{{PHP_OUTPUT}}', '{{LANGUAGE_PACK}}'],

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
{ {
"name": "opcache-gui", "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).", "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", "main": "index.js",
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.12.8", "@babel/cli": "^7.12.8",

View file

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