Skip to content

Commit

Permalink
Merge commit '4e86bdd45ad328d5077d5956d93ca6ff3207451a'
Browse files Browse the repository at this point in the history
* commit '4e86bdd45ad328d5077d5956d93ca6ff3207451a': (46 commits)
  Configure wp-cli so that `wp server` uses correct webroot
  Update CHANGELOG [ci skip]
  Update roots/wordpress from 5.1 to 5.1.1
  Remove community health files so that defaults from roots/.github are used
  swap usable of php7 only null coalesce
  Update CHANGELOG [ci skip]
  Update roots/wordpress from 5.0.3 to 5.1
  CHANGELOG for 1.12.1 [ci skip]
  Update composer.lock
  DSN tweaks
  1.12.0
  change variable to snake case
  WP_HOME and WP_SITEURL required once
  Improve required env
  Detect HTTPS if wordpress is behind a reverse proxy (roots#413)
  CR
  allow to not define port in the DSN
  support passwordless database
  Update documentation
  Put an example in the .env.example
  ...
  • Loading branch information
gabrielwolf committed Apr 23, 2019
2 parents 2b190f6 + 4e86bdd commit 26c32f2
Show file tree
Hide file tree
Showing 15 changed files with 358 additions and 318 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ DB_NAME=database_name
DB_USER=database_user
DB_PASSWORD=database_password

# Optionally, you can use a data source name (DSN)
# When using a DSN, you can remove the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST variables
# DATABASE_URL=mysql://database_user:database_password@database_host:database_port/database_name

# Optional variables
# DB_HOST=localhost
# DB_PREFIX=wp_
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/.gitattributes export-ignore
/.editorconfig export-ignore
/.travis.yml export-ignore
/dependencies.yml export-ignore
/phpcs.xml export-ignore
1 change: 0 additions & 1 deletion .github/CONTRIBUTING.md

This file was deleted.

62 changes: 0 additions & 62 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ Gruntfile.js

# Composer
/vendor

# WP-CLI
wp-cli.local.yml
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
sudo: false
language: php
php:
- 7.3
- 7.2
- 7.1
- 7.0
- 5.6
- nightly

matrix:
Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
### 1.12.3: 2019-03-13

* Update to WordPress 5.1.1 ([#426](https://github.com/roots/bedrock/pull/426))

### 1.12.2: 2019-02-21

* Update to WordPress 5.1 ([#420](https://github.com/roots/bedrock/pull/420))

### 1.12.1: 2019-02-14

* Update `vlucas/phpdotenv` ([#417](https://github.com/roots/bedrock/pull/417))
* Make DSN implementation more uniform ([#415](https://github.com/roots/bedrock/pull/415))

### 1.12.0: 2019-02-07

* Support database DSN ([#414](https://github.com/roots/bedrock/pull/414))
* Detect HTTPS if WordPress is behind a reverse proxy ([#413](https://github.com/roots/bedrock/pull/413))
* Update `vlucas/phpdotenv` to `^3` ([#412](https://github.com/roots/bedrock/pull/412))

### 1.11.1: 2019-01-09

* Update to WordPress 5.0.3 ([#408](https://github.com/roots/bedrock/pull/408))

### 1.11.0: 2018-12-19

* Bump PHP requirement to >= 7.1 ([#405](https://github.com/roots/bedrock/pull/405))

### 1.10.2: 2018-12-19

* Update to WordPress 5.0.2 ([#406](https://github.com/roots/bedrock/pull/406))

### 1.10.1: 2018-12-12

* Update to WordPress 5.0.1 ([#403](https://github.com/roots/bedrock/pull/403))

### 1.10.0: 2018-12-09

* Update to WordPress 5.0, switch from `johnpbloch/wordpress` to `roots/wordpress` package ([#395](https://github.com/roots/bedrock/pull/395))

### 1.9.0: 2018-09-17

* Fix error display in development environments ([c457082](https://github.com/roots/bedrock/commit/c457082cf4b153400d3e34f4f68a30eea4cc7c38))
Expand Down
74 changes: 0 additions & 74 deletions CODE_OF_CONDUCT.md

This file was deleted.

75 changes: 26 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,65 +76,39 @@ Much of the philosophy behind Bedrock is inspired by the [Twelve-Factor App](htt
## Features

* Better folder structure
* Dependency management with [Composer](http://getcomposer.org)
* Dependency management with [Composer](https://getcomposer.org)
* Easy WordPress configuration with environment specific files
* Environment variables with [Dotenv](https://github.com/vlucas/phpdotenv)
* Autoloader for mu-plugins (use regular plugins as mu-plugins)
* Enhanced security (separated web root and secure passwords with [wp-password-bcrypt](https://github.com/roots/wp-password-bcrypt))

Use [Trellis](https://github.com/roots/trellis) for additional features:

* Easy development environments with [Vagrant](http://www.vagrantup.com/)
* Easy server provisioning with [Ansible](http://www.ansible.com/) (Ubuntu 16.04, PHP 7.1, MariaDB)
* One-command deploys

See a complete working example in the [roots-example-project.com repo](https://github.com/roots/roots-example-project.com).

## Requirements

* PHP >= 5.6
* PHP >= 7.1
* Composer - [Install](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx)

## Installation

1. Create a new project in a new folder for your project:

`composer create-project roots/bedrock your-project-folder-name`

2. Update environment variables in `.env` file:
* `DB_NAME` - Database name
* `DB_USER` - Database user
* `DB_PASSWORD` - Database password
* `DB_HOST` - Database host
1. Create a new project:
```sh
$ composer create-project roots/bedrock
```
2. Update environment variables in the `.env` file:
* Database variables
* `DB_NAME` - Database name
* `DB_USER` - Database user
* `DB_PASSWORD` - Database password
* `DB_HOST` - Database host
* Optionally, you can define `DATABASE_URL` for using a DSN instead of using the variables above (e.g. `mysql://user:password@127.0.0.1:3306/db_name`)
* `WP_ENV` - Set to environment (`development`, `staging`, `production`)
* `WP_HOME` - Full URL to WordPress home (http://example.com)
* `WP_SITEURL` - Full URL to WordPress including subdirectory (http://example.com/wp)
* `WP_HOME` - Full URL to WordPress home (https://example.com)
* `WP_SITEURL` - Full URL to WordPress including subdirectory (https://example.com/wp)
* `AUTH_KEY`, `SECURE_AUTH_KEY`, `LOGGED_IN_KEY`, `NONCE_KEY`, `AUTH_SALT`, `SECURE_AUTH_SALT`, `LOGGED_IN_SALT`, `NONCE_SALT`

If you want to automatically generate the security keys (assuming you have wp-cli installed locally) you can use the very handy [wp-cli-dotenv-command][wp-cli-dotenv]:

wp package install aaemnnosttv/wp-cli-dotenv-command

wp dotenv salts regenerate

Or, you can cut and paste from the [Roots WordPress Salt Generator][roots-wp-salt].

3. Add theme(s) in `web/app/themes` as you would for a normal WordPress site.

4. Set your site vhost document root to `/path/to/site/web/` (`/path/to/site/current/web/` if using deploys)

5. Access WP admin at `http://example.com/wp/wp-admin`

## Deploys

There are two methods to deploy Bedrock sites out of the box:

* [Trellis](https://github.com/roots/trellis)
* [bedrock-capistrano](https://github.com/roots/bedrock-capistrano)

Any other deployment method can be used as well with one requirement:

`composer install` must be run as part of the deploy process.
* Generate with [wp-cli-dotenv-command](https://github.com/aaemnnosttv/wp-cli-dotenv-command)
* Generate with [our WordPress salts generator](https://roots.io/salts.html)
3. Add theme(s) in `web/app/themes/` as you would for a normal WordPress site
4. Set the document root on your webserver to Bedrock's `web` folder: `/path/to/site/web/`
5. Access WordPress admin at `https://example.com/wp/wp-admin/`
## Documentation
Expand All @@ -144,6 +118,12 @@ Bedrock documentation is available at [https://roots.io/bedrock/docs/](https://r
Contributions are welcome from everyone. We have [contributing guidelines](https://github.com/roots/guidelines/blob/master/CONTRIBUTING.md) to help you get started.
## Bedrock sponsors
Help support our open-source development efforts by [becoming a patron](https://www.patreon.com/rootsdev).
<a href="https://kinsta.com/?kaid=OFDHAJIXUDIV"><img src="https://cdn.roots.io/app/uploads/kinsta.svg" alt="Kinsta" width="200" height="150"></a> <a href="https://k-m.com/"><img src="https://cdn.roots.io/app/uploads/km-digital.svg" alt="KM Digital" width="200" height="150"></a> <a href="https://www.itineris.co.uk/"><img src="https://cdn.roots.io/app/uploads/itineris.svg" alt="itineris" width="200" height="150"></a>
## Community
Keep track of development and community news.
Expand All @@ -153,6 +133,3 @@ Keep track of development and community news.
* Read and subscribe to the [Roots Blog](https://roots.io/blog/)
* Subscribe to the [Roots Newsletter](https://roots.io/subscribe/)
* Listen to the [Roots Radio podcast](https://roots.io/podcast/)

[roots-wp-salt]:https://roots.io/salts.html
[wp-cli-dotenv]:https://github.com/aaemnnosttv/wp-cli-dotenv-command
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"keywords": [
"bedrock", "roots", "wordpress", "stack", "composer", "vagrant", "wp"
"bedrock", "composer", "roots", "wordpress", "wp", "wp-config"
],
"support": {
"issues": "https://github.com/roots/bedrock/issues",
Expand All @@ -33,13 +33,13 @@
}
],
"require": {
"php": ">=5.6",
"php": ">=7.1",
"composer/installers": "^1.4",
"vlucas/phpdotenv": "^2.0.1",
"johnpbloch/wordpress": "4.9.8",
"vlucas/phpdotenv": "^3.0.0",
"oscarotero/env": "^1.1.0",
"roots/wp-password-bcrypt": "1.0.0",
"roots/wp-config": "1.0.0"
"roots/wordpress": "5.1.1",
"roots/wp-config": "1.0.0",
"roots/wp-password-bcrypt": "1.0.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.0.2",
Expand Down
Loading

0 comments on commit 26c32f2

Please sign in to comment.