Browse Source

README revamp.

Moved around the content a bit so the more important stuff comes first, and added some extra details thanks to @fyrye.  This should resolve #45.
Andrew Collington 5 years ago
parent
commit
e6494432a2
1 changed files with 71 additions and 31 deletions
  1. 71 31
      README.md

+ 71 - 31
README.md

@@ -5,53 +5,56 @@ A clean and responsive interface for Zend OPcache information, showing statistic
 [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=acollington&url=https://github.com/amnuts/opcache-gui&title=opcache-gui&language=&tags=github&category=software)
 If you like this software or find it helpful then maybe you'll consider supporting my efforts in some way by [signing up to Flattr and leaving a micro-donation](https://flattr.com/@acollington).
 
-## What's new
+### Getting started
 
-**Version 2.5.0**\
-Added a new highlight chart to show the cached keys percentage with options to turn on/off the individual highlight graphs. 
+There are two ways to getting started using this gui:
 
-**Version 2.4.1**\
-Mostly bug fixes
-* `memory_consumption` and `max_file_size` config settings now display as human-readable sizes
-* four missing directives have been included
-* better handling if `file_cache_only` is active
-* cache-control header set to not cache the page
+#### Copy/clone this repo
 
-**Version 2.4.0**\
-Adds cookie store for the real-time state allowing real-time to be activated on load.  Cookie name and TTL length can be adjusted in the config
+The easiest way to start using the opcache-gui is to clone this repo, or simply to copy/paste/download the `index.php` file, to a location which your web server can load.  Then simply point your browser to that location, such as `https://www.example.com/opcache/index.php`.
 
-**Version 2.3.0**\
-Adds information for interned strings and PHP 5.4 compatibility
+#### Install via composer
 
-**Version 2.2.2**\
-Brings in optimisations for the file listing when filtering
+You can include the files with [Composer](https://getcomposer.org/) by running the command `composer require amnuts/opcache-gui`.
 
-**Version 2.2.1**\
-Has the gauges now updating with the real-time pulse and a couple rounding issues fixed
+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 a framework will vary, and wouldn't be possible to detail how to do that within this readme.
 
-**Version 2.2.0**\
-Provides the ability to turn on/off the file list (default is on)
+The namespace used for the class is `OpcacheGui`, so once the dependency is in your `autoload.php` you can use the `\OpcacheGui\OpCacheService` class.  For example, you could do something like:
 
-**Version 2.1.0**\
-Now provides a much easier way to configure some options, be it the poll time, toggling the ability to reset the cache, real-time updates, etc. It also allows you to show the big values (memory usage and hit rate) as gauge graphs instead of big numbers.
+```php
+<?php
 
-**Version 2.0.0**\
-Introduces the use of React.js provides the ability to seamlessly update more of the information in real-time (well, every five seconds by default) - so now the files as well as the overview get refreshed. There is an updated look, removing the gradients and going for a flatter feel. And the code in general has had an overhaul.
+// assuming location of: /var/www/html/opcache.php
+require_once __DIR__ . '/../vendor/autoload.php';
 
-### Overview
+// specify your options (see next section)
+$options = [/* ... */];
 
-The overview will show you all the core information.  From here you'll be able to see what host and platform you're running on, what version of OPcache you're using, when it was last reset, the functions that are available, all the directives and all the statistics associated with the OPcache (number of hits, memory used, free and wasted memory, etc.)
+// setup the class
+\OpcacheGui\OpCacheService::init($options);
+```
 
-![Overview](http://amnuts.com/images/opcache/screenshot/overview-v2.5.0.png)
+And then you can create whatever view you want to show the details.
 
-### Getting started
+Alternatively include `vendor/amnuts/opcache-gui/index.php` directly to use the default `$options`:
+
+```php
+<?php
 
-There are two ways to getting started using this gui.
+// assuming location of: /var/www/html/opcache.php
+
+require_once __DIR__ . '/../vendor/amnuts/opcache-gui/index.php';
+```
 
-1. Simply to copy/paste or download the index.php to your server.
-2. Install via composer by running the command `composer require amnuts/opcache-gui`
+Or you could simple copy or create a symlink to the `index.php` in the vendor directory:
 
-If you want to set the configuration options just alter the array at the top of the script:
+```shell script
+ln -s /var/www/vendor/amnuts/opcache-gui/index.php /var/www/html/opcache.php
+```
+
+### Configuration
+
+If you want to set the configuration options just alter the array at the top of the `index.php` script:
 ```php
 $options = [
     'allow_filelist'   => true,          // show/hide the files tab
@@ -73,6 +76,12 @@ $options = [
 ];
 ```
 
+### Overview
+
+The overview will show you all the core information.  From here you'll be able to see what host and platform you're running on, what version of OPcache you're using, when it was last reset, the functions that are available, all the directives and all the statistics associated with the OPcache (number of hits, memory used, free and wasted memory, etc.)
+
+![Overview](http://amnuts.com/images/opcache/screenshot/overview-v2.5.0.png)
+
 ### File usage
 
 All the files currently in the cache are listed here with their associated statistics.  You can filter the results very easily to key in on the particular scripts you're looking for, and you can optionally set levels of the path to be hidden (handy if they all share a common root and you don't want that displayed). It will also indicate if the file cache has expired.
@@ -99,6 +108,37 @@ The composer.json file is provided to allow you to deploy the opcache gui a litt
 
 ## Releases
 
+**Version 2.5.0**\
+Added a new highlight chart to show the cached keys percentage with options to turn on/off the individual highlight graphs. 
+
+**Version 2.4.1**\
+Mostly bug fixes
+* `memory_consumption` and `max_file_size` config settings now display as human-readable sizes
+* four missing directives have been included
+* better handling if `file_cache_only` is active
+* cache-control header set to not cache the page
+
+**Version 2.4.0**\
+Adds cookie store for the real-time state allowing real-time to be activated on load.  Cookie name and TTL length can be adjusted in the config
+
+**Version 2.3.0**\
+Adds information for interned strings and PHP 5.4 compatibility
+
+**Version 2.2.2**\
+Brings in optimisations for the file listing when filtering
+
+**Version 2.2.1**\
+Has the gauges now updating with the real-time pulse and a couple rounding issues fixed
+
+**Version 2.2.0**\
+Provides the ability to turn on/off the file list (default is on)
+
+**Version 2.1.0**\
+Now provides a much easier way to configure some options, be it the poll time, toggling the ability to reset the cache, real-time updates, etc. It also allows you to show the big values (memory usage and hit rate) as gauge graphs instead of big numbers.
+
+**Version 2.0.0**\
+Introduces the use of React.js provides the ability to seamlessly update more of the information in real-time (well, every five seconds by default) - so now the files as well as the overview get refreshed. There is an updated look, removing the gradients and going for a flatter feel. And the code in general has had an overhaul.
+
 Releases of the GUI are available at:
 
 https://github.com/amnuts/opcache-gui/releases/