Skip to content

Commit fad4028

Browse files
committed
Merge branch '2.8' into 3.1
* 2.8: [travis/appveyor] Wire simple-phpunit [Console] fixed PHP7 Errors are now handled and converted to Exceptions Fix #19721 Fix translation:update command count bumped Symfony version to 2.8.12 updated VERSION for 2.8.11 updated CHANGELOG for 2.8.11 bumped Symfony version to 2.7.19 updated VERSION for 2.7.18 update CONTRIBUTORS for 2.7.18 updated CHANGELOG for 2.7.18 [Security] Optimize RoleHierarchy's buildRoleMap method
2 parents 86f8d74 + 1e91ed7 commit fad4028

File tree

15 files changed

+219
-293
lines changed

15 files changed

+219
-293
lines changed

.github/build-packages.php

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
3+
if (4 > $_SERVER['argc']) {
4+
echo "Usage: branch version dir1 dir2 ... dirN\n";
5+
exit(1);
6+
}
7+
chdir(dirname(__DIR__));
8+
9+
$dirs = $_SERVER['argv'];
10+
array_shift($dirs);
11+
$mergeBase = trim(shell_exec(sprintf('git merge-base %s HEAD', array_shift($dirs))));
12+
$version = array_shift($dirs);
13+
14+
$packages = array();
15+
$flags = PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
16+
17+
foreach ($dirs as $k => $dir) {
18+
if (!system("git diff --name-only $mergeBase -- $dir", $exitStatus)) {
19+
if ($exitStatus) {
20+
exit($exitStatus);
21+
}
22+
unset($dirs[$k]);
23+
continue;
24+
}
25+
echo "$dir\n";
26+
27+
$json = ltrim(file_get_contents($dir.'/composer.json'));
28+
if (null === $package = json_decode($json)) {
29+
passthru("composer validate $dir/composer.json");
30+
exit(1);
31+
}
32+
33+
$package->repositories = array(array(
34+
'type' => 'composer',
35+
'url' => 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__)).'/',
36+
));
37+
if (false === strpos($json, "\n \"repositories\": [\n")) {
38+
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
39+
file_put_contents($dir.'/composer.json', $json);
40+
}
41+
passthru("cd $dir && tar -cf package.tar --exclude='package.tar' *");
42+
43+
$package->version = $version.'.999';
44+
$package->dist['type'] = 'tar';
45+
$package->dist['url'] = 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__))."/$dir/package.tar";
46+
47+
$packages[$package->name][$package->version] = $package;
48+
49+
$versions = file_get_contents('https://packagist.org/packages/'.$package->name.'.json');
50+
$versions = json_decode($versions);
51+
52+
foreach ($versions->package->versions as $v => $package) {
53+
$packages[$package->name] += array($v => $package);
54+
}
55+
}
56+
57+
file_put_contents('packages.json', json_encode(compact('packages'), $flags));
58+
59+
if ($dirs) {
60+
$json = ltrim(file_get_contents('composer.json'));
61+
if (null === $package = json_decode($json)) {
62+
passthru("composer validate $dir/composer.json");
63+
exit(1);
64+
}
65+
66+
$package->repositories = array(array(
67+
'type' => 'composer',
68+
'url' => 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__)).'/',
69+
));
70+
if (false === strpos($json, "\n \"repositories\": [\n")) {
71+
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
72+
file_put_contents('composer.json', $json);
73+
}
74+
}

.github/travis.php

Lines changed: 0 additions & 54 deletions
This file was deleted.

.travis.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,29 @@ before_install:
6363
- if [[ ! $skip && ! $PHP = hhvm* ]]; then echo extension = redis.so >> $INI_FILE; fi;
6464
- if [[ ! $skip && ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
6565
- if [[ ! $skip ]]; then [ -d ~/.composer ] || mkdir ~/.composer; cp .composer/* ~/.composer/; fi
66-
- if [[ ! $skip ]]; then ./phpunit install; fi
6766
- if [[ ! $skip ]]; then export PHPUNIT=$(readlink -f ./phpunit); fi
6867
- if [[ ! $skip ]]; then ldapadd -h localhost:3389 -D cn=admin,dc=symfony,dc=com -w symfony -f src/Symfony/Component/Ldap/Tests/Fixtures/data/base.ldif; fi
6968
- if [[ ! $skip ]]; then ldapadd -h localhost:3389 -D cn=admin,dc=symfony,dc=com -w symfony -f src/Symfony/Component/Ldap/Tests/Fixtures/data/fixtures.ldif; fi
7069

7170
install:
71+
- if [[ ! $skip && $deps ]]; then cp composer.json composer.json.orig; fi
72+
- if [[ ! $skip && $deps ]]; then echo -e '{\n"require":{'"$(grep phpunit-bridge composer.json)"'"php":"*"},"minimum-stability":"dev"}' > composer.json; fi
7273
- if [[ ! $skip ]]; then COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi
7374
# Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
74-
- if [[ ! $skip && $deps ]]; then git fetch origin $TRAVIS_BRANCH && php .github/travis.php FETCH_HEAD $TRAVIS_BRANCH $COMPONENTS; fi
75+
- if [[ ! $skip && $deps ]]; then php .github/build-packages.php HEAD^ $TRAVIS_BRANCH $COMPONENTS; fi
76+
- if [[ ! $skip && $deps ]]; then mv composer.json composer.json.phpunit; mv composer.json.orig composer.json; fi
77+
- if [[ ! $skip && ! $deps ]]; then php .github/build-packages.php HEAD^ $TRAVIS_BRANCH src/Symfony/Bridge/PhpUnit; fi
7578
# For the master branch when deps=high, the version before master is checked out and tested with the locally patched components
7679
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//); else SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*'); fi
77-
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); ./phpunit install; fi
80+
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi
7881
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number than the next one
7982
- if [[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]]; then LEGACY=,legacy; fi
8083
- export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
81-
- if [[ ! $deps ]]; then composer update; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi
82-
- if [[ $TRAVIS_BRANCH = master ]]; then export SYMFONY_PHPUNIT_OVERLOAD=1; fi
83-
- if [[ ! $PHP = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
84+
- if [[ ! $skip && $deps ]]; then export SYMFONY_DEPRECATIONS_HELPER=weak; fi
85+
- if [[ ! $skip && $deps ]]; then mv composer.json.phpunit composer.json; fi
86+
- if [[ ! $skip ]]; then composer update; fi
87+
- if [[ ! $skip ]]; then COMPOSER_ROOT_VERSION= ./phpunit install; fi
88+
- if [[ ! $skip && ! $PHP = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
8489

8590
script:
8691
- if [[ $skip ]]; then echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"; fi

CONTRIBUTORS.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Symfony is the result of the work of many people who made the code better
1616
- Kris Wallsmith (kriswallsmith)
1717
- Jakub Zalas (jakubzalas)
1818
- Ryan Weaver (weaverryan)
19-
- Kévin Dunglas (dunglas)
2019
- Javier Eguiluz (javier.eguiluz)
20+
- Kévin Dunglas (dunglas)
2121
- Hugo Hamon (hhamon)
2222
- Abdellatif Ait boudad (aitboudad)
2323
- Pascal Borreli (pborreli)
@@ -52,8 +52,8 @@ Symfony is the result of the work of many people who made the code better
5252
- Konstantin Kudryashov (everzet)
5353
- Bilal Amarni (bamarni)
5454
- Florin Patan (florinpatan)
55-
- Peter Rehm (rpet)
5655
- Ener-Getick (energetick)
56+
- Peter Rehm (rpet)
5757
- Iltar van der Berg (kjarli)
5858
- Kevin Bond (kbond)
5959
- Andrej Hudec (pulzarraider)
@@ -315,6 +315,7 @@ Symfony is the result of the work of many people who made the code better
315315
- JhonnyL
316316
- hossein zolfi (ocean)
317317
- Clément Gautier (clementgautier)
318+
- James Halsall (jaitsu)
318319
- Eduardo Gulias (egulias)
319320
- giulio de donato (liuggio)
320321
- Stéphane PY (steph_py)
@@ -396,7 +397,6 @@ Symfony is the result of the work of many people who made the code better
396397
- Christian Wahler
397398
- Mathieu Lemoine
398399
- Gintautas Miselis
399-
- James Halsall (jaitsu)
400400
- David Badura (davidbadura)
401401
- Zander Baldwin
402402
- Adam Harvey
@@ -1302,6 +1302,7 @@ Symfony is the result of the work of many people who made the code better
13021302
- Muriel (metalmumu)
13031303
- Michael Pohlers (mick_the_big)
13041304
- Cayetano Soriano Gallego (neoshadybeat)
1305+
- Ondrej Machulda (ondram)
13051306
- Patrick McDougle (patrick-mcdougle)
13061307
- Pablo Monterde Perez (plebs)
13071308
- Jimmy Leger (redpanda)

appveyor.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,20 @@ install:
4444
- echo curl.cainfo=c:\php\cacert.pem >> php.ini-max
4545
- copy /Y php.ini-max php.ini
4646
- cd c:\projects\symfony
47-
- IF NOT EXIST composer.phar (appveyor DownloadFile https://getcomposer.org/download/1.2.0/composer.phar)
47+
- IF NOT EXIST composer.phar (appveyor DownloadFile https://getcomposer.org/download/1.2.1/composer.phar)
4848
- php composer.phar self-update
4949
- copy /Y .composer\* %APPDATA%\Composer\
50-
- php phpunit install
50+
- php .github/build-packages.php "HEAD^" %APPVEYOR_REPO_BRANCH% src\Symfony\Bridge\PhpUnit
5151
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
5252
- php composer.phar update --no-progress --ansi
53+
- SET COMPOSER_ROOT_VERSION=
54+
- php phpunit install
5355

5456
test_script:
5557
- cd c:\projects\symfony
5658
- SET X=0
5759
- copy /Y c:\php\php.ini-min c:\php\php.ini
58-
- php phpunit symfony --exclude-group benchmark,intl-data || SET X=!errorlevel!
60+
- php phpunit src\Symfony --exclude-group benchmark,intl-data || SET X=!errorlevel!
5961
- copy /Y c:\php\php.ini-max c:\php\php.ini
60-
- php phpunit symfony --exclude-group benchmark,intl-data || SET X=!errorlevel!
62+
- php phpunit src\Symfony --exclude-group benchmark,intl-data || SET X=!errorlevel!
6163
- exit %X%

composer.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
"monolog/monolog": "~1.11",
8686
"ocramius/proxy-manager": "~0.4|~1.0|~2.0",
8787
"predis/predis": "~1.0",
88+
"symfony/phpunit-bridge": "~3.2",
8889
"egulias/email-validator": "~1.2,>=1.2.1",
8990
"symfony/polyfill-apcu": "~1.1",
9091
"symfony/security-acl": "~2.8|~3.0",
@@ -114,11 +115,6 @@
114115
"**/Tests/"
115116
]
116117
},
117-
"autoload-dev": {
118-
"psr-4": {
119-
"Symfony\\Bridge\\PhpUnit\\": "src/Symfony/Bridge/PhpUnit/"
120-
}
121-
},
122118
"minimum-stability": "dev",
123119
"extra": {
124120
"branch-alias": {

0 commit comments

Comments
 (0)