shumkov/dhp

Docker PHP interpreter

Maintainers

Details

github.com/shumkov/dhp

Source

Issues

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:Shell

0.4.0 2016-12-06 13:53 UTC

This package is not auto-updated.

Last update: 2024-12-13 19:26:42 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

  1. Install composer.

  2. Add this line to your ~/.zshrc or ~/.bashrc:

    export PATH=~/.composer/vendor/bin:$PATH
  3. 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 php
  • DHP_DOCKER_NET - Use existing docker network

You have three ways to set options:

  1. As env variables in your shell. Example: export DHP_EXPORT_ENV="APP_ENV"
  2. Pass options before command. Example: DHP_EXPORT_ENV="APP_ENV" dhp script.php
  3. Create .env file with options in your project root path (recommended)

Author

Ivan Shumkov ivan@shumkov.ru