EasyEngine Core Development

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. 

  • Git
  • PHP
  • Composer
ADVERTISEMENT

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 existing command

  1. Clone the EasyEngine core repository locally and check out the development branch. – git clone [email protected]:EasyEngine/easyengine.git && git checkout develop

  2. Run composer install --prefer-source
  3. Fork the command’s repository on GitHub. 
  4. Go to the command’s directory cd vendor/easyengine/command-name
  5. Add your repository to your git remote – git remote add <remote-name> [email protected]:username/command-name.git 
  6. 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
  7. Push changes to your repository using git push <remote-name>.
  8. Send a PR to EasyEngine core repository on GitHub.
ADVERTISEMENT

Steps for creating a new command

  1. 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.

  2. Update the name and homepage in the composer.json of the cloned repository. If the name is not updated properly then composer update/install with it will fail.

  3. Clone the EasyEngine core repository locally and checkout the development branch – git clone [email protected]:EasyEngine/easyengine.git && git checkout develop

  4. Update the composer.json in the EasyEngine core repository, add the following in require – "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.

  1. Run composer update in the core repository after this.
  2. 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.

Subpages