Skip to content

Commit e4e88d4

Browse files
authored
Merge pull request #1027 from xwp/release/dev-fix
Developer tooling fix and updates
2 parents 3b89025 + 32481b4 commit e4e88d4

File tree

6 files changed

+54
-6
lines changed

6 files changed

+54
-6
lines changed

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"EditorConfig.EditorConfig",
4+
"felixfbecker.php-debug",
5+
"ikappas.phpcs"
6+
]
7+
}

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Listen for Stream XDebug",
6+
"type": "php",
7+
"request": "launch",
8+
"port": 9000,
9+
"pathMappings": {
10+
"/var/www/html/wp-content/plugins/stream-src": "${workspaceRoot}",
11+
"/var/www/html/wp-content/plugins/stream": "${workspaceRoot}/build",
12+
"/var/www/html": "${workspaceRoot}/local/public"
13+
}
14+
}
15+
]
16+
}

contributing.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Stream uses [npm](https://npmjs.com) for javascript dependencies, [Composer](htt
77

88
Included is a local development environment built with [Docker](https://www.docker.com) which can be optionally run inside [Vagrant](https://www.vagrantup.com) for network isolation and better performance.
99

10-
1110
### Requirements
1211

1312
- [VirtualBox](https://www.virtualbox.org)
@@ -22,7 +21,6 @@ We suggest using the [Homebrew package manager](https://brew.sh) on macOS to ins
2221

2322
For setups with local Docker environment you don't need Vagrant and VirtualBox.
2423

25-
2624
### Environment Setup
2725

2826
1. See the [Git Flow](#git-flow) section below for how to fork the repository.
@@ -31,6 +29,13 @@ For setups with local Docker environment you don't need Vagrant and VirtualBox.
3129
4. Visit [stream.local](https://stream.local) and login using `admin` / `password`.
3230
5. Activate the Stream plugin.
3331

32+
### PHP Xdebug
33+
34+
The WordPress container includes the [Xdebug PHP extension](https://xdebug.org). It is configured to [autostart](https://xdebug.org/docs/remote#remote_autostart) and to [automatically detect the IP address of the connecting client](https://xdebug.org/docs/remote#remote_connect_back) running in your code editor. See [`.vscode/launch.json`](.vscode/launch.json) for the directory mapping from the WordPress container to the project directory in your code editor.
35+
36+
### Mail Catcher
37+
38+
We use a [MailHog](https://github.com/mailhog/MailHog) container to capture all emails sent by the WordPress container, available at [stream.local:8025](https://stream.local:8025).
3439

3540
### Scripts and Commands
3641

@@ -153,6 +158,6 @@ Please use the [git flow for pull requests](#git-flow) and follow [WordPress Cod
153158
git push origin <topic-branch-name>
154159
```
155160

156-
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) (with a clear title and description) to the `master` branch.
161+
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) (with a clear title and description) to the `develop` branch.
157162

158163
**IMPORTANT**: By submitting a patch, you agree to allow the project owner to license your work under the [GPL v2 license](https://www.gnu.org/licenses/gpl-2.0.html).

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ services:
2121
ports:
2222
- "80:80"
2323
- "443:443"
24+
- "9000:9000" # Xdebug
2425
volumes:
2526
- ./local/public:/var/www/html # Use host-mount to ensure correct permissions for all.
2627
- .:/var/www/html/wp-content/plugins/stream-src
2728
- ./build:/var/www/html/wp-content/plugins/stream
2829
- ./vendor/wordpress/wordpress/tests/phpunit:/var/www/html/tests/wordpress-phpunit
2930
- ./local/config/wp-tests-config.php:/var/www/html/tests/wordpress-phpunit/wp-tests-config.php
31+
- ./local/docker/wordpress/php.ini:/usr/local/etc/php/php.ini
3032
restart: always
3133
environment:
3234
APACHE_RUN_USER: "#1000" # Ensure Apache can write to the filesystem.
@@ -43,6 +45,13 @@ services:
4345
MYSQL_DATABASE: "wordpress_test"
4446
MYSQL_ROOT_PASSWORD: ""
4547

48+
# Capture and display all email sent by WordPress.
49+
mailhog:
50+
image: mailhog/mailhog
51+
ports:
52+
- "1025:1025"
53+
- "8025:8025"
54+
4655
volumes:
4756
db_data: {}
4857
wp_data: {}

local/docker/wordpress/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ENV PATH="/var/www/html/wp-content/plugins/stream-src/vendor/bin:${PATH}"
66
RUN apt-get update; \
77
apt-get install -y --no-install-recommends \
88
# WP-CLI dependencies.
9-
bash less mysql-client git \
10-
# Mailcatcher dependencies.
11-
ssmtp;
9+
bash less default-mysql-client git \
10+
# MailHog dependencies.
11+
msmtp;
1212

1313
# Setup xdebug.
1414
RUN pecl install xdebug; \

local/docker/wordpress/php.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
upload_max_filesize = 64M
2+
post_max_size = 64M
3+
4+
# Forward mail to the MailHog container.
5+
sendmail_path = "/usr/bin/msmtp --host=mailhog --port=1025 [email protected] --read-recipients"
6+
7+
# Enable remote Xdebug.
8+
xdebug.remote_enable = 1
9+
xdebug.remote_autostart = 1
10+
xdebug.remote_connect_back = 1
11+
xdebug.scream = 1

0 commit comments

Comments
 (0)