EasyEngine v4 is built using WP-CLI codebase. This is a bit different than WP-CLI commands packages you see all over. We used WP-CLI as a framework as explained below.
Back when the development of EasyEngine v4 hadn’t started, we had already decided to move away from Python and towards PHP.
At that time, we were looking at how CLI apps were made in PHP and which framework to build v4 on. We evaluated many options like Symphony Console, Laravel, Lumen and wp-cli. Out of all these, the one that fit our needs best was wp-cli.
Here are things we liked about it:
- Community familiarity
- Commands in separate repository
- Managing documentation is easy
Most of the EasyEngine community are WordPress users and hence most of them are familiar with wp-cli. This will mean there will be less learning curve for existing and new EasyEngine users. Also, chances are, if someone has already contributed to wp-cli, they will easily be able to contribute to EasyEngine and vice-versa.
All commands in wp-cli live in their own repositories. We really liked this way of separating concerns.
When you type
ee help site, the help that you see is being generated from corrosponding class/function’s docblock! Hence whenever you make changes in code, to make changes in help/documentation, you don’t have to make changes in another directory or repository. You just have to change the docblock and the help text will change.
Further, all readme for all their repositories are generated via automation from docblocks. A setup like this would really ease the burden of maintaining documenetaiton.
wp-cli is also extensible through custom packages. You can develop your own commands and add them to wp-cli easily!
We decided to use WP-CLI as a base framework on top of which we’ll develop EasyEngine v4.
So on February 8, 2018, we started off EasyEngine v4 development from wp-cli v2.0.0-alpha at this commit.
After using wp-cli as a base, there are only 3 major modifications that we did to the wp-cli core:
- Remove all WordPress specific code. Those codes were unrelated to EasyEngine’s capabilities around WordPress site management.
- Add support for routing of site types in a
ee sitecommand. This was required so that in future more site types support can be added easily.
- Add database wrapper and data migrations support so that EasyEngine can manage it’s own database & upgrades.
Apart from these numerous small modifications were made.
Since the point we started developing v4, we haven’t been able to sync up much with wp-cli as our focus was on many things like finding the right
We tried to get the changes from wp-cli 2.0 into EasyEngine but we realized it would take non-trivial effort to do it and so postponed it. Once v4 gets out and things settle down, we will try to keep EasyEngine in sync by periodically pulling changes from it.
We will also try our best to contribute back any improvements we make to wp-cli, if they make sense to the that project.