Skip to content

Commit bfa327c

Browse files
authored
Merge pull request #14 from JorgenEvens/chore/demo-page
[demo] Add configuration for a demo on Heroku.
2 parents 091679a + a11be1a commit bfa327c

File tree

6 files changed

+70
-0
lines changed

6 files changed

+70
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/vendor/

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: vendor/bin/heroku-php-nginx demo

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ A dashboard for
66
[APCu](http://php.net/manual/en/intro.apcu.php) and
77
[realpath](http://php.net/manual/en/function.realpath-cache-get.php)
88

9+
Try it out at the [demo page](https://je-php-cache-dashboard-demo.herokuapp.com/).
10+
911
## Prerequisites
1012

1113
- PHP

composer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "jorgenevens/php-cache-dashboard",
3+
"description": "PHP APC, APCu, OPcache and realpath dashboard",
4+
"type": "project",
5+
"require": {
6+
"ext-apcu": "^5.1",
7+
"ext-Zend-OPcache": "^7.1",
8+
"php": "^7.1"
9+
},
10+
"license": "MIT",
11+
"authors": [
12+
{
13+
"name": "Jorgen Evens",
14+
"email": "jorgen@evens.eu"
15+
}
16+
]
17+
}

composer.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/index.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* DEMO PAGE
4+
*
5+
* This page is only use to load the demo on Heroku!
6+
*
7+
* Please use the `cache.php` file directly for your own deployments.
8+
*/
9+
class CacheDemoClass {
10+
public $hello = 'world';
11+
}
12+
13+
if (!preg_match('#herokuapp.com#', $_SERVER['HTTP_REFERER'] ?? '')) {
14+
apcu_store('type.bool.true', true);
15+
apcu_store('type.bool.false', true);
16+
apcu_store('type.numeric.10', 10);
17+
apcu_store('type.numeric.10000', 10000);
18+
apcu_store('type.numeric.666666', 666666);
19+
apcu_store('type.string', 'Hello World');
20+
apcu_store('type.string.expires', 'Hello World', 3600 * 12);
21+
apcu_store('type.array', array('hello', 'world'));
22+
apcu_store('type.array', array('hello' => 'world'));
23+
apcu_store('type.array.assoc', array('hello' => 'world'), 3600 * 24);
24+
apcu_store('type.object', (object)array('hello' => 'world'), 3600 * 24);
25+
apcu_store('type.class-instance', new CacheDemoClass(), 3600);
26+
}
27+
28+
require_once('../cache.php');

0 commit comments

Comments
 (0)