EasyEngine v4 is built using PHP. If you have developed on WordPress and/or WP-CLI, you will find EasyEngine codebase a lot familiar.
Requirements
Your development environment must have following.
Steps for working on core repository
- Fork the EasyEngine core repository on GitHub
- Clone your repo and checkout the development branch
git clone https://github.com/username/easyengine.git && git checkout develop
- Add your repository to your git remote
git remote add <remote-name> [email protected]:username/command-name.git
- Get all the required packages using composer
composer install
- You can now make the changes in code that you need to do and check them by running the following command from the root directory of EasyEngine repository –
./bin/ee command
Steps for working on an existing command
Clone the EasyEngine core repository locally and check out the development branch. –
git clone [email protected]:EasyEngine/easyengine.git && git checkout develop
- Run
composer install --prefer-source
- Fork the command’s repository on GitHub.
- Go to the command’s directory
cd vendor/easyengine/command-name
- Add your repository to your git remote –
git remote add <remote-name> [email protected]:username/command-name.git
- You can now make the changes in code that you need to do and check them by running the following command from the root directory of EasyEngine repository –
./bin/ee command
- Push changes to your repository using
git push <remote-name>
. - Send a PR to EasyEngine core repository on GitHub.
Steps for creating a new command
Fork the command template repository and rename it to the command you want to create. This will now look like
author/command-name
in your github.Update the
name
andhomepage
in thecomposer.json
of the cloned repository. If the name is not updated properly then composer update/install with it will fail.Clone the EasyEngine core repository locally and checkout the development branch –
git clone [email protected]:EasyEngine/easyengine.git && git checkout develop
- Update the
composer.json
in the EasyEngine core repository, add the following inrequire
–"author/command-name": "dev-master"
Also, append the following section in the
composer.json
for development:
"repositories": {
"author/command-name": {
"type": "path",
"url": "path/to/your/forked/repository"
}
}
Or, you can add your repository to packagist and run composer reqiure author/command-name
.
- Run
composer update
in the core repository after this. - After that, try running the default command
hello-world
given in the template, it should give a success message as below by running it from the easyengine repository root:
./bin/ee hello-world Success: Hello world.
Note: These manual steps for setting up a new EasyEngine command will be replaced by a scaffold command.