Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit af48098

Browse filesBrowse files
author
Joe Bennett
committed
Merge branch 'master' into 27345-lock-mongodb
2 parents 96a43e6 + 3b931fe commit af48098
Copy full SHA for af48098

File tree

1,968 files changed

+20794
-12247
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

1,968 files changed

+20794
-12247
lines changed

‎appveyor.yml renamed to ‎.appveyor.yml

Copy file name to clipboardExpand all lines: .appveyor.yml
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
build: false
2-
clone_depth: 1
2+
clone_depth: 2
33
clone_folder: c:\projects\symfony
44

55
cache:
@@ -10,6 +10,7 @@ init:
1010
- SET PATH=c:\php;%PATH%
1111
- SET COMPOSER_NO_INTERACTION=1
1212
- SET SYMFONY_DEPRECATIONS_HELPER=strict
13+
- SET "SYMFONY_REQUIRE=>=4.2"
1314
- SET ANSICON=121x90 (121x90)
1415
- REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f
1516

@@ -40,10 +41,11 @@ install:
4041
- echo extension=php_curl.dll >> php.ini-max
4142
- copy /Y php.ini-max php.ini
4243
- cd c:\projects\symfony
43-
- IF NOT EXIST composer.phar (appveyor DownloadFile https://getcomposer.org/download/1.3.0/composer.phar)
44+
- IF NOT EXIST composer.phar (appveyor DownloadFile https://github.com/composer/composer/releases/download/1.7.1/composer.phar)
4445
- php composer.phar self-update
4546
- copy /Y .composer\* %APPDATA%\Composer\
46-
- php .github/build-packages.php "HEAD^" src\Symfony\Bridge\PhpUnit
47+
- php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
48+
- php .github/build-packages.php "HEAD^" src\Symfony\Bridge\PhpUnit src\Symfony\Contracts
4749
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
4850
- php composer.phar update --no-progress --no-suggest --ansi
4951
- php phpunit install

‎.editorconfig

Copy file name to clipboardExpand all lines: .editorconfig
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@ root = true
33

44
; Unix-style newlines
55
[*]
6+
charset = utf-8
67
end_of_line = LF
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
710

8-
[*.php]
11+
[*.{php,html,twig}]
912
indent_style = space
1013
indent_size = 4
14+
15+
[*.md]
16+
max_line_length = 80
17+
18+
[COMMIT_EDITMSG]
19+
max_line_length = 0

‎.github/CODEOWNERS

Copy file name to clipboardExpand all lines: .github/CODEOWNERS
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@
2525
/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ValidateWorkflowsPass.php @lyrixx
2626
/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/WorkflowGuardListenerPass.php @lyrixx
2727
/src/Symfony/Component/Workflow/* @lyrixx
28+
# Yaml
29+
/src/Symfony/Component/Yaml/* @xabbuh

‎.github/build-packages.php

Copy file name to clipboardExpand all lines: .github/build-packages.php
+9-6Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
}
77
chdir(dirname(__DIR__));
88

9+
$json = ltrim(file_get_contents('composer.json'));
10+
if ($json !== $package = preg_replace('/\n "repositories": \[\n.*?\n \],/s', '', $json)) {
11+
file_put_contents('composer.json', $package);
12+
}
13+
914
$dirs = $_SERVER['argv'];
1015
array_shift($dirs);
11-
$mergeBase = trim(shell_exec(sprintf('git merge-base %s HEAD', array_shift($dirs))));
16+
$mergeBase = trim(shell_exec(sprintf('git merge-base "%s" HEAD', array_shift($dirs))));
1217

1318
$packages = array();
1419
$flags = \PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
@@ -49,7 +54,7 @@
4954

5055
$packages[$package->name][$package->version] = $package;
5156

52-
$versions = file_get_contents('https://packagist.org/p/'.$package->name.'.json');
57+
$versions = @file_get_contents('https://repo.packagist.org/p/'.$package->name.'.json') ?: sprintf('{"packages":{"%s":{"dev-master":%s}}}', $package->name, file_get_contents($dir.'/composer.json'));
5358
$versions = json_decode($versions)->packages->{$package->name};
5459

5560
if ($package->version === str_replace('-dev', '.x-dev', $versions->{'dev-master'}->extra->{'branch-alias'}->{'dev-master'})) {
@@ -74,8 +79,6 @@
7479
'type' => 'composer',
7580
'url' => 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__)).'/',
7681
));
77-
if (false === strpos($json, "\n \"repositories\": [\n")) {
78-
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
79-
file_put_contents('composer.json', $json);
80-
}
82+
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
83+
file_put_contents('composer.json', $json);
8184
}
+159Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<?php
2+
3+
error_reporting(-1);
4+
set_error_handler(function ($type, $message, $file, $line) {
5+
if (error_reporting()) {
6+
throw new \ErrorException($message, 0, $type, $file, $line);
7+
}
8+
});
9+
array_shift($_SERVER['argv']);
10+
$dirs = $_SERVER['argv'];
11+
12+
function getRelevantContent(array $composerJson)
13+
{
14+
$relevantKeys = array(
15+
'name',
16+
'require',
17+
'require-dev',
18+
'conflict',
19+
'replace',
20+
'provide',
21+
'minimum-stability',
22+
'prefer-stable',
23+
'repositories',
24+
'extra',
25+
);
26+
27+
$relevantContent = array();
28+
29+
foreach (array_intersect($relevantKeys, array_keys($composerJson)) as $key) {
30+
$relevantContent[$key] = $composerJson[$key];
31+
}
32+
if (isset($composerJson['config']['platform'])) {
33+
$relevantContent['config']['platform'] = $composerJson['config']['platform'];
34+
}
35+
36+
return $relevantContent;
37+
}
38+
39+
function getContentHash(array $composerJson)
40+
{
41+
$relevantContent = getRelevantContent($composerJson);
42+
ksort($relevantContent);
43+
44+
return md5(json_encode($relevantContent));
45+
}
46+
47+
$composerJsons = array();
48+
49+
foreach ($dirs as $dir) {
50+
if (!file_exists($dir.'/composer.lock') || !$composerLock = @json_decode(file_get_contents($dir.'/composer.lock'), true)) {
51+
@unlink($dir.'/composer.lock');
52+
continue;
53+
}
54+
if (!file_exists($dir.'/composer.json') || !$composerJson = @json_decode(file_get_contents($dir.'/composer.json'), true)) {
55+
echo "$dir/composer.json not found or invalid.\n";
56+
@unlink($dir.'/composer.lock');
57+
continue;
58+
}
59+
if (!isset($composerLock['content-hash']) || getContentHash($composerJson) !== $composerLock['content-hash']) {
60+
echo "$dir/composer.lock is outdated.\n";
61+
@unlink($dir.'/composer.lock');
62+
continue;
63+
}
64+
$composerLock += array('packages' => array(), 'packages-dev' => array());
65+
$composerJsons[$composerJson['name']] = array($dir, $composerLock['packages'] + $composerLock['packages-dev'], getRelevantContent($composerJson));
66+
}
67+
68+
$referencedCommits = array();
69+
70+
foreach ($composerJsons as list($dir, $lockedPackages)) {
71+
foreach ($lockedPackages as $lockedJson) {
72+
if (0 !== strpos($version = $lockedJson['version'], 'dev-') && '-dev' !== substr($version, -4)) {
73+
continue;
74+
}
75+
76+
if (!isset($composerJsons[$name = $lockedJson['name']])) {
77+
echo "$dir/composer.lock references missing $name.\n";
78+
@unlink($dir.'/composer.lock');
79+
continue 2;
80+
}
81+
82+
if (isset($composerJsons[$name][2]['repositories']) && !isset($lockedJson['repositories'])) {
83+
// the locked package has been patched locally but the lock references a commit,
84+
// which means the referencing package itself is not modified
85+
continue;
86+
}
87+
88+
foreach (array('minimum-stability', 'prefer-stable') as $key) {
89+
if (array_key_exists($key, $composerJsons[$name][2])) {
90+
$lockedJson[$key] = $composerJsons[$name][2][$key];
91+
}
92+
}
93+
94+
// use weak comparison to ignore ordering
95+
if (getRelevantContent($lockedJson) != $composerJsons[$name][2]) {
96+
echo "$dir/composer.lock is not in sync with $name.\n";
97+
@unlink($dir.'/composer.lock');
98+
continue 2;
99+
}
100+
101+
if ($lockedJson['dist']['reference']) {
102+
$referencedCommits[$name][$lockedJson['dist']['reference']][] = $dir;
103+
}
104+
}
105+
}
106+
107+
if (!$referencedCommits || (isset($_SERVER['TRAVIS_PULL_REQUEST']) && 'false' !== $_SERVER['TRAVIS_PULL_REQUEST'])) {
108+
// cached commits cannot be stale for PRs
109+
return;
110+
}
111+
112+
@mkdir($_SERVER['HOME'].'/.cache/composer/repo/https---repo.packagist.org', 0777, true);
113+
114+
$ch = null;
115+
$mh = curl_multi_init();
116+
$sh = curl_share_init();
117+
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
118+
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
119+
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION);
120+
$chs = array();
121+
122+
foreach ($referencedCommits as $name => $dirsByCommit) {
123+
$chs[] = $ch = array(curl_init(), fopen($_SERVER['HOME'].'/.cache/composer/repo/https---repo.packagist.org/provider-'.strtr($name, '/', '$').'.json', 'wb'));
124+
curl_setopt($ch[0], CURLOPT_URL, 'https://repo.packagist.org/p/'.$name.'.json');
125+
curl_setopt($ch[0], CURLOPT_FILE, $ch[1]);
126+
curl_setopt($ch[0], CURLOPT_SHARE, $sh);
127+
curl_multi_add_handle($mh, $ch[0]);
128+
}
129+
130+
do {
131+
curl_multi_exec($mh, $active);
132+
curl_multi_select($mh);
133+
} while ($active);
134+
135+
foreach ($chs as list($ch, $fd)) {
136+
curl_multi_remove_handle($mh, $ch);
137+
curl_close($ch);
138+
fclose($fd);
139+
}
140+
141+
foreach ($referencedCommits as $name => $dirsByCommit) {
142+
$repo = file_get_contents($_SERVER['HOME'].'/.cache/composer/repo/https---repo.packagist.org/provider-'.strtr($name, '/', '$').'.json');
143+
$repo = json_decode($repo, true);
144+
145+
foreach ($repo['packages'][$name] as $version) {
146+
unset($referencedCommits[$name][$version['source']['reference']]);
147+
}
148+
}
149+
150+
foreach ($referencedCommits as $name => $dirsByCommit) {
151+
foreach ($dirsByCommit as $dirs) {
152+
foreach ($dirs as $dir) {
153+
if (file_exists($dir.'/composer.lock')) {
154+
echo "$dir/composer.lock references old commit for $name.\n";
155+
@unlink($dir.'/composer.lock');
156+
}
157+
}
158+
}
159+
}

‎.php_cs.dist

Copy file name to clipboardExpand all lines: .php_cs.dist
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,42 @@ return PhpCsFixer\Config::create()
1111
'@PHPUnit48Migration:risky' => true,
1212
'php_unit_no_expectation_annotation' => false, // part of `PHPUnitXYMigration:risky` ruleset, to be enabled when PHPUnit 4.x support will be dropped, as we don't want to rewrite exceptions handling twice
1313
'array_syntax' => array('syntax' => 'long'),
14+
'ordered_imports' => true,
1415
'protected_to_private' => false,
16+
// Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading
17+
'native_function_invocation' => array('include' => array('@compiler_optimized'), 'scope' => 'namespaced'),
1518
))
1619
->setRiskyAllowed(true)
1720
->setFinder(
1821
PhpCsFixer\Finder::create()
1922
->in(__DIR__.'/src')
2023
->append(array(__FILE__))
2124
->exclude(array(
25+
'Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/Fixtures',
2226
// directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
23-
'Symfony/Component/Cache/Tests/Marshaller/Fixtures',
2427
'Symfony/Component/DependencyInjection/Tests/Fixtures',
2528
'Symfony/Component/Routing/Tests/Fixtures/dumper',
2629
// fixture templates
2730
'Symfony/Component/Templating/Tests/Fixtures/templates',
31+
'Symfony/Bundle/FrameworkBundle/Tests/Fixtures/TemplatePathsCache',
2832
'Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom',
2933
// generated fixtures
3034
'Symfony/Component/VarDumper/Tests/Fixtures',
35+
'Symfony/Component/VarExporter/Tests/Fixtures',
3136
// resource templates
3237
'Symfony/Bundle/FrameworkBundle/Resources/views/Form',
38+
// explicit trigger_error tests
39+
'Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/',
3340
))
41+
// Support for older PHPunit version
42+
->notPath('Symfony/Bridge/PhpUnit/SymfonyTestsListener.php')
3443
// file content autogenerated by `var_export`
3544
->notPath('Symfony/Component/Translation/Tests/fixtures/resources.php')
3645
// test template
3746
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
3847
// explicit heredoc test
3948
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php')
4049
// explicit trigger_error tests
41-
->notPath('Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt')
42-
->notPath('Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt')
4350
->notPath('Symfony/Component/Debug/Tests/DebugClassLoaderTest.php')
4451
// invalid annotations on purpose
4552
->notPath('Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.