Skip to content

Commit 0fa7393

Browse files
Merge branch '5.2' into 5.x
* 5.2: [Uid] fix checking for valid UUIDs [Validator] Fix DebugCommand check parent types for label_format and translation_domain [HttpKernel] Configure the ErrorHandler even when it is overriden Allow relative path to composer cache [RateLimiter] Fix infinite values with NoLimiter
2 parents 76a3aac + 587f2b6 commit 0fa7393

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

bin/simple-phpunit.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@
154154
? ('#!/usr/bin/env php' === file_get_contents($COMPOSER, false, null, 0, 18) ? $PHP : '').' '.escapeshellarg($COMPOSER) // detect shell wrappers by looking at the shebang
155155
: 'composer';
156156

157+
$prevCacheDir = getenv('COMPOSER_CACHE_DIR');
158+
if ($prevCacheDir) {
159+
if (false === $absoluteCacheDir = realpath($prevCacheDir)) {
160+
@mkdir($prevCacheDir, 0777, true);
161+
$absoluteCacheDir = realpath($prevCacheDir);
162+
}
163+
if ($absoluteCacheDir) {
164+
putenv("COMPOSER_CACHE_DIR=$absoluteCacheDir");
165+
} else {
166+
$prevCacheDir = false;
167+
}
168+
}
157169
$SYMFONY_PHPUNIT_REMOVE = $getEnvVar('SYMFONY_PHPUNIT_REMOVE', 'phpspec/prophecy'.($PHPUNIT_VERSION < 6.0 ? ' symfony/yaml' : ''));
158170
$configurationHash = md5(implode(\PHP_EOL, [md5_file(__FILE__), $SYMFONY_PHPUNIT_REMOVE, (int) $PHPUNIT_REMOVE_RETURN_TYPEHINT]));
159171
$PHPUNIT_VERSION_DIR = sprintf('phpunit-%s-%d', $PHPUNIT_VERSION, $PHPUNIT_REMOVE_RETURN_TYPEHINT);
@@ -236,6 +248,9 @@
236248
// --no-suggest is not in the list to keep compat with composer 1.0, which is shipped with Ubuntu 16.04LTS
237249
$exit = proc_close(proc_open("$q$COMPOSER install --no-dev --prefer-dist --no-progress $q", [], $p, getcwd()));
238250
putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));
251+
if ($prevCacheDir) {
252+
putenv("COMPOSER_CACHE_DIR=$prevCacheDir");
253+
}
239254
if ($exit) {
240255
exit($exit);
241256
}

0 commit comments

Comments
 (0)