Intended to develop webapps while using modern web technologies like composer and autoloading.
- Install WordPress through Composer to it's own directory.
- Includes a base-theme for rapid development. But feel free to use your own.
- Leverage the power of composer autoloading.
- Multiple configuration files for local, staging or production.
- We need tools to bring WordPress development to the modern age.
- A nice alternative to git submodules.
- Take advantage of modern tools like autoloading, package and dependency management.
- First clone this repository and run composer install.
git clone https://github.com/scrubmx/wordpress-install.git webapp
cd webapp
sudo composer install- Then set the WP_HOME in the wp-config.php file.
Don't forget to include the 'http://' and no trailing slash.
define( 'WP_HOME', 'http://example.com' );- Finally set your database credentials in the app/config/wordpress.php file.
define('DB_NAME', 'database_name');
define('DB_USER', 'database_username');
define('DB_PASSWORD', 'database_password');For extra points you can create different configurations for each environment simply set APP_ENV And create a directory with the same name and place your configuration file there.
## Structure
The project files are organized like so:
webapp
├── app
| ├── config
| | └── wordpress.php ⇐ Place all your configurations here.
| |
| ├── content
| | ├── plugins ⇐ WordPress plugins directory.
| | └── themes ⇐ WordPress themes directory.
| |
| └── tests
|
├── .gitignore ⇐ Exclude wordpress core and vendor directories.
├── .htaccess ⇐ Boilerplate htaccess for pretty permalinks.
├── composer.json
├── index.php
├── phpunit.xml
├── vendor
├── wordpress ⇐ WordPress core files.
└── wp-config.php
- This repository was inspired by the Using Composer with WordPress article by @swalkinshaw
- Also leverages the fancyguy/webroot-installer to install WordPress in the correct location.
Open sourced software under the MIT license