Skip to content
  • Sponsor symfony/symfony

  • Notifications You must be signed in to change notification settings
  • Fork 9.6k
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/symfony
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.8.44
Choose a base ref
...
head repository: symfony/symfony
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.8.45
Choose a head ref
Loading
Showing with 564 additions and 118 deletions.
  1. +159 −0 .github/rm-invalid-lowest-lock-files.php
  2. +90 −57 .travis.yml
  3. +10 −0 CHANGELOG-2.8.md
  4. +29 −16 CONTRIBUTORS.md
  5. +3 −1 appveyor.yml
  6. +10 −0 src/Symfony/Bundle/SecurityBundle/Tests/Functional/LogoutTest.php
  7. +18 −0 src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/bundles.php
  8. +26 −0 src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/config.yml
  9. +5 −0 src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/LogoutAccess/routing.yml
  10. +1 −1 src/Symfony/Bundle/SecurityBundle/composer.json
  11. +1 −2 src/Symfony/Component/Debug/Tests/phpt/decorate_exception_hander.phpt
  12. +25 −0 src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
  13. +1 −1 src/Symfony/Component/Form/FormConfigInterface.php
  14. +2 −2 src/Symfony/Component/HttpFoundation/BinaryFileResponse.php
  15. +16 −5 src/Symfony/Component/HttpFoundation/Request.php
  16. +1 −0 src/Symfony/Component/HttpFoundation/Response.php
  17. +13 −0 src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
  18. +53 −4 src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
  19. +5 −0 src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php
  20. +7 −3 src/Symfony/Component/HttpKernel/HttpCache/SubRequestHandler.php
  21. +3 −3 src/Symfony/Component/HttpKernel/Kernel.php
  22. +11 −0 src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php
  23. +0 −6 src/Symfony/Component/Process/Tests/ProcessTest.php
  24. +6 −1 src/Symfony/Component/PropertyAccess/PropertyAccessor.php
  25. +5 −0 src/Symfony/Component/PropertyAccess/Tests/Fixtures/ReturnTyped.php
  26. +23 −0 src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
  27. +11 −13 src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php
  28. +2 −0 src/Symfony/Component/PropertyInfo/Tests/Extractors/PhpDocExtractorTest.php
  29. +2 −0 src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php
  30. +10 −0 src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php
  31. +13 −0 src/Symfony/Component/Security/Http/Firewall.php
  32. +1 −1 src/Symfony/Component/Security/Http/Tests/FirewallTest.php
  33. +1 −1 src/Symfony/Component/Security/README.md
  34. +1 −1 src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf
159 changes: 159 additions & 0 deletions .github/rm-invalid-lowest-lock-files.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
<?php

error_reporting(-1);
set_error_handler(function ($type, $message, $file, $line) {
if (error_reporting()) {
throw new \ErrorException($message, 0, $type, $file, $line);
}
});
array_shift($_SERVER['argv']);
$dirs = $_SERVER['argv'];

function getRelevantContent(array $composerJson)
{
$relevantKeys = array(
'name',
'require',
'require-dev',
'conflict',
'replace',
'provide',
'minimum-stability',
'prefer-stable',
'repositories',
'extra',
);

$relevantContent = array();

foreach (array_intersect($relevantKeys, array_keys($composerJson)) as $key) {
$relevantContent[$key] = $composerJson[$key];
}
if (isset($composerJson['config']['platform'])) {
$relevantContent['config']['platform'] = $composerJson['config']['platform'];
}

return $relevantContent;
}

function getContentHash(array $composerJson)
{
$relevantContent = getRelevantContent($composerJson);
ksort($relevantContent);

return md5(json_encode($relevantContent));
}

$composerJsons = array();

foreach ($dirs as $dir) {
if (!file_exists($dir.'/composer.lock') || !$composerLock = @json_decode(file_get_contents($dir.'/composer.lock'), true)) {
@unlink($dir.'/composer.lock');
continue;
}
if (!file_exists($dir.'/composer.json') || !$composerJson = @json_decode(file_get_contents($dir.'/composer.json'), true)) {
echo "$dir/composer.json not found or invalid.\n";
@unlink($dir.'/composer.lock');
continue;
}
if (!isset($composerLock['content-hash']) || getContentHash($composerJson) !== $composerLock['content-hash']) {
echo "$dir/composer.lock is outdated.\n";
@unlink($dir.'/composer.lock');
continue;
}
$composerLock += array('packages' => array(), 'packages-dev' => array());
$composerJsons[$composerJson['name']] = array($dir, $composerLock['packages'] + $composerLock['packages-dev'], getRelevantContent($composerJson));
}

$referencedCommits = array();

foreach ($composerJsons as list($dir, $lockedPackages)) {
foreach ($lockedPackages as $lockedJson) {
if (0 !== strpos($version = $lockedJson['version'], 'dev-') && '-dev' !== substr($version, -4)) {
continue;
}

if (!isset($composerJsons[$name = $lockedJson['name']])) {
echo "$dir/composer.lock references missing $name.\n";
@unlink($dir.'/composer.lock');
continue 2;
}

if (isset($composerJsons[$name][2]['repositories']) && !isset($lockedJson[$key]['repositories'])) {
// the locked package has been patched locally but the lock references a commit,
// which means the referencing package itself is not modified
continue;
}

foreach (array('minimum-stability', 'prefer-stable') as $key) {
if (array_key_exists($key, $composerJsons[$name][2])) {
$lockedJson[$key] = $composerJsons[$name][2][$key];
}
}

// use weak comparison to ignore ordering
if (getRelevantContent($lockedJson) != $composerJsons[$name][2]) {
echo "$dir/composer.lock is not in sync with $name.\n";
@unlink($dir.'/composer.lock');
continue 2;
}

if ($lockedJson['dist']['reference']) {
$referencedCommits[$name][$lockedJson['dist']['reference']][] = $dir;
}
}
}

if (!$referencedCommits || (isset($_SERVER['TRAVIS_PULL_REQUEST']) && 'false' !== $_SERVER['TRAVIS_PULL_REQUEST'])) {
// cached commits cannot be stale for PRs
return;
}

@mkdir($_SERVER['HOME'].'/.cache/composer/repo/https---repo.packagist.org', 0777, true);

$ch = null;
$mh = curl_multi_init();
$sh = curl_share_init();
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION);
$chs = array();

foreach ($referencedCommits as $name => $dirsByCommit) {
$chs[] = $ch = array(curl_init(), fopen($_SERVER['HOME'].'/.cache/composer/repo/https---repo.packagist.org/provider-'.strtr($name, '/', '$').'.json', 'wb'));
curl_setopt($ch[0], CURLOPT_URL, 'https://repo.packagist.org/p/'.$name.'.json');
curl_setopt($ch[0], CURLOPT_FILE, $ch[1]);
curl_setopt($ch[0], CURLOPT_SHARE, $sh);
curl_multi_add_handle($mh, $ch[0]);
}

do {
curl_multi_exec($mh, $active);
curl_multi_select($mh);
} while ($active);

foreach ($chs as list($ch, $fd)) {
curl_multi_remove_handle($mh, $ch);
curl_close($ch);
fclose($fd);
}

foreach ($referencedCommits as $name => $dirsByCommit) {
$repo = file_get_contents($_SERVER['HOME'].'/.cache/composer/repo/https---repo.packagist.org/provider-'.strtr($name, '/', '$').'.json');
$repo = json_decode($repo, true);

foreach ($repo['packages'][$name] as $version) {
unset($referencedCommits[$name][$version['source']['reference']]);
}
}

foreach ($referencedCommits as $name => $dirsByCommit) {
foreach ($dirsByCommit as $dirs) {
foreach ($dirs as $dir) {
if (file_exists($dir.'/composer.lock')) {
echo "$dir/composer.lock references old commit for $name.\n";
@unlink($dir.'/composer.lock');
}
}
}
}
Loading