Make WordPress Core

Ticket #50640: 50640-composer.patch

File 50640-composer.patch, 1.2 KB (added by ayeshrajans, 4 years ago)

Patch to add the composer.json entry, and a circuit-breaker in bootstrap file. It has an array of requirements, and shows a if any of the required extensiona are not available. Patch does not include composer.lock updates.

  • composer.json

    diff --git a/composer.json b/composer.json
    index 41368ef25e..cb0fbb1740 100644
    a b  
    1616                "dealerdirect/phpcodesniffer-composer-installer": "~0.6.0",
    1717                "wp-coding-standards/wpcs": "~2.3.0",
    1818                "phpcompatibility/phpcompatibility-wp": "^2.1.0",
    19                 "phpunit/phpunit": "^7.5"
     19                "phpunit/phpunit": "^7.5",
     20                "ext-gd": "*"
    2021        },
    2122        "autoload-dev": {
    2223                "files": [
  • tests/phpunit/includes/bootstrap.php

    diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php
    index 65c1c370c4..97f1f6e7e3 100644
    a b  
    3434        exit( 1 );
    3535}
    3636
     37$required_extensions = array(
     38        'gd',
     39);
     40$missing_extensions  = array();
     41
     42foreach ( $required_extensions as $required_extension ) {
     43        if ( ! extension_loaded( $required_extension ) ) {
     44                $missing_extensions[] = $required_extension;
     45        }
     46}
     47
     48if ( ! empty( $missing_extensions ) ) {
     49        echo "Error: The following required extension(s) are missing from the testing environment.\n";
     50        echo implode( ', ', $missing_extensions );
     51        exit( 1 );
     52}
     53
    3754require_once $config_file_path;
    3855require_once __DIR__ . '/functions.php';
    3956