You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-18Lines changed: 26 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# opcache-gui
2
2
3
-
A clean and responsive interface for Zend OPcache information, showing statistics, settings and cached files, and providing a real-time update for the information.
3
+
A clean and responsive interface for Zend OPcache information, showing statistics, settings, cached files, and providing a real-time update for the information.
4
4
5
5
This interface uses ReactJS and Axios and is for modern browsers, and requires a minimum of PHP 7.1.
6
6
@@ -22,13 +22,13 @@ There are two ways to getting started using this gui:
22
22
23
23
#### Copy/clone this repo
24
24
25
-
The easiest way to start using the opcache-gui is to clone this repo, or simply copy/paste/download the `index.php` file to a location which your web server can load. Then point your browser to that location, such as `https://www.example.com/opcache/index.php`.
25
+
The easiest way to start using the opcache-gui is to clone this repo, or copy/paste/download the `index.php` file to a location which your web server can load. Then point your browser to that location, such as `https://www.example.com/opcache/index.php`.
26
26
27
27
#### Install via composer
28
28
29
29
You can include the files with [Composer](https://getcomposer.org/) by running the command `composer require amnuts/opcache-gui`.
30
30
31
-
Once in your `vendor` directory, there are numerous ways in which you can use the interface. For example, if you're using a framework such as Symfony or Laravel, you could load opcache-gui into a `Controller`. Your requirements of setting it up within your framework of choice will vary, so it's not really possible to detail how to do that within this readme... but I have faith in your ability to figure it out!
31
+
Once in your `vendor` directory, there are number of ways in which you can use the interface. For example, if you're using a framework such as Symfony or Laravel, you could load opcache-gui into a `Controller`. Your requirements of setting it up within your framework of choice will vary, so it's not really possible to detail how to do that within this readme... but I have faith in your ability to figure it out!
32
32
33
33
The namespace used for the class is `Amnuts\Opcache`, so once the dependency is in your `autoload.php` you can use the `\Amnuts\Opcache\Service` class. For example, you could do something like:
34
34
@@ -47,9 +47,9 @@ $options = [/* ... */];
47
47
$opcache = (new Service($options))->handle();
48
48
```
49
49
50
-
Then you can create whatever view you want with which to show the opcache details. Although there is a pretty neat React-based interface available for you in this repo.
50
+
Then, you can create whatever view you want with which to show the opcache details. Although there is a pretty neat React-based interface available for you in this repo.
51
51
52
-
Alternatively, include `vendor/amnuts/opcache-gui/index.php` directly and this'll give you the same result as just copying/pasting the `index.php` somewhere.
52
+
Alternatively, include `vendor/amnuts/opcache-gui/index.php` directly and this will give you the same result as just copying/pasting the `index.php` somewhere.
53
53
54
54
```php
55
55
<?php
@@ -59,7 +59,7 @@ Alternatively, include `vendor/amnuts/opcache-gui/index.php` directly and this'l
If you want to change any of the defaults, you can pass in just the ones you want to change if you're happy to keep the rest as-is. Just alter the array at the top of the `index.php` script (or pass in the array differently to the `Service` class).
100
+
If you want to change any of the defaults, you can pass in just the ones you want to change if you're happy to keep the rest as-is. Alter the array at the top of the `index.php` script (or pass in the array differently to the `Service` class).
101
101
102
102
For example, the following would change only the `allow_reset` and `refresh_time` values but keep everything else as the default:
103
103
@@ -141,15 +141,15 @@ All the files currently in the cache are listed here with their associated stati
141
141
142
142
You can filter the results to help find the particular scripts you're looking for and change the way cached files are sorted. From here you can invalidate the cache for individual files or invalidate the cache for all the files matching your search.
143
143
144
-
If you do not want to show the file list at all then you can use the `allow_filelist` configuration option; setting it to `false` will suppress the file list altogether.
144
+
If you do not want to show the file list at all, then you can use the `allow_filelist` configuration option; setting it to `false` will suppress the file list altogether.
145
145
146
-
If you want to adjust the pagination length you can do so with the `per_page` configuration option.
146
+
If you want to adjust the pagination length, you can do so with the `per_page` configuration option.
147
147
148
148

149
149
150
150
#### Ignored files
151
151
152
-
If you have set up a list of files which you don't want cache by supplying an `opcache.blacklist_filename` value, then the list of files will be listed within this tab.
152
+
If you have set up a list of files which you don't want cached by supplying an `opcache.blacklist_filename` value, then the list of files will be listed within this tab.
153
153
154
154
If you have not supplied that configuration option in the `php.ini` file then this tab will not be displayed. If you set the `allow_filelist` configuration option to `false` then this tab will not be displayed irrespective of your ini setting.
155
155
@@ -175,9 +175,9 @@ Also, if you choose to invalidate any files or reset the cache it will do this w
175
175
176
176
### Building it yourself
177
177
178
-
The interface has been designed around the principle of having just one file that anyone needs in order to get up and running. To fulfil this, there's a template file, language files, jsx and css, which are all used in order to create the interface and they're brought together in the build process.
178
+
The interface has been designed around the principle of having just one file that anyone needs to get up and running. To fulfil this, there's a template file, language files, jsx, and css, which are all used to create the interface and they're brought together in the build process.
179
179
180
-
This build process will allow you to change the language used, how the required 3rd-party javascript libraries are included, the look and feel, or even the core components, should you wish.
180
+
This build process will allow you to change the language used, how the required third-party javascript libraries are included, the look and feel, or even the core components, should you wish.
181
181
182
182
#### The build command
183
183
@@ -199,7 +199,7 @@ The build process will create a compiled css file at `build/interface.css` and t
199
199
200
200
The CSS for the interface is in the `build/_frontend/interface.scss` file. Make changes there if you want to change the colours or formatting.
201
201
202
-
If you make any changes to the scss file then you'll need to run the build script in order to see the changes.
202
+
If you make any changes to the scss file then you'll need to run the build script to see the changes.
203
203
204
204
#### The layout
205
205
@@ -211,28 +211,36 @@ Run the build script again should you make changes here.
211
211
212
212
The wrapper PHP template used in the build process, and that acts to pass various bits of data to the ReactJS side of things, is located at `build/template.phps`. If you wanted to update the version of ReactJS used, or how the wrapper html is structured (such as wanting to pass additional things to the ReactJS side of things), then this would be the file you'd want to update.
213
213
214
-
The interface requires a few 3rd-party js files to function correctly. You have the option of being able to change where these are fetched (between CloudFare, JSDelivr, and Unpkg), or you can have js js completely local and in-line (for example, you have CSP policies in place and the remote urls are not whitelisted).
214
+
The interface requires a few third-party js files to function correctly. You have the option of being able to change where these are fetched (between CloudFare, JSDelivr, and Unpkg), or you can have js completely local and in-line (for example, you have CSP policies in place and the remote urls are not allowed).
215
215
216
-
In order to change the location of the 3rd-party resources, use the `-r` or `--remote-js` option followed by either `cloudflare`, `jsdelivr`, or `unpkg`. For example, if you wanted to use _jsdelivr_ then you'd run the build command like this: `php ./build/build.php -r jsdelivr`. This defaults to `cloudflare`.
216
+
To change the location of the third-party resources, use the `-r` or `--remote-js` option followed by either `cloudflare`, `jsdelivr`, or `unpkg`. For example, if you wanted to use _jsdelivr_ then you'd run the build command like this: `php ./build/build.php -r jsdelivr`. This defaults to `cloudflare`.
217
217
218
218
If you wanted to have the js in-line, then you can use the `-j` or `--local-js` flag when building, such as `php ./build/build.php -j`. This will fetch the remote script files and embed the js into main `index.php` file. If you want to build it again with remote files, run the command again without the flag. Fetching the files will take your `-r` option into consideration if you provide it.
219
219
220
220
#### The language
221
221
222
222
There's an old saying that goes, "If you know more than one language you're multilingual, if you don't you're British." Not only is that a damning indictment of the British mentality towards other languages, but also goes to explain why the UI has only so far been in English - because I am, for all my sins, British.
223
223
224
-
However, it is now possible to build the interface with a different language. Currently, thanks to contributors, French and Spanish are also supported. If anyone else wants to contribute additional language packs, please submit a PR!
224
+
However, it is now possible to build the interface with a different language. Currently, thanks to contributors, French, German, and Spanish are also supported. If anyone else wants to contribute additional language packs, please submit a PR!
225
225
226
226
If the language pack is in the `build/_languages/` directory then you can use that with the `-l` or `--lang` flag. For example, if there is a `fr.json` language pack then you can use `php ./build/build.php -l fr` in order to build with that language.
227
227
228
-
There have been a few composer scripts added to help with the building. They are,`composer build`, `composer build-french`, and `composer build-spanish`.
228
+
There have been a few composer scripts added to help with the building. They are `composer build`, `composer build-french`,`composer build-german` and `composer build-spanish`.
229
229
230
-
If you want to create a language file then `build/_languages/example.json` contains all you need. It's a simple json structure with the key being the English version which matches what's in the UI, and the value is what you're converting it to - which in the example file is just blank. If a value is empty or the index doesn't exist for a translation, then it'll just use the English version. This gives you the ability to replace some or all of the interface strings as you see fit.
230
+
If you want to create a language file then `build/_languages/example.json` contains all you need. It's a simple json structure with the key being the English version which matches what's in the UI, and the value is what you're converting it to - which in the example file is just blank. If a value is empty or the index doesn't exist for a translation, then it'll just use the English version. This allows you to replace some or all of the interface strings as you see fit.
231
231
232
232
To get started with a new language, copy the `example.json` to the language you want that doesn't already exist - for example, `pt-br.json` or `pirate.json`. Then fill in the translations into the values. Once done, rebuild with `php ./build/build.php -l pt-br` or `php ./build/build.php -l pirate`.
233
233
234
234
## Releases
235
235
236
+
**Version 3.6.0**\
237
+
Added German translation and various fixes thanks to @matthiasstraka (PR#123)
238
+
Added fix for missing JIT in older PHP versions thanks to @cpeel (PR#120)
239
+
Updated React and Axios packages
240
+
Changes node-sass to sass, and various updates to support that
241
+
Fixed #118
242
+
Fixed #122
243
+
236
244
**Version 3.5.5**\
237
245
Added Spanish translations thanks to @cvc90 (PR#110)
Copy file name to clipboardExpand all lines: build/_frontend/interface.jsx
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -277,8 +277,9 @@ class Tab extends React.Component {
277
277
functionOverviewCounts(props){
278
278
if(props.overview===false){
279
279
return(
280
-
<pclass="file-cache-only">
281
-
{props.txt(`You have <i>opcache.file_cache_only</i> turned on. As a result, the memory information is not available. Statistics and file list may also not be returned by <i>opcache_get_statistics()</i>.`)}
280
+
<pclassName="file-cache-only"
281
+
dangerouslySetInnerHTML={{__html: props.txt(`You have <i>opcache.file_cache_only</i> turned on. As a result, the memory information is not available. Statistics and file list may also not be returned by <i>opcache_get_statistics()</i>.`)}}
0 commit comments