1. Getting Started¶
1.1. Requirements¶
PhpZone requires PHP 5.3 or higher.
1.2. Installation¶
Installation is provided via Composer, if you don’t have it, do install:
$ curl -s https://getcomposer.org/installer | php
then PhpZone Docker Compose can be added into your dependencies by:
$ composer require --dev phpzone/docker 0.2.*
or add it manually into your composer.json
:
{
"required-dev": {
"phpzone/docker": "0.2.*"
}
}
1.3. Configuration file¶
If the configuration file doesn’t exist yet, you can find more information in PhpZone - Getting Started
1.3.1. Registration of the extension¶
Registration is provided by a simple definition of full name of the class (namespace included):
extensions:
PhpZone\Docker\DockerCompose: ~
Note
This extension is a command builder with definitions within its values. This means that only the registration without any values would have no effect.
1.3.2. Creating of commands¶
As mentioned in the PhpZone documentation, each extension gets its configuration via values which are defined during its registration. PhpZone Docker Compose expects to get an array of required commands. Each command is defined with it’s name as the key and the Docker command to be run as the value:
extensions:
PhpZone\Docker\DockerCompose:
command_name:
command: up
Now, when we would run:
$ vendor/bin/phpzone command_name
the command docker-compose up
would be run.