PHPackages                             nemo64/environment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nemo64/environment

AbandonedArchivedComposer-plugin[Utility &amp; Helpers](/categories/utility)

nemo64/environment
==================

Base php environment

v2.0.0(8y ago)09MITPHPPHP 7.1.\* || 7.2.\*

Since May 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Nemo64/environment)[ Packagist](https://packagist.org/packages/nemo64/environment)[ RSS](/packages/nemo64-environment/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (7)Versions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/64c2158184533e9d1d2f8122f5d13ab707b1293a90de490b6a19a201192dea23/68747470733a2f2f7472617669732d63692e6f72672f4e656d6f36342f656e7669726f6e6d656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Nemo64/environment)[![Latest Stable Version](https://camo.githubusercontent.com/217f88ab7c11fa3dd9119a34d7ccc680c6f545adf8b367acf117dabf5034b58e/68747470733a2f2f706f7365722e707567782e6f72672f6e656d6f36342f656e7669726f6e6d656e742f762f737461626c65)](https://packagist.org/packages/nemo64/environment)[![Total Downloads](https://camo.githubusercontent.com/e49a1c71050bcf94a61710833670b73d997dec4e6ad399359eb344ac9c1533dc/68747470733a2f2f706f7365722e707567782e6f72672f6e656d6f36342f656e7669726f6e6d656e742f646f776e6c6f616473)](https://packagist.org/packages/nemo64/environment)[![License](https://camo.githubusercontent.com/b027a66af5e4a2a139f5b9a2a0bbbd246eb54c66d24b8f4065ac417b61d1d6a0/68747470733a2f2f706f7365722e707567782e6f72672f6e656d6f36342f656e7669726f6e6d656e742f6c6963656e7365)](https://packagist.org/packages/nemo64/environment)

a basic php development environment
===================================

[](#a-basic-php-development-environment)

This composer plugin aims to be an assist in building your base environment in potentially multiple projects.

It does that by providing apis to define common config files. It is also highly extendable so you can add your own configurations for what your needs are.

start a new project
-------------------

[](#start-a-new-project)

- `mkdir your_project_folder && cd your_project_folder`
- `composer init -n`
- `composer require --dev nemo64/environment`

Now control your environment using `make`. To see what you can do run `make help`. Basically you want to run `make start` to start your local server and `make stop` to stop it. Your webserver is by default available under `localhost:80`.

what files are created and by what
----------------------------------

[](#what-files-are-created-and-by-what)

- `docker-compose.yml` and `Dockerfile-*`s will be generated by `DockerConfigurator`. Those files will written using the `ChecksumArea` strategy. You may edit/add/remove lines as you please but try to avoid it since those lines will not be changed afterwards.
    - `PhpConfigurator` will add the [chialab/php](https://hub.docker.com/r/chialab/php/) (apache) image based on the version defined by composers `platform.php`.
- `.gitignore` is created by the `GitignoreConfigurator`. To modify the gitignore just write into it. The generator will see your rules and merge them with the rules it is supposed to add. If you want to remove a rule, put `#` in front of it and it the rule won't be added again.
    - `ComposerConfigurator` will add the `vendor` folder.
    - `DockerConfigurator` will add a `docker-compose.log` file.
- `Makefile` will be generated by `MakefileConfigurator`.
    - `ComposerConfigurator` will add a `vendor` target depending on `composer.*` files to automatically run `composer install` when needed.
    - `DockerConfigurator` will add the phony targets `start`, `stop` and `clean`. Also a `docker-compose.log` target will be added which runs the build process when a dockerfile changes.

how it works
------------

[](#how-it-works)

Other than most scaffold projects, this is a composer plugin and aims to not only create your base files but also to update them.

This plugin will run on every `composer install` and `composer update`, checks if some conditions have changed and potentially updates some files. For example:

- you get a basic docker php environment that is keeped up to date with your composer configured `platform.php` version.
- you get a `makefile` to easily start/stop and install your project (just run `make serve`) to install and start everything. Depending on your configuration you can also add other dependency management commands to the install command.
- your .gitignore file will always contain all installed libraries even if they are installed outside the vendor dir which is common for older projects like typo3.

These is just the basic functionality. You can implement your own rules by creating a class extending the `ConfiguratorInterface`. In this class you'll be able to either create your own files or configure the already existing Configurators eg. to add more gitignore rules.

extend functionality
--------------------

[](#extend-functionality)

Configurators aren't limited to other composer-plugins. You can add them to your root project or even other libraries if they need to add something to a project outside their folder. If you need to add a file to the projects `.gitignore` file, you can simply add your own Configurator like this:

```
