<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[50251] branches/3.7: Build/Test Tools: Backport the local Docker environment to the 3.7 branch.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/50251">50251</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/50251","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>desrosj</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2021-02-08 20:58:53 +0000 (Mon, 08 Feb 2021)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Build/Test Tools: Backport the local Docker environment to the 3.7 branch.
This commit introduces the Docker-based local WordPress development environment to the 3.7 branch.
Merges [44176,45445,45745,45762,45783-45784,45800,45819,45885,46320,46999,47225,47912,48121,49267,49335,49358,49360,49362] to the 3.7 branch.
See <a href="https://core.trac.wordpress.org/ticket/47767">#47767</a>.
Fixes <a href="https://core.trac.wordpress.org/ticket/48301">#48301</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branches37packagelockjson">branches/3.7/package-lock.json</a></li>
<li><a href="#branches37packagejson">branches/3.7/package.json</a></li>
<li><a href="#branches37testsphpunittestsimagebasephp">branches/3.7/tests/phpunit/tests/image/base.php</a></li>
<li><a href="#branches37testsphpunittestsimageeditor_gdphp">branches/3.7/tests/phpunit/tests/image/editor_gd.php</a></li>
<li><a href="#branches37testsphpunittestsimageeditor_imagickphp">branches/3.7/tests/phpunit/tests/image/editor_imagick.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branches37env">branches/3.7/.env</a></li>
<li><a href="#branches37dockercomposeyml">branches/3.7/docker-compose.yml</a></li>
<li>branches/3.7/tools/local-env/</li>
<li><a href="#branches37toolslocalenvdefaulttemplate">branches/3.7/tools/local-env/default.template</a></li>
<li><a href="#branches37toolslocalenvmysqlinitsql">branches/3.7/tools/local-env/mysql-init.sql</a></li>
<li><a href="#branches37toolslocalenvphpconfigini">branches/3.7/tools/local-env/php-config.ini</a></li>
<li><a href="#branches37toolslocalenvphpunitconfigini">branches/3.7/tools/local-env/phpunit-config.ini</a></li>
<li>branches/3.7/tools/local-env/scripts/</li>
<li><a href="#branches37toolslocalenvscriptsdockerjs">branches/3.7/tools/local-env/scripts/docker.js</a></li>
<li><a href="#branches37toolslocalenvscriptsinstalljs">branches/3.7/tools/local-env/scripts/install.js</a></li>
<li><a href="#branches37toolslocalenvscriptsstartjs">branches/3.7/tools/local-env/scripts/start.js</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#branches37">branches/3.7/</a></li>
<li><a href="#branches37src">branches/3.7/src/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<span class="cx" style="display: block; padding: 0 10px">Index: branches/3.7
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- branches/3.7 2021-02-08 20:57:54 UTC (rev 50250)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ branches/3.7 2021-02-08 20:58:53 UTC (rev 50251)
</ins><a id="branches37"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: branches/3.7</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: svn:mergeinfo</h4></div>
<span class="cx" style="display: block; padding: 0 10px"> /branches/4.6:38615,41414
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/4.8:42478
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/4.9:42434,49653
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/branches/5.0:43684-43686,43853,43988,43994,44014,44017,44047
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/branches/5.0:43684-43686,43836,43853,43988,43994,44014,44017,44047
</ins><span class="cx" style="display: block; padding: 0 10px"> /branches/5.5:49373-49379,49381
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/trunk:25882-25884,25889,25891,25893,25895,25897,25899,25902,25915,25921,25923,25925,25929,25933,25954,25956,25974-25975,25977,25986,26014,26016-26017,26087,26091,26095,26148-26149,26186,26252,26304-26305,26307,26318,26448-26449,26512,26705,26734,26782,26871,26909-26910,26927,26940,27053,27086,27168,27299,27385,27721,27848,27872,27905-27906,27928,27964,27975,27990,28053,28113,28129,28796,28799,28873,28943,28961,28964,28966-28967,29120,29251,29270,29327,29378,29381-29382,29397,29404,29503,29631,29783,29860,29869,29954,30001,30060,30062-30063,30066,30282,30285,30289-30291,30337,30412,30417,30425,30430,30438,30443,30458,30466,30513-30514,30516-30521,30524,30526,30529-30530,31253-31254,31257-31259,31557,31622,31650,32356,32988,33124,33142,33726,35513,35521,35538,35540-35541,36083,36435,36861-36865,37019-37020,37212,37612,37651,38111,38524,38757,39113,39115-39117,39360-39361,39478,39645,39659
,39759,39795,39807-39808,39831,39850,39956,40148,40169,40183,40241,40255,40257,40259,40269,40271,40400,40446,40449,40457,40538,40604,40677,40692,40704,40723,40736,40833,41082,41303,41306,41393,41398,41457,41470,41483,41496,41522,41662,42056,42119-42120,42258-42261,42424,42433,42460-42461,42887,42892-42893,42989,43320,43323,43511-43512,43977,44021,44048,44219,44842,44993,45446,45765,45936,45971,45997,46408-46409,46474-46478,46483,46485,46682,46895,46996,47341,47867,47872,47947-47951,48241,48705,49380,49382-49388,49636,49876,49933,49939,50185
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/trunk:25882-25884,25889,25891,25893,25895,25897,25899,25902,25915,25921,25923,25925,25929,25933,25954,25956,25974-25975,25977,25986,26014,26016-26017,26087,26091,26095,26148-26149,26186,26252,26304-26305,26307,26318,26448-26449,26512,26705,26734,26782,26871,26909-26910,26927,26940,27053,27086,27168,27299,27385,27721,27848,27872,27905-27906,27928,27964,27975,27990,28053,28113,28129,28796,28799,28873,28943,28961,28964,28966-28967,29120,29251,29270,29327,29378,29381-29382,29397,29404,29503,29631,29783,29860,29869,29954,30001,30060,30062-30063,30066,30282,30285,30289-30291,30337,30412,30417,30425,30430,30438,30443,30458,30466,30513-30514,30516-30521,30524,30526,30529-30530,31253-31254,31257-31259,31557,31622,31650,32356,32988,33124,33142,33726,35513,35521,35538,35540-35541,36083,36435,36861-36865,37019-37020,37212,37612,37651,38111,38524,38757,39113,39115-39117,39360-39361,39478,39645,39659
,39759,39795,39807-39808,39831,39850,39956,40148,40169,40183,40241,40255,40257,40259,40269,40271,40400,40446,40449,40457,40538,40604,40677,40692,40704,40723,40736,40833,41082,41303,41306,41393,41398,41457,41470,41483,41496,41522,41662,42056,42119-42120,42258-42261,42424,42433,42460-42461,42887,42892-42893,42989,43320,43323,43511-43512,43977,44021,44048,44176,44219,44842,44993,45445-45446,45745,45762,45765,45783-45784,45800,45819,45885,45936,45971,45997,46320,46408-46409,46474-46478,46483,46485,46682,46895,46996,46999,47225,47341,47867,47872,47912,47947-47951,48121,48241,48705,49267,49335,49358,49360,49362,49380,49382-49388,49636,49876,49933,49939,50185
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="branches37env"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: branches/3.7/.env</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/.env (rev 0)
+++ branches/3.7/.env 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,59 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+##
+# Default configuration options for the local dev environment.
+#
+# All of these options can be overridden by setting them as environment variables before starting
+# the environment. You will need to restart your environment when changing any of these.
+#
+# Below, the following substitutions can be made:
+# - '{version}': any major.minor PHP version from 5.2 onwards.
+# - '{phpunit_version}': any major PHPUnit version starting with 4.
+##
+
+# The site will be available at http://localhost:LOCAL_PORT
+LOCAL_PORT=8889
+
+# Where to run WordPress from. Valid options are 'src' and 'build'.
+LOCAL_DIR=src
+
+# The PHP version to use. Valid options are 'latest', and '{version}-fpm'.
+LOCAL_PHP=5.5-fpm
+
+##
+# The PHPUnit version to use when running tests.
+#
+# Support for new PHPUnit versions is not backported to past versions, so some old WordPress branches require an older
+# version to run tests.
+#
+# Valid versions are:
+# - 'latest' for the highest version of PHPUnit supported on the highest version of PHP supported.
+# - '{version}-fpm' for the highest version of PHPUnit supported on the specified version of PHP.
+# - '{phpunit_version}-php-{version}-fpm' for a specific version of PHPUnit on the specified version of PHP. This format
+# is only available for PHP versions 5.6 and higher.
+#
+# For the full list of available options, see https://hub.docker.com/r/wordpressdevelop/phpunit/tags.
+#
+# For full documentation on PHPUnit compatibility and WordPress versions, see
+# https://make.wordpress.org/core/handbook/references/phpunit-compatibility-and-wordpress-versions/.
+#
+# This defaults to the value assigned to the value of LOCAL_PHP.
+##
+LOCAL_PHPUNIT=${LOCAL_PHP}
+
+# Whether or not to enable XDebug.
+LOCAL_PHP_XDEBUG=false
+
+# Whether or not to enable Memcached.
+LOCAL_PHP_MEMCACHED=false
+
+# The MySQL version to use. See https://hub.docker.com/_/mysql/ for valid versions.
+LOCAL_MYSQL=5.6
+
+# The debug settings to add to `wp-config.php`.
+LOCAL_WP_DEBUG=true
+LOCAL_WP_DEBUG_LOG=true
+LOCAL_WP_DEBUG_DISPLAY=true
+LOCAL_SCRIPT_DEBUG=true
+LOCAL_WP_ENVIRONMENT_TYPE=local
+
+# The URL to use when running e2e tests.
+WP_BASE_URL=http://localhost:${LOCAL_PORT}
</ins></span></pre></div>
<a id="branches37dockercomposeyml"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: branches/3.7/docker-compose.yml</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/docker-compose.yml (rev 0)
+++ branches/3.7/docker-compose.yml 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,136 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+version: '3.7'
+
+services:
+
+ ##
+ # The web server container.
+ ##
+ wordpress-develop:
+ image: nginx:alpine
+
+ networks:
+ - wpdevnet
+
+ ports:
+ - ${LOCAL_PORT-8889}:80
+
+ environment:
+ LOCAL_DIR: ${LOCAL_DIR-src}
+
+ volumes:
+ - ./tools/local-env/default.template:/etc/nginx/conf.d/default.template
+ - ./:/var/www
+
+ # Load our config file, substituting environment variables into the config.
+ command: /bin/sh -c "envsubst '$$LOCAL_DIR' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
+
+ depends_on:
+ - php
+
+ ##
+ # The PHP container.
+ ##
+ php:
+ image: wordpressdevelop/php:${LOCAL_PHP-5.5-fpm}
+
+ networks:
+ - wpdevnet
+
+ environment:
+ LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false}
+ LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false}
+ PHP_FPM_UID: ${PHP_FPM_UID-1000}
+ PHP_FPM_GID: ${PHP_FPM_GID-1000}
+
+ volumes:
+ - ./tools/local-env/php-config.ini:/usr/local/etc/php/conf.d/php-config.ini
+ - ./:/var/www
+
+ depends_on:
+ - mysql
+
+ ##
+ # The MySQL container.
+ ##
+ mysql:
+ image: mysql:${LOCAL_MYSQL-5.7}
+
+ networks:
+ - wpdevnet
+
+ ports:
+ - "3306"
+
+ environment:
+ MYSQL_ROOT_PASSWORD: password
+
+ volumes:
+ - ./tools/local-env/mysql-init.sql:/docker-entrypoint-initdb.d/mysql-init.sql
+ - mysql:/var/lib/mysql
+
+ # For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0.
+ command: --default-authentication-plugin=mysql_native_password
+
+ ##
+ # The WP CLI container.
+ ##
+ cli:
+ image: wordpressdevelop/cli:${LOCAL_PHP-5.5-fpm}
+
+ networks:
+ - wpdevnet
+
+ environment:
+ LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false}
+ LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false}
+ PHP_FPM_UID: ${PHP_FPM_UID-1000}
+ PHP_FPM_GID: ${PHP_FPM_GID-1000}
+
+ volumes:
+ - ./:/var/www
+
+ # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
+ init: true
+
+ ##
+ # The PHPUnit container.
+ ##
+ phpunit:
+ image: wordpressdevelop/phpunit:${LOCAL_PHPUNIT-5.5-fpm}
+
+ networks:
+ - wpdevnet
+
+ environment:
+ LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false}
+ LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false}
+ LOCAL_DIR: ${LOCAL_DIR-src}
+ WP_MULTISITE: ${WP_MULTISITE-false}
+ PHP_FPM_UID: ${PHP_FPM_UID-1000}
+ PHP_FPM_GID: ${PHP_FPM_GID-1000}
+ TRAVIS_BRANCH: ${TRAVIS_BRANCH-false}
+ TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST-false}
+ GITHUB_REF: ${GITHUB_REF-false}
+ GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME-false}
+
+ volumes:
+ - ./tools/local-env/phpunit-config.ini:/usr/local/etc/php/conf.d/phpunit-config.ini
+ - ./:/var/www
+ - phpunit-uploads:/var/www/${LOCAL_DIR-src}/wp-content/uploads
+
+ # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
+ init: true
+
+ depends_on:
+ - mysql
+
+volumes:
+ # So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume.
+ mysql: {}
+ # Using a volume for the uploads directory improves PHPUnit performance.
+ phpunit-uploads: {}
+
+networks:
+ # Creating our own network allows us to connect between containers using their service name.
+ wpdevnet:
+ driver: bridge
</ins></span></pre></div>
<a id="branches37packagelockjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/3.7/package-lock.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/package-lock.json 2021-02-08 20:57:54 UTC (rev 50250)
+++ branches/3.7/package-lock.json 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,6 +4,42 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "lockfileVersion": 1,
</span><span class="cx" style="display: block; padding: 0 10px"> "requires": true,
</span><span class="cx" style="display: block; padding: 0 10px"> "dependencies": {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "@hapi/hoek": {
+ "version": "9.1.1",
+ "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.1.1.tgz",
+ "integrity": "sha512-CAEbWH7OIur6jEOzaai83jq3FmKmv4PmX1JYfs9IrYcGEVI/lyL1EXJGCj7eFVJ0bg5QR8LMxBlEtA+xKiLpFw==",
+ "dev": true
+ },
+ "@hapi/topo": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.0.0.tgz",
+ "integrity": "sha512-tFJlT47db0kMqVm3H4nQYgn6Pwg10GTZHb1pwmSiv1K4ks6drQOtfEF5ZnPjkvC+y4/bUPHK+bc87QvLcL+WMw==",
+ "dev": true,
+ "requires": {
+ "@hapi/hoek": "^9.0.0"
+ }
+ },
+ "@sideway/address": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.1.tgz",
+ "integrity": "sha512-+I5aaQr3m0OAmMr7RQ3fR9zx55sejEYR2BFJaxL+zT3VM2611X0SHvPWIbAUBZVTn/YzYKbV8gJ2oT/QELknfQ==",
+ "dev": true,
+ "requires": {
+ "@hapi/hoek": "^9.0.0"
+ }
+ },
+ "@sideway/formula": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz",
+ "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==",
+ "dev": true
+ },
+ "@sideway/pinpoint": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz",
+ "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==",
+ "dev": true
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> "@types/node": {
</span><span class="cx" style="display: block; padding: 0 10px"> "version": "14.14.22",
</span><span class="cx" style="display: block; padding: 0 10px"> "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.22.tgz",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -234,6 +270,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==",
</span><span class="cx" style="display: block; padding: 0 10px"> "dev": true
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "axios": {
+ "version": "0.21.1",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
+ "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
+ "dev": true,
+ "requires": {
+ "follow-redirects": "^1.10.0"
+ }
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> "balanced-match": {
</span><span class="cx" style="display: block; padding: 0 10px"> "version": "1.0.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -679,6 +724,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=",
</span><span class="cx" style="display: block; padding: 0 10px"> "dev": true
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "dotenv": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
+ "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==",
+ "dev": true
+ },
+ "dotenv-expand": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz",
+ "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==",
+ "dev": true
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> "duplexer": {
</span><span class="cx" style="display: block; padding: 0 10px"> "version": "0.1.2",
</span><span class="cx" style="display: block; padding: 0 10px"> "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1037,6 +1094,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==",
</span><span class="cx" style="display: block; padding: 0 10px"> "dev": true
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "follow-redirects": {
+ "version": "1.13.2",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.2.tgz",
+ "integrity": "sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==",
+ "dev": true
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> "for-in": {
</span><span class="cx" style="display: block; padding: 0 10px"> "version": "1.0.2",
</span><span class="cx" style="display: block; padding: 0 10px"> "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2056,6 +2119,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
</span><span class="cx" style="display: block; padding: 0 10px"> "dev": true
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "joi": {
+ "version": "17.4.0",
+ "resolved": "https://registry.npmjs.org/joi/-/joi-17.4.0.tgz",
+ "integrity": "sha512-F4WiW2xaV6wc1jxete70Rw4V/VuMd6IN+a5ilZsxG4uYtUXWu2kq9W5P2dz30e7Gmw8RCbY/u/uk+dMPma9tAg==",
+ "dev": true,
+ "requires": {
+ "@hapi/hoek": "^9.0.0",
+ "@hapi/topo": "^5.0.0",
+ "@sideway/address": "^4.1.0",
+ "@sideway/formula": "^3.0.0",
+ "@sideway/pinpoint": "^2.0.0"
+ }
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> "js-yaml": {
</span><span class="cx" style="display: block; padding: 0 10px"> "version": "3.14.1",
</span><span class="cx" style="display: block; padding: 0 10px"> "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2361,6 +2437,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "brace-expansion": "^1.1.7"
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "minimist": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
+ "dev": true
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> "mitt": {
</span><span class="cx" style="display: block; padding: 0 10px"> "version": "2.1.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "resolved": "https://registry.npmjs.org/mitt/-/mitt-2.1.0.tgz",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3362,6 +3444,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "punycode": "^2.1.1"
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "dev": true
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> "tunnel-agent": {
</span><span class="cx" style="display: block; padding: 0 10px"> "version": "0.6.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3520,6 +3608,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "extsprintf": "^1.2.0"
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "wait-on": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-5.2.1.tgz",
+ "integrity": "sha512-H2F986kNWMU9hKlI9l/ppO6tN8ZSJd35yBljMLa1/vjzWP++Qh6aXyt77/u7ySJFZQqBtQxnvm/xgG48AObXcw==",
+ "dev": true,
+ "requires": {
+ "axios": "^0.21.1",
+ "joi": "^17.3.0",
+ "lodash": "^4.17.20",
+ "minimist": "^1.2.5",
+ "rxjs": "^6.6.3"
+ },
+ "dependencies": {
+ "rxjs": {
+ "version": "6.6.3",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz",
+ "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.9.0"
+ }
+ }
+ }
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> "websocket-driver": {
</span><span class="cx" style="display: block; padding: 0 10px"> "version": "0.7.4",
</span><span class="cx" style="display: block; padding: 0 10px"> "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz",
</span></span></pre></div>
<a id="branches37packagejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/3.7/package.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/package.json 2021-02-08 20:57:54 UTC (rev 50250)
+++ branches/3.7/package.json 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,6 +13,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "author": "The WordPress Contributors",
</span><span class="cx" style="display: block; padding: 0 10px"> "license": "GPLv2 or later",
</span><span class="cx" style="display: block; padding: 0 10px"> "devDependencies": {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "dotenv": "^8.2.0",
+ "dotenv-expand": "^5.1.0",
</ins><span class="cx" style="display: block; padding: 0 10px"> "grunt": "~1.3.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "grunt-contrib-clean": "~2.0.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "grunt-contrib-compress": "~2.0.0",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,6 +26,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "grunt-contrib-watch": "~1.1.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "grunt-legacy-util": "^2.0.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "grunt-patch-wordpress": "~3.0.0",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "matchdep": "~2.0.0"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "matchdep": "~2.0.0",
+ "wait-on": "5.2.1"
+ },
+ "scripts": {
+ "build": "grunt build",
+ "test": "grunt test",
+ "watch": "grunt watch",
+ "grunt": "grunt",
+ "env:start": "node ./tools/local-env/scripts/start.js",
+ "env:stop": "node ./tools/local-env/scripts/docker.js down",
+ "env:restart": "npm run env:stop && npm run env:start",
+ "env:clean": "node ./tools/local-env/scripts/docker.js down -v --remove-orphans",
+ "env:reset": "node ./tools/local-env/scripts/docker.js down --rmi all -v --remove-orphans",
+ "env:install": "node ./tools/local-env/scripts/install.js",
+ "env:cli": "node ./tools/local-env/scripts/docker.js run cli",
+ "env:logs": "node ./tools/local-env/scripts/docker.js logs",
+ "env:pull": "node ./tools/local-env/scripts/docker.js pull",
+ "test:php": "node ./tools/local-env/scripts/docker.js run --rm phpunit phpunit"
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">Index: branches/3.7/src
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- branches/3.7/src 2021-02-08 20:57:54 UTC (rev 50250)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ branches/3.7/src 2021-02-08 20:58:53 UTC (rev 50251)
</ins></span></pre></div>
<a id="branches37src"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: branches/3.7/src</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: svn:mergeinfo</h4></div>
<span class="cx" style="display: block; padding: 0 10px"> /branches/4.8/src:42478
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/4.9/src:42434,49653
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/5.0/src:43988,43994,44014,44017,44047
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/trunk/src:18512,25880,25882-25884,25889,25891,25893,25895,25897,25899,25902,25915,25921,25923,25925,25929,25933,25954,25956,25974-25975,25977,25986,26087,26091,26095,26149,26252,26307,26318,26449,26512,26705,26871,26909-26910,26940,27053,27086,27168,27299,27385,27721,27848,27906,27928,28113,28129,28796,28799,28873,28943,28961,28964,28966-28967,29120,29251,29270,29503,29783,29860,29869,29954,30001,30060,30062-30063,30066,30282,30285,30289-30291,30513-30514,30516-30521,30524,30526,30529-30530,31253-31254,31257-31259,31557,31622,31650,32356,32988,33124,33142,33726,35513,35521,35538,35540-35541,36083,36435,36861-36865,37019-37020,37212,37612,37651,38111,38524,38757,39113,39115-39117,39478,39645,39659,39759,39795,39807-39808,39831,39850,39956,40148,40169,40183,40241,40255,40257,40259,40269,40271,40400,40446,40449,40457,40538,40604,40677,40692,40704,40723,40736,40833,41082,41303,41306,41393,4
1398,41457,41470,41483,41496,41522,41662,42056,42119-42120,42258-42261,42424,42460-42461,42887,42892-42893,42989,43320,43323,43511-43512,43977,44021,44048,44219,44842,44993,45446,45765,45936,45971,45997,46408-46409,46474-46478,46483,46485,46682,46895,46996,47341,47867,47872,47947-47951,48241,48705,49380,49382-49388,49636,49876,49933,49939,50185
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/trunk/src:18512,25880,25882-25884,25889,25891,25893,25895,25897,25899,25902,25915,25921,25923,25925,25929,25933,25954,25956,25974-25975,25977,25986,26087,26091,26095,26149,26252,26307,26318,26449,26512,26705,26871,26909-26910,26940,27053,27086,27168,27299,27385,27721,27848,27906,27928,28113,28129,28796,28799,28873,28943,28961,28964,28966-28967,29120,29251,29270,29503,29783,29860,29869,29954,30001,30060,30062-30063,30066,30282,30285,30289-30291,30513-30514,30516-30521,30524,30526,30529-30530,31253-31254,31257-31259,31557,31622,31650,32356,32988,33124,33142,33726,35513,35521,35538,35540-35541,36083,36435,36861-36865,37019-37020,37212,37612,37651,38111,38524,38757,39113,39115-39117,39478,39645,39659,39759,39795,39807-39808,39831,39850,39956,40148,40169,40183,40241,40255,40257,40259,40269,40271,40400,40446,40449,40457,40538,40604,40677,40692,40704,40723,40736,40833,41082,41303,41306,41393,4
1398,41457,41470,41483,41496,41522,41662,42056,42119-42120,42258-42261,42424,42460-42461,42887,42892-42893,42989,43320,43323,43511-43512,43977,44021,44048,44176,44219,44842,44993,45445-45446,45745,45762,45765,45783-45784,45800,45819,45885,45936,45971,45997,46320,46408-46409,46474-46478,46483,46485,46682,46895,46996,46999,47225,47341,47867,47872,47912,47947-47951,48121,48241,48705,49267,49335,49358,49360,49362,49380,49382-49388,49636,49876,49933,49939,50185
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="branches37testsphpunittestsimagebasephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/3.7/tests/phpunit/tests/image/base.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/tests/phpunit/tests/image/base.php 2021-02-08 20:57:54 UTC (rev 50250)
+++ branches/3.7/tests/phpunit/tests/image/base.php 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,12 +7,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Set the image editor engine according to the unit test's specification
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- */
- public function setUp() {
- parent::setUp();
-
- if ( ! call_user_func( array( $this->editor_engine, 'test' ) ) ) {
- $this->markTestSkipped( sprintf('The image editor engine %s is not supported on this system', $this->editor_engine) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ */
+ public function setUp() {
+ parent::setUp();
+
+ if ( ! call_user_func( array( $this->editor_engine, 'test' ) ) ) {
+ $this->markTestSkipped( sprintf('The image editor engine %s is not supported on this system', $this->editor_engine) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,14 +20,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Undo the image editor override
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- */
- public function tearDown() {
- parent::tearDown();
-
- remove_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 );
- parent::tearDown();
- }
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ */
+ public function tearDown() {
+ parent::tearDown();
+
+ remove_filter( 'wp_image_editors', array( $this, 'setEngine' ), 10, 2 );
+ parent::tearDown();
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Override the image editor engine
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,14 +36,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return array( $this->editor_engine );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Helper assertion for testing alpha on images
- *
- * @param string $image_path
- * @param array $point array(x,y)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Helper assertion for testing alpha on images using GD library
+ *
+ * @param string $image_path
+ * @param array $point array(x,y)
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $alpha
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- protected function assertImageAlphaAtPoint( $image_path, $point, $alpha ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected function assertImageAlphaAtPointGD( $image_path, $point, $alpha ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $im = imagecreatefrompng( $image_path );
</span><span class="cx" style="display: block; padding: 0 10px"> $rgb = imagecolorat($im, $point[0], $point[1]);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,4 +52,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEquals( $alpha, $colors['alpha'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * Helper assertion for testing alpha on images using Imagick
+ *
+ * @param string $image_path
+ * @param array $point array(x,y)
+ * @param int $expected
+ */
+ protected function assertImageAlphaAtPointImagick( $image_path, $point, $expected ) {
+ $im = new Imagick( $image_path );
+ $pixel = $im->getImagePixelColor( $point[0], $point[1] );
+ $color = $pixel->getColorValue( imagick::COLOR_ALPHA );
+ $this->assertEquals( $expected, $color );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="branches37testsphpunittestsimageeditor_gdphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/3.7/tests/phpunit/tests/image/editor_gd.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/tests/phpunit/tests/image/editor_gd.php 2021-02-08 20:57:54 UTC (rev 50250)
+++ branches/3.7/tests/phpunit/tests/image/editor_gd.php 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,11 +4,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Test the WP_Image_Editor_GD class
</span><span class="cx" style="display: block; padding: 0 10px"> * @group image
</span><span class="cx" style="display: block; padding: 0 10px"> * @group media
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @group wp-image-editor-gd
- */
-require_once( dirname( __FILE__ ) . '/base.php' );
-
-class Tests_Image_Editor_GD extends WP_Image_UnitTestCase {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @group wp-image-editor-gd
+ */
+require_once( dirname( __FILE__ ) . '/base.php' );
+
+class Tests_Image_Editor_GD extends WP_Image_UnitTestCase {
</ins><span class="cx" style="display: block; padding: 0 10px"> public $editor_engine = 'WP_Image_Editor_GD';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function setup() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -29,10 +29,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> parent::tearDown();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Check support for GD compatible mime types.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_supports_mime_type() {
</span><span class="cx" style="display: block; padding: 0 10px"> $gd_image_editor = new WP_Image_Editor_GD( null );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,7 +44,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Test resizing an image, not using crop
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_resize() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,7 +60,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Test resizing an image including cropping
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_resize_and_crop() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,7 +132,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Test the image created with WP_Image_Edior_GD preserves alpha when resizing
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @ticket 23039
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_image_preserves_alpha_on_resize() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,17 +143,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $editor->load();
</span><span class="cx" style="display: block; padding: 0 10px"> $editor->resize(5,5);
</span><span class="cx" style="display: block; padding: 0 10px"> $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $editor->save( $save_to_file );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
-
- unlink( $save_to_file );
- }
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertImageAlphaAtPointGD( $save_to_file, array( 0,0 ), 127 );
+
+ unlink( $save_to_file );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Test the image created with WP_Image_Edior_GD preserves alpha with no resizing etc
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @ticket 23039
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_image_preserves_alpha() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,12 +164,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $editor->load();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $editor->save( $save_to_file );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
-
- unlink( $save_to_file );
- }
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $this->assertImageAlphaAtPointGD( $save_to_file, array( 0,0 ), 127 );
+
+ unlink( $save_to_file );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="branches37testsphpunittestsimageeditor_imagickphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: branches/3.7/tests/phpunit/tests/image/editor_imagick.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/tests/phpunit/tests/image/editor_imagick.php 2021-02-08 20:57:54 UTC (rev 50250)
+++ branches/3.7/tests/phpunit/tests/image/editor_imagick.php 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,12 +4,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Test the WP_Image_Editor_Imagick class
</span><span class="cx" style="display: block; padding: 0 10px"> * @group image
</span><span class="cx" style="display: block; padding: 0 10px"> * @group media
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @group wp-image-editor-imagick
- */
-require_once( dirname( __FILE__ ) . '/base.php' );
-
-class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @group wp-image-editor-imagick
+ */
+require_once( dirname( __FILE__ ) . '/base.php' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase {
+
</ins><span class="cx" style="display: block; padding: 0 10px"> public $editor_engine = 'WP_Image_Editor_Imagick';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function setup() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,10 +35,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> parent::tearDown();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Check support for Image Magick compatible mime types.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_supports_mime_type() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Test resizing an image, not using crop
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_resize() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +67,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Test resizing an image including cropping
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_resize_and_crop() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,14 +150,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $editor->load();
</span><span class="cx" style="display: block; padding: 0 10px"> $editor->resize(5,5);
</span><span class="cx" style="display: block; padding: 0 10px"> $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $editor->save( $save_to_file );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
-
- unlink( $save_to_file );
- }
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $im = new Imagick( $save_to_file );
+ $pixel = $im->getImagePixelColor( 0, 0 );
+ $expected = $pixel->getColorValue( imagick::COLOR_ALPHA );
+
+ $this->assertImageAlphaAtPointImagick( $save_to_file, array( 0,0 ), $expected );
+
+ unlink( $save_to_file );
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Test the image created with WP_Image_Edior_Imagick preserves alpha with no resizing etc
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -169,13 +173,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $editor = wp_get_image_editor( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> $editor->load();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
-
- $editor->save( $save_to_file );
-
- $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
-
- unlink( $save_to_file );
- }
-}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
+
+ $editor->save( $save_to_file );
+
+ $im = new Imagick( $save_to_file );
+ $pixel = $im->getImagePixelColor( 0, 0 );
+ $expected = $pixel->getColorValue( imagick::COLOR_ALPHA );
+
+ $this->assertImageAlphaAtPointImagick( $save_to_file, array( 0,0 ), $expected );
+
+ unlink( $save_to_file );
+ }
+}
</ins></span></pre></div>
<a id="branches37toolslocalenvdefaulttemplate"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: branches/3.7/tools/local-env/default.template</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/tools/local-env/default.template (rev 0)
+++ branches/3.7/tools/local-env/default.template 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,32 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+server {
+ index index.php index.html;
+
+ listen 80 default_server;
+ listen [::]:80 default_server;
+
+ server_name localhost;
+
+ client_max_body_size 1g;
+
+ error_log /var/log/nginx/error.log;
+ access_log /var/log/nginx/access.log;
+
+ root /var/www/${LOCAL_DIR};
+
+ absolute_redirect off;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+ }
+
+ location ~ \.php$ {
+ try_files $uri =404;
+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
+ fastcgi_pass php:9000;
+ fastcgi_index index.php;
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ fastcgi_pass_header Authorization;
+ }
+}
</ins></span></pre></div>
<a id="branches37toolslocalenvmysqlinitsql"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: branches/3.7/tools/local-env/mysql-init.sql</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/tools/local-env/mysql-init.sql (rev 0)
+++ branches/3.7/tools/local-env/mysql-init.sql 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,8 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * MySQL server init.
+ *
+ * SQL queries in this file will be executed the first time the MySQL server is started.
+ */
+
+CREATE DATABASE IF NOT EXISTS wordpress_develop;
+CREATE DATABASE IF NOT EXISTS wordpress_develop_tests;
</ins></span></pre></div>
<a id="branches37toolslocalenvphpconfigini"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: branches/3.7/tools/local-env/php-config.ini</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/tools/local-env/php-config.ini (rev 0)
+++ branches/3.7/tools/local-env/php-config.ini 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,2 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+upload_max_filesize = 1G
+post_max_size = 1G
</ins></span></pre></div>
<a id="branches37toolslocalenvphpunitconfigini"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: branches/3.7/tools/local-env/phpunit-config.ini</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/tools/local-env/phpunit-config.ini (rev 0)
+++ branches/3.7/tools/local-env/phpunit-config.ini 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,6 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+upload_max_filesize = 1G
+post_max_size = 1G
+
+opcache.enable = 1
+opcache.enable_cli = 1
+opache.file_cache = /tmp/php-opcache
</ins></span></pre></div>
<a id="branches37toolslocalenvscriptsdockerjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: branches/3.7/tools/local-env/scripts/docker.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/tools/local-env/scripts/docker.js (rev 0)
+++ branches/3.7/tools/local-env/scripts/docker.js 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,8 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+const dotenv = require( 'dotenv' );
+const dotenvExpand = require( 'dotenv-expand' );
+const { execSync } = require( 'child_process' );
+
+dotenvExpand( dotenv.config() );
+
+// Execute any docker-compose command passed to this script.
+execSync( 'docker-compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
</ins></span></pre></div>
<a id="branches37toolslocalenvscriptsinstalljs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: branches/3.7/tools/local-env/scripts/install.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/tools/local-env/scripts/install.js (rev 0)
+++ branches/3.7/tools/local-env/scripts/install.js 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,47 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+const dotenv = require( 'dotenv' );
+const dotenvExpand = require( 'dotenv-expand' );
+const wait_on = require( 'wait-on' );
+const { execSync } = require( 'child_process' );
+const { renameSync, readFileSync, writeFileSync } = require( 'fs' );
+
+dotenvExpand( dotenv.config() );
+
+// Create wp-config.php.
+wp_cli( 'config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --path=/var/www/src --force' );
+
+// Add the debug settings to wp-config.php.
+// Windows requires this to be done as an additional step, rather than using the --extra-php option in the previous step.
+wp_cli( `config set WP_DEBUG ${process.env.LOCAL_WP_DEBUG} --raw --type=constant --path=/var/www/src` );
+wp_cli( `config set WP_DEBUG_LOG ${process.env.LOCAL_WP_DEBUG_LOG} --raw --type=constant --path=/var/www/src` );
+wp_cli( `config set WP_DEBUG_DISPLAY ${process.env.LOCAL_WP_DEBUG_DISPLAY} --raw --type=constant --path=/var/www/src` );
+wp_cli( `config set SCRIPT_DEBUG ${process.env.LOCAL_SCRIPT_DEBUG} --raw --type=constant --path=/var/www/src` );
+wp_cli( `config set WP_ENVIRONMENT_TYPE ${process.env.LOCAL_WP_ENVIRONMENT_TYPE} --type=constant --path=/var/www/src` );
+
+// Move wp-config.php to the base directory, so it doesn't get mixed up in the src or build directories.
+renameSync( 'src/wp-config.php', 'wp-config.php' );
+
+// Read in wp-tests-config-sample.php, edit it to work with our config, then write it to wp-tests-config.php.
+const testConfig = readFileSync( 'wp-tests-config-sample.php', 'utf8' )
+ .replace( 'youremptytestdbnamehere', 'wordpress_develop_tests' )
+ .replace( 'yourusernamehere', 'root' )
+ .replace( 'yourpasswordhere', 'password' )
+ .replace( 'localhost', 'mysql' )
+ .concat( "\ndefine( 'FS_METHOD', 'direct' );\n" );
+
+writeFileSync( 'wp-tests-config.php', testConfig );
+
+// Once the site is available, install WordPress!
+wait_on( { resources: [ `tcp:localhost:${process.env.LOCAL_PORT}`] } )
+ .then( () => {
+ wp_cli( 'db reset --yes --path=/var/www/src' );
+ wp_cli( `core install --title="WordPress Develop" --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:${process.env.LOCAL_PORT} --path=/var/www/src` );
+ } );
+
+/**
+ * Runs WP-CLI commands in the Docker environment.
+ *
+ * @param {string} cmd The WP-CLI command to run.
+ */
+function wp_cli( cmd ) {
+ execSync( `docker-compose run --rm cli ${cmd}`, { stdio: 'inherit' } );
+}
</ins></span></pre></div>
<a id="branches37toolslocalenvscriptsstartjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: branches/3.7/tools/local-env/scripts/start.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- branches/3.7/tools/local-env/scripts/start.js (rev 0)
+++ branches/3.7/tools/local-env/scripts/start.js 2021-02-08 20:58:53 UTC (rev 50251)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,36 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+const dotenv = require( 'dotenv' );
+const dotenvExpand = require( 'dotenv-expand' );
+const { execSync } = require( 'child_process' );
+
+dotenvExpand( dotenv.config() );
+
+// Start the local-env containers.
+execSync( 'docker-compose up -d wordpress-develop', { stdio: 'inherit' } );
+
+// If Docker Toolbox is being used, we need to manually forward LOCAL_PORT to the Docker VM.
+if ( process.env.DOCKER_TOOLBOX_INSTALL_PATH ) {
+ // VBoxManage is added to the PATH on every platform except Windows.
+ const vboxmanage = process.env.VBOX_MSI_INSTALL_PATH ? `${ process.env.VBOX_MSI_INSTALL_PATH }/VBoxManage` : 'VBoxManage'
+
+ // Check if the port forwarding is already configured for this port.
+ const vminfoBuffer = execSync( `"${ vboxmanage }" showvminfo "${ process.env.DOCKER_MACHINE_NAME }" --machinereadable` );
+ const vminfo = vminfoBuffer.toString().split( /[\r\n]+/ );
+
+ vminfo.forEach( ( info ) => {
+ if ( ! info.startsWith( 'Forwarding' ) ) {
+ return;
+ }
+
+ // `info` is in the format: Forwarding(1)="tcp-port8889,tcp,127.0.0.1,8889,,8889"
+ // Parse it down so `rule` only contains the data inside quotes, split by ','.
+ const rule = info.replace( /(^.*?"|"$)/, '' ).split( ',' );
+
+ // Delete rules that are using the port we need.
+ if ( rule[ 3 ] === process.env.LOCAL_PORT || rule[ 5 ] === process.env.LOCAL_PORT ) {
+ execSync( `"${ vboxmanage }" controlvm "${ process.env.DOCKER_MACHINE_NAME }" natpf1 delete ${ rule[ 0 ] }`, { stdio: 'inherit' } );
+ }
+ } );
+
+ // Add our port forwarding rule.
+ execSync( `"${ vboxmanage }" controlvm "${ process.env.DOCKER_MACHINE_NAME }" natpf1 "tcp-port${ process.env.LOCAL_PORT },tcp,127.0.0.1,${ process.env.LOCAL_PORT },,${ process.env.LOCAL_PORT }"`, { stdio: 'inherit' } );
+}
</ins></span></pre>
</div>
</div>
</body>
</html>