WordPress.org

Make WordPress Core

Ticket #48060: 48060.diff

File 48060.diff, 2.1 KB (added by pierlo, 17 months ago)
  • .gitignore

    diff --git .gitignore .gitignore
    index 2f4d4eb9d2..58d4d852c2 100644
    wp-tests-config.php 
    7676
    7777# Files for local environment config
    7878/docker-compose.override.yml
     79
     80# Files for mail debugging
     81mail/mail-*.txt
  • docker-compose.yml

    diff --git docker-compose.yml docker-compose.yml
    index 520dcb3383..f5d5b9d93c 100644
    services: 
    4242
    4343    volumes:
    4444      - ./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
    4546      - ./:/var/www
    4647
    4748    depends_on:
    services: 
    102103
    103104    volumes:
    104105      - ./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
    105107      - ./:/var/www
    106108      - phpunit-uploads:/var/www/${LOCAL_DIR-src}/wp-content/uploads
    107109
  • new file tools/local-env/mailtodisk.php

    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
     5const MAIL_PATH = '/var/www/mail/';
     6
     7if ( !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
     16while ( is_file( $filename ) ) {
     17        $filename = MAIL_PATH . "mail-{$date}-" . ++$retry . '.txt';
     18}
     19
     20file_put_contents( $filename, $input );
  • tools/local-env/php-config.ini

    diff --git tools/local-env/php-config.ini tools/local-env/php-config.ini
    index 1f385e924c..9a6bd7064f 100644
     
    11upload_max_filesize = 1G
    22post_max_size = 1G
     3
     4sendmail_path = /usr/bin/env mailtodisk
  • tools/local-env/phpunit-config.ini

    diff --git tools/local-env/phpunit-config.ini tools/local-env/phpunit-config.ini
    index bf4788b33d..edc76ccaa0 100644
    post_max_size = 1G 
    44opcache.enable = 1
    55opcache.enable_cli = 1
    66opache.file_cache = /tmp/php-opcache
     7
     8sendmail_path = /usr/bin/env mailtodisk