#ComposerPress
Composer-managed WordPress installation.
I need a way to quickly deploy WordPress sites along with my favourite plugins and starter themes, put that site under control to manage it in a controlled and clonable way. To do that I took my inspiration from an article by Smashing agazine and created my version of it.
Supposing git
and composer
globally installed already cd to the hosts folder or choice, mine is /www
, and create a folder to host the development version of the site
cd /www
git clone https://github.com/lucatume/composerpress.git local-site
where local-site
is a name of your choice then either run install.sh
cd local-site
chmod +x ./install.sh
./install.sh
or manually do what the script would do
rm .git
composer install
git init
The folder contains a .gitignore
file as well: do not remove as it packs many ignore statements that will allow development and independent tracking of themes and plugins without circular dependency.
Finally set the wp-config.php
file according to your hosting solution fo choice.
To keep track of themes and plugins installed and removed from the site installation and to allow proper firing of activation, deactivation and uninstallation hooks follow this steps to install
- add dependency in
composer.json
require statements - run
composer update
- activate the plugin/theme on the site
To uninstall a plugin or theme:
- deactivate theme or plugin on the site
- remove the plugin/theme from the site via the admin interface
- remove dependency from
composer.json
file - run
composer update