Skip to content

Commit 9654de3

Browse files
Merge branch '3.4' into 4.1
* 3.4: [travis] cache composer.lock files for deps=low [Security] Remove wrong sentence about ACL Update validators.nl.xlf
2 parents 3e47827 + 87fff65 commit 9654de3

File tree

4 files changed

+87
-3
lines changed

4 files changed

+87
-3
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
3+
array_shift($_SERVER['argv']);
4+
$dirs = $_SERVER['argv'];
5+
6+
function getContentHash($composerJson)
7+
{
8+
$relevantKeys = array(
9+
'name',
10+
'require',
11+
'require-dev',
12+
'conflict',
13+
'replace',
14+
'provide',
15+
'minimum-stability',
16+
'prefer-stable',
17+
'repositories',
18+
'extra',
19+
);
20+
21+
$relevantContent = array();
22+
23+
foreach (array_intersect($relevantKeys, array_keys($composerJson)) as $key) {
24+
$relevantContent[$key] = $composerJson[$key];
25+
}
26+
if (isset($composerJson['config']['platform'])) {
27+
$relevantContent['config']['platform'] = $composerJson['config']['platform'];
28+
}
29+
30+
ksort($relevantContent);
31+
32+
return md5(json_encode($relevantContent));
33+
}
34+
35+
$composerLocks = array();
36+
37+
foreach ($dirs as $dir) {
38+
if (!file_exists($dir.'/composer.lock') || !$composerLock = @json_decode(file_get_contents($dir.'/composer.lock'), true)) {
39+
echo "$dir/composer.lock not found or invalid.\n";
40+
@unlink($dir.'/composer.lock');
41+
continue;
42+
}
43+
if (!file_exists($dir.'/composer.json') || !$composerJson = @json_decode(file_get_contents($dir.'/composer.json'), true)) {
44+
echo "$dir/composer.json not found or invalid.\n";
45+
@unlink($dir.'/composer.lock');
46+
continue;
47+
}
48+
if (!isset($composerLock['content-hash']) || getContentHash($composerJson) !== $composerLock['content-hash']) {
49+
echo "$dir/composer.lock is outdated.\n";
50+
@unlink($dir.'/composer.lock');
51+
continue;
52+
}
53+
$composerLocks[$composerJson['name']] = array($dir, $composerLock, $composerJson);
54+
}
55+
56+
foreach ($composerLocks as list($dir, $composerLock)) {
57+
foreach ($composerLock['packages'] as $composerJson) {
58+
if (0 !== strpos($version = $composerJson['version'], 'dev-') && '-dev' !== substr($version, -4)) {
59+
continue;
60+
}
61+
62+
if (!isset($composerLocks[$name = $composerJson['name']])) {
63+
echo "$dir/composer.lock references missing $name.\n";
64+
@unlink($dir.'/composer.lock');
65+
continue 2;
66+
}
67+
68+
foreach (array('minimum-stability', 'prefer-stable', 'repositories') as $key) {
69+
if (array_key_exists($key, $composerLocks[$name][2])) {
70+
$composerJson[$key] = $composerLocks[$name][2][$key];
71+
}
72+
}
73+
74+
if (getContentHash($composerJson) !== $composerLocks[$name][1]['content-hash']) {
75+
echo "$dir/composer.lock is not in sync with $name.\n";
76+
@unlink($dir.'/composer.lock');
77+
continue 2;
78+
}
79+
}
80+
}

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,11 @@ install:
211211
if [[ $deps = high ]]; then
212212
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'"
213213
elif [[ $deps = low ]]; then
214-
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP --prefer-lowest --prefer-stable && $PHPUNIT_X'"
214+
[[ -e ~/php-ext/composer-lowest.lock.tar ]] && tar -xf ~/php-ext/composer-lowest.lock.tar
215+
tar -cf ~/php-ext/composer-lowest.lock.tar --files-from /dev/null
216+
php .github/rm-invalid-lowest-lock-files.php $COMPONENTS
217+
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'"
218+
echo "$COMPONENTS" | xargs -n1 -I{} tar --append -f ~/php-ext/composer-lowest.lock.tar {}/composer.lock
215219
else
216220
echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}"
217221
tfold src/Symfony/Component/Console.tty $PHPUNIT src/Symfony/Component/Console --group tty

src/Symfony/Component/Security/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ application. It ships with facilities for authenticating using HTTP basic or
66
digest authentication, interactive form login or X.509 certificate login, but
77
also allows you to implement your own authentication strategies. Furthermore,
88
the component provides ways to authorize authenticated users based on their
9-
roles, and it contains an advanced ACL system.
9+
roles.
1010

1111
Resources
1212
---------

src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
</trans-unit>
317317
<trans-unit id="83">
318318
<source>This is not a valid UUID.</source>
319-
<target>Deze waarde is geen geldige UUID waarde.</target>
319+
<target>Dit is geen geldige UUID.</target>
320320
</trans-unit>
321321
</body>
322322
</file>

0 commit comments

Comments
 (0)