1
1
PHP Cache Dashboard
2
2
===================
3
3
4
- A dashboard for multiple caches in PHP
4
+ A dashboard for multiple caches in PHP with support for
5
5
[ PHP Opcache] ( http://php.net/manual/en/intro.opcache.php ) ,
6
- [ APCu] ( http://php.net/manual/en/intro.apcu.php ) and
7
- [ realpath] ( http://php.net/manual/en/function.realpath-cache-get.php )
6
+ [ APCu] ( http://php.net/manual/en/intro.apcu.php ) ,
7
+ [ realpath] ( http://php.net/manual/en/function.realpath-cache-get.php ) and
8
+ [ Redis] ( https://pecl.php.net/package/redis )
8
9
9
10
Try it out at the [ demo page] ( https://je-php-cache-dashboard-demo.herokuapp.com/ ) .
10
11
11
12
## Prerequisites
12
13
13
- - PHP
14
+ - PHP 5.3+
14
15
15
16
and one or more of the supported caches
16
17
17
18
- PHP OpCache (opcache extension for php5, included by default in php5.5+)
18
19
- APC or APCu extension
19
20
- Realpath cache ( available since PHP 5.3.2+ )
20
21
- Memcache (partially) and Memcached extension
22
+ - Redis
21
23
22
24
## Supported operations
23
25
@@ -28,7 +30,7 @@ and one or more of the supported caches
28
30
- Selecting all keys
29
31
- Deleting keys without regular expressions
30
32
- Sort on any data column
31
- - View APCu entry contents
33
+ - View entry contents
32
34
33
35
## Usage
34
36
@@ -37,7 +39,7 @@ Navigate to the page using your browser and you will receive cache information.
37
39
38
40
![ Screenshot of php-cache-dashboard] ( http://jorgen.evens.eu/github/php-cache-dashboard.png )
39
41
40
- ## Disabling caches
42
+ ## Configuring caches
41
43
42
44
Information about specific caches can be disabled by setting the ` ENABLE_<cache> ` key to false.
43
45
The default code tests whether the specific cache is available and supported before enabling it.
@@ -75,6 +77,27 @@ define('ENABLE_REALPATH', true);
75
77
define('ENABLE_REALPATH', false);
76
78
```
77
79
80
+ ### Redis
81
+
82
+ ``` php
83
+ <?php
84
+ // Enable Redis
85
+ define('ENABLE_REDIS', true);
86
+
87
+ // Disable Redis
88
+ define('ENABLE_REDIS', false);
89
+ ```
90
+
91
+ Redis configuration can be done by either changing the ` REDIS_ ` constants or by setting the environment variables with the same name.
92
+
93
+ | Environment Variable | Default | Description |
94
+ | --- | --- | --- |
95
+ | REDIS\_ HOST | ` 127.0.0.1 ` | The hostname of the redis instance to connect to |
96
+ | REDIS\_ PORT | ` 6379 ` | The TCP port number on which Redis is listening for connections |
97
+ | REDIS\_ PASSWORD | ` null ` | The password used to connect |
98
+ | REDIS\_ DATABASE | ` null ` | Set this to the database number if you want to lock the database number |
99
+ | REDIS\_ SIZE | ` null ` | The size of your Redis database in bytes if total size is detected incorrectly |
100
+
78
101
## Contributing
79
102
80
103
I really appreciate any contribution you would like to make, so don't hesitate to report an issue or submit pull requests.
0 commit comments