diff --git .gitignore .gitignore
index 2f4d4eb9d2..58d4d852c2 100644
|
|
wp-tests-config.php |
76 | 76 | |
77 | 77 | # Files for local environment config |
78 | 78 | /docker-compose.override.yml |
| 79 | |
| 80 | # Files for mail debugging |
| 81 | mail/mail-*.txt |
diff --git docker-compose.yml docker-compose.yml
index 520dcb3383..f5d5b9d93c 100644
|
|
services: |
42 | 42 | |
43 | 43 | volumes: |
44 | 44 | - ./tools/local-env/php-config.ini:/usr/local/etc/php/conf.d/php-config.ini |
| 45 | - ./tools/local-env/mailtodisk.php:/usr/local/bin/mailtodisk |
45 | 46 | - ./:/var/www |
46 | 47 | |
47 | 48 | depends_on: |
… |
… |
services: |
102 | 103 | |
103 | 104 | volumes: |
104 | 105 | - ./tools/local-env/phpunit-config.ini:/usr/local/etc/php/conf.d/phpunit-config.ini |
| 106 | - ./tools/local-env/mailtodisk.php:/usr/local/bin/mailtodisk |
105 | 107 | - ./:/var/www |
106 | 108 | - phpunit-uploads:/var/www/${LOCAL_DIR-src}/wp-content/uploads |
107 | 109 | |
diff --git tools/local-env/mailtodisk.php tools/local-env/mailtodisk.php
new file mode 100755
index 0000000000..e7afc409fd
-
|
+
|
|
| 1 | #!/usr/local/bin/php |
| 2 | |
| 3 | <?php |
| 4 | |
| 5 | const MAIL_PATH = '/var/www/mail/'; |
| 6 | |
| 7 | if ( !is_dir( MAIL_PATH ) ) { |
| 8 | mkdir( MAIL_PATH ); |
| 9 | } |
| 10 | |
| 11 | $input = file_get_contents( 'php://stdin' ); |
| 12 | $date = gmdate( 'Ymd-Hi-s' ); |
| 13 | $filename = MAIL_PATH . "mail-{$date}.txt"; |
| 14 | $retry = 0; |
| 15 | |
| 16 | while ( is_file( $filename ) ) { |
| 17 | $filename = MAIL_PATH . "mail-{$date}-" . ++$retry . '.txt'; |
| 18 | } |
| 19 | |
| 20 | file_put_contents( $filename, $input ); |
diff --git tools/local-env/php-config.ini tools/local-env/php-config.ini
index 1f385e924c..9a6bd7064f 100644
|
|
|
1 | 1 | upload_max_filesize = 1G |
2 | 2 | post_max_size = 1G |
| 3 | |
| 4 | sendmail_path = /usr/bin/env mailtodisk |
diff --git tools/local-env/phpunit-config.ini tools/local-env/phpunit-config.ini
index bf4788b33d..edc76ccaa0 100644
|
|
post_max_size = 1G |
4 | 4 | opcache.enable = 1 |
5 | 5 | opcache.enable_cli = 1 |
6 | 6 | opache.file_cache = /tmp/php-opcache |
| 7 | |
| 8 | sendmail_path = /usr/bin/env mailtodisk |