Skip to content

Commit d38370a

Browse files
committed
Load old version of the Importer for PHP < 7.2
1 parent c0b7356 commit d38370a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/local-env/scripts/install.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ function wp_cli( cmd ) {
5555
function install_wp_importer() {
5656
const testPluginDirectory = 'tests/phpunit/data/plugins/wordpress-importer';
5757

58+
59+
// The final version of the WordPress Importer plugin with support for PHP < 7.2 is 0.9.0.
60+
const phpVersion = parseFloat(process.env.LOCAL_PHP.split('-')[0]);
61+
const branchFlag = phpVersion < 7.2 ? '--branch 0.9.0' : '';
62+
5863
execSync( `docker compose exec -T php rm -rf ${testPluginDirectory}`, { stdio: 'inherit' } );
59-
execSync( `docker compose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } );
64+
execSync( `docker compose exec -T php git clone ${branchFlag} https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } );
6065
}

0 commit comments

Comments
 (0)