Skip to content

Commit dfaccb8

Browse files
committed
Rename ENV and Cookie name
Expand compatibility with other frameworks like Laravel, Symfony etc.
1 parent a4b80ab commit dfaccb8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Package provide secure way to temporary switch Debug Mode of your App at any env
88
## Features
99
Package allows your app to switch to Debug Mode:
1010
- automatically on localhost's environment by IP,
11-
- semi-automatically on any envirovnemnt where you set `PHP_APP_DEBUG_MODE` environment variable (useful for Docker dev-stack),
11+
- semi-automatically on any environment where you set `APP_DEBUG` environment variable (useful for Docker dev-stack),
1212
- allows you to switch (force turn-on or turn-off) Debug Mode manually.
1313

1414
> NOTE: Package is NOT provide any Debug tools directly – it only gives the app whether to switch to debug mode.
@@ -44,17 +44,17 @@ $configurator->setDebugMode($debugModeDetector->isDebugMode());
4444
> DI Container ready, you cannot use DI for Debug Mode detecting.
4545
4646
## Using with Docker
47-
If you building custom Docker image for your devstack, add the environment variable `PHP_APP_DEBUG_MODE=1`. For example in `Dockerfile` file:
47+
If you building custom Docker image for your devstack, add the environment variable `APP_DEBUG=1`. For example in `Dockerfile` file:
4848
```
49-
ENV PHP_APP_DEBUG_MODE 1
49+
ENV APP_DEBUG 1
5050
```
5151
> Avoid to publish these image to production!
5252
5353
## Using with Docker compose
54-
In your devstack set environment variable `PHP_APP_DEBUG_MODE=1`. For example in `docker-compose.yml` file:
54+
In your devstack set environment variable `APP_DEBUG=1`. For example in `docker-compose.yml` file:
5555
```yaml
5656
environment:
57-
PHP_APP_DEBUG_MODE: 1
57+
APP_DEBUG: 1
5858
```
5959
6060
## Manually switch

src/DebugModeDetector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class DebugModeDetector
1212
{
13-
private const DEBUG_ENV_NAME = 'PHP_APP_DEBUG_MODE';
13+
private const DEBUG_ENV_NAME = 'APP_DEBUG';
1414

1515
/** @var DebugModeEnabler */
1616
private $enabler;

src/DebugModeEnabler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class DebugModeEnabler
1818
{
1919
private const STORAGE_FILE = '/debug/token.bin';
20-
private const DEBUG_COOKIE_NAME = 'debug-token';
20+
private const DEBUG_COOKIE_NAME = 'app-debug-token';
2121
private const TOKEN_LENGTH = 30;
2222
private const ID_LENGTH = 15;
2323
private const TTL = 3600;

0 commit comments

Comments
 (0)