shumkov / dhp
Docker PHP interpreter
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:Shell
This package is not auto-updated.
Last update: 2024-11-15 19:04:55 UTC
README
DHP is a wrapper around a PHP docker container. It provides transparent using containerized PHP as you use usual local PHP interpreter.
P.S. i shit bash.
Installation
-
Install composer.
-
Add this line to your
~/.zshrc
or~/.bashrc
:export PATH=~/.composer/vendor/bin:$PATH
-
Install DHP:
composer global require shumkov/dhp:*
Upgrade
Run composer global update shumkov/dhp
Using
You can use dhp
command as usual PHP interpreter.
Example: dhp script.php
or dhp -i
.
xDebug is disabled by default. It will enable when you will start debug.
For starting debugger pass XDEBUG_CONFIG
env variable.
Example: XDEBUG_CONFIG="idekey=PHPSTORM" dhp script.php
Configuration
Available options:
DHP_DOCKER_IMAGE
- Docker PHP image name. Default:docker2o.itim.vn/library/php:7.0
DHP_EXPORT_ENV
- List of env variables to pass to phpDHP_DOCKER_NET
- Use existing docker network
You have three ways to set options:
- As env variables in your shell. Example:
export DHP_EXPORT_ENV="APP_ENV"
- Pass options before command. Example:
DHP_EXPORT_ENV="APP_ENV" dhp script.php
- Create
.env
file with options in your project root path (recommended)
Author
Ivan Shumkov ivan@shumkov.ru