Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Composer / Composer.php
index 04f9564c7f05d385ae651e7765fa8028656c4061..9833b7ede1964211f00fead94d29574c5601041a 100644 (file)
@@ -6,6 +6,7 @@ use Drupal\Component\PhpStorage\FileStorage;
 use Composer\Script\Event;
 use Composer\Installer\PackageEvent;
 use Composer\Semver\Constraint\Constraint;
+use Composer\Util\ProcessExecutor;
 
 /**
  * Provides static functions for composer script events.
@@ -160,7 +161,7 @@ EOT;
       return;
     }
 
-    // If the PHP version is 7.2 or above and PHPUnit is less than version 6
+    // If the PHP version is 7.0 or above and PHPUnit is less than version 6
     // call the drupal-phpunit-upgrade script to upgrade PHPUnit.
     if (!static::upgradePHPUnitCheck($phpunit_package->getVersion())) {
       $event->getComposer()
@@ -182,7 +183,7 @@ EOT;
    *   TRUE if the PHPUnit needs to be upgraded, FALSE if not.
    */
   public static function upgradePHPUnitCheck($phpunit_version) {
-    return !(version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION, '7.2') >= 0 && version_compare($phpunit_version, '6.1') < 0);
+    return !(version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION, '7.0') >= 0 && version_compare($phpunit_version, '6.1') < 0);
   }
 
   /**
@@ -269,6 +270,13 @@ EOT;
     return $package_key;
   }
 
+  /**
+   * Removes Composer's timeout so that scripts can run indefinitely.
+   */
+  public static function removeTimeout() {
+    ProcessExecutor::setTimeout(0);
+  }
+
   /**
    * Helper method to remove directories and the files they contain.
    *