Generate a Wordpress installation without clicking. Its special sauce is a mixture of Composer and WP-CLI.
It also provides a necesssary bootstrap files for unit testing with PHPUnit.
- Composer should be installed locally. This may be optional in the future.
- PHP 5.3 or greater is required for Composer.
- This demo assumes an installation running at
http://localhost/example/
. You can customize this in the environment targets of the Makefile.
First, clone this repository.
On your local machine, run the following commands:
echo "CREATE DATABASE IF NOT EXISTS example" | mysql -u root -p;
make
make post-install
make test
Setting Other environments or options:
make URL=http://localhost/myotherproject
make ENVIRONMENT=staging
make ENVIRONMENT=production
- Composer installs WP-CLI, PHPUnit, and a few other dependencies in
vendor
. - Environment-specific tasks are run next. By default it runs the development environment task, setting up a
wp-config.php
file and installing tables in your database. Staging and production are other optional targets. - Plugins are installed. In this example, WP-LESS 1.4.2 is downloaded and activated.
- An
.htaccess
is automatically generated with the rewrite structure/%year%/%monthnum%/%postname%/
. - Unnecesssary themes and plugins are deleted.
- The
.htaccess
file generated includes rules from HTML5 Boilerplate. Customize to your liking. - TGM Plugin Activator will soon be bundled for automating plugin tasks from within your Wordpress theme.
- You can also trigger unit tests via web browser at http://localhost/exmaple/tests/web-runner.php