Skip to content

Commit 2e111b3

Browse files
committed
Merge branch '3.3' into 3.4
* 3.3: (27 commits) Always require symfony/polyfill-apcu to provide APCuIterator everywhere bumped Symfony version to 3.3.9 updated VERSION for 3.3.8 updated CHANGELOG for 3.3.8 [DI] Fix tracking env var placeholders nested in object graphs bumped Symfony version to 3.3.8 updated VERSION for 3.3.7 updated CHANGELOG for 3.3.7 [DI] Fix tracking env vars when merging configs (bis) removed obsolete comment install PHPUnit 6 on PHP 7.2 [Cache] Use zend.detect_unicode instead of zend.multibyte Fix case sensitive typo in use class name [VarDumper] Enhance docblock to tell about AbstractDumper::dumpLine(-1) [Debug] Remove false-positive check in DebugClassLoader [Validator] Fix use of GroupSequenceProvider in child classes Change number PHPDoc type to int|float [Cache] Workaround zend.detect_unicode + zend.multibyte [VarDumper] Strengthen dumped JS [VarDumper] Strengthen dumped JS ...
2 parents dda57e6 + ec7a2b1 commit 2e111b3

31 files changed

+370
-122
lines changed

.travis.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,38 @@ before_install:
5656
export PHPUNIT_X="$PHPUNIT --exclude-group tty,benchmark,intl-data"
5757
export COMPOSER_UP='composer update --no-progress --no-suggest --ansi'
5858
59+
nanoseconds() {
60+
local cmd="date"
61+
local format="+%s%N"
62+
local os=$(uname)
63+
if hash gdate > /dev/null 2>&1; then
64+
cmd="gdate"
65+
elif [[ "$os" = Darwin ]]; then
66+
format="+%s000000000"
67+
fi
68+
$cmd -u $format
69+
}
70+
export -f nanoseconds
71+
5972
# tfold is a helper to create folded reports
6073
tfold () {
61-
title=$1
62-
fold=$(echo $title | sed -r 's/[^-_A-Za-z\d]+/./g')
74+
local title=$1
75+
local fold=$(echo $title | sed -r 's/[^-_A-Za-z0-9]+/./g')
6376
shift
64-
echo -e "travis_fold:start:$fold\\n\\e[1;34m$title\\e[0m"
65-
bash -xc "$*" 2>&1 &&
77+
local id=$(printf %08x $(( RANDOM * RANDOM )))
78+
local start=$(nanoseconds)
79+
echo -e "travis_fold:start:$fold"
80+
echo -e "travis_time:start:$id"
81+
echo -e "\\e[1;34m$title\\e[0m"
82+
83+
bash -xc "$*" 2>&1
84+
local ok=$?
85+
local end=$(nanoseconds)
86+
echo -e "\\ntravis_time:end:$id:start=$start,finish=$end,duration=$(($end-$start))"
87+
(exit $ok) &&
6688
echo -e "\\e[32mOK\\e[0m $title\\n\\ntravis_fold:end:$fold" ||
67-
( echo -e "\\e[41mKO\\e[0m $title\\n" && exit 1 )
89+
echo -e "\\e[41mKO\\e[0m $title\\n"
90+
(exit $ok)
6891
}
6992
export -f tfold
7093

CHANGELOG-3.3.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,50 @@ in 3.3 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.3.0...v3.3.1
99

10+
* 3.3.8 (2017-08-28)
11+
12+
* bug #24016 [DI] Fix tracking env var placeholders nested in object graphs (nicolas-grekas)
13+
14+
* 3.3.7 (2017-08-28)
15+
16+
* bug #24009 [DI] Fix tracking env vars when merging configs (bis) (nicolas-grekas)
17+
* bug #23952 [PhpUnitBridge] install PHPUnit 6 on PHP 7.2 (xabbuh)
18+
* bug #23985 [Cache] Workaround zend.detect_unicode + zend.multibyte (nicolas-grekas)
19+
* bug #23989 [Debug] Remove false-positive check in DebugClassLoader (nicolas-grekas)
20+
* bug #23983 [VarDumper] Strengthen dumped JS (nicolas-grekas)
21+
* bug #23982 [VarDumper] Strengthen dumped JS (nicolas-grekas)
22+
* bug #23925 [Validator] Fix use of GroupSequenceProvider in child classes (linniksa)
23+
* bug #23971 [Cache] Fix lazy Memcached connections (nicolas-grekas)
24+
* bug #23970 [Cache] Fix >30 days expirations with Memcached (nicolas-grekas)
25+
* bug #23949 [Dotenv] Get env using $_SERVER to work with fastcgi_param and workaround thread safety issues (nicolas-grekas)
26+
* bug #23799 [Dotenv][WebServerBundle] Override previously loaded variables (voronkovich)
27+
* bug #23676 [WebProfilerBundle] Re add missing link to the controller (lyrixx)
28+
* bug #23870 [DI] Use GlobResource for non-tracked directories (vudaltsov)
29+
* bug #23945 [Validator] Fix Greek translation (azhurb)
30+
* bug #23940 [DI] Fix resolving env vars when compiling a ContainerBuilder (nicolas-grekas)
31+
* bug #23903 [DI] Fix merging of env vars in configs (nicolas-grekas)
32+
* bug #23825 Revert "feature #21038 [FrameworkBundle] deprecated cache:clear with warmup (fabpot)" (nicolas-grekas)
33+
* bug #23899 [DI] Fix reading env vars from fastcgi params (nicolas-grekas)
34+
* bug #23909 [Console] Initialize lazily to render exceptions properly (nicolas-grekas)
35+
* bug #23878 [VarDumper] play nice with open_basedir when looking for composer.json (nicolas-grekas)
36+
* bug #23897 Allow phpdocumentor/reflection-docblock 4 (derrabus)
37+
* bug #23865 [Workflow] fixed InvalidDefinitionException message for StateMachineValidator (fmata)
38+
* bug #23856 [DI] Fix dumping abstract with YamlDumper (nicolas-grekas)
39+
* bug #23848 restrict reflection doc block (ElectricMaxxx)
40+
* bug #23854 [DI] Fix YamlDumper not dumping abstract and autoconfigure (nicolas-grekas)
41+
* bug #23752 Ignore memcached missing key error on session destroy (jderusse)
42+
* bug #23829 Fixed the exception page design in responsive mode (javiereguiluz)
43+
* bug #23828 [Console] Log exit codes as debug messages instead of errors (haroldiedema)
44+
* bug #23763 [Cache] Hash cache key on save (lstrojny)
45+
* bug #23806 [Profiler] Fix request_collector check in main layout (ogizanagi)
46+
* bug #23658 [HttpFoundation] Generate safe fallback filename for wrongly encoded filename (xelaris)
47+
* bug #23776 [FrameworkBundle] Warmup annotations for bundle-less controllers and entities (nicolas-grekas)
48+
* bug #23783 Avoid infinite loops when profiler data is malformed (javiereguiluz)
49+
* bug #23638 [FrameworkBundle][Workflow] better errors when security deps are missing (xabbuh)
50+
* bug #23729 [Bridge\ProxyManager] Dont call __destruct() on non-instantiated services (nicolas-grekas)
51+
* bug #23703 Bump minimal PHP version to ^5.5.9|>=7.0.8 (nicolas-grekas)
52+
* bug #23755 [Config] Fix checking class existence freshness (nicolas-grekas)
53+
1054
* 3.3.6 (2017-08-01)
1155

1256
* bug #22244 [Console] Fix passing options with defaultCommand (Jakub Sacha)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"psr/link": "^1.0",
2727
"psr/log": "~1.0",
2828
"psr/simple-cache": "^1.0",
29+
"symfony/polyfill-apcu": "~1.1",
2930
"symfony/polyfill-intl-icu": "~1.0",
3031
"symfony/polyfill-mbstring": "~1.0",
3132
"symfony/polyfill-php56": "~1.0",
@@ -97,7 +98,6 @@
9798
"predis/predis": "~1.0",
9899
"egulias/email-validator": "~1.2,>=1.2.8|~2.0",
99100
"symfony/phpunit-bridge": "~3.2",
100-
"symfony/polyfill-apcu": "~1.1",
101101
"symfony/security-acl": "~2.8|~3.0",
102102
"phpdocumentor/reflection-docblock": "^3.0|^4.0"
103103
},

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,17 @@
1515

1616
error_reporting(-1);
1717

18-
// PHPUnit 4.8 does not support PHP 7, while 5.1 requires PHP 5.6+
19-
$PHPUNIT_VERSION = PHP_VERSION_ID >= 50600 ? getenv('SYMFONY_PHPUNIT_VERSION') ?: '5.7' : '4.8';
18+
if (PHP_VERSION_ID >= 70200) {
19+
// PHPUnit 6 is required for PHP 7.2+
20+
$PHPUNIT_VERSION = getenv('SYMFONY_PHPUNIT_VERSION') ?: '6.3';
21+
} elseif (PHP_VERSION_ID >= 50600) {
22+
// PHPUnit 4 does not support PHP 7
23+
$PHPUNIT_VERSION = getenv('SYMFONY_PHPUNIT_VERSION') ?: '5.7';
24+
} else {
25+
// PHPUnit 5.1 requires PHP 5.6+
26+
$PHPUNIT_VERSION = '4.8';
27+
}
28+
2029
$oldPwd = getcwd();
2130
$PHPUNIT_DIR = getenv('SYMFONY_PHPUNIT_DIR') ?: (__DIR__.'/.phpunit');
2231
$PHP = defined('PHP_BINARY') ? PHP_BINARY : 'php';

src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function __construct($file, AdapterInterface $fallbackPool)
3838
{
3939
$this->file = $file;
4040
$this->fallbackPool = $fallbackPool;
41+
$this->zendDetectUnicode = ini_get('zend.detect_unicode');
4142
$this->createCacheItem = \Closure::bind(
4243
function ($key, $value, $isHit) {
4344
$item = new CacheItem();

src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ public function __construct($namespace = '', $defaultLifetime = 0, $directory =
3636

3737
$e = new \Exception();
3838
$this->includeHandler = function () use ($e) { throw $e; };
39+
$this->zendDetectUnicode = ini_get('zend.detect_unicode');
3940
}
4041
}

src/Symfony/Component/Cache/Simple/PhpArrayCache.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function __construct($file, CacheInterface $fallbackPool)
3434
{
3535
$this->file = $file;
3636
$this->fallbackPool = $fallbackPool;
37+
$this->zendDetectUnicode = ini_get('zend.detect_unicode');
3738
}
3839

3940
/**

src/Symfony/Component/Cache/Simple/PhpFilesCache.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ public function __construct($namespace = '', $defaultLifetime = 0, $directory =
3636

3737
$e = new \Exception();
3838
$this->includeHandler = function () use ($e) { throw $e; };
39+
$this->zendDetectUnicode = ini_get('zend.detect_unicode');
3940
}
4041
}

src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,26 @@ public function testDefaultLifeTime()
5050
$this->assertFalse($item->isHit());
5151
}
5252

53+
public function testExpiration()
54+
{
55+
if (isset($this->skippedTests[__FUNCTION__])) {
56+
$this->markTestSkipped($this->skippedTests[__FUNCTION__]);
57+
}
58+
59+
$cache = $this->createCachePool();
60+
$cache->save($cache->getItem('k1')->set('v1')->expiresAfter(2));
61+
$cache->save($cache->getItem('k2')->set('v2')->expiresAfter(366 * 86400));
62+
63+
sleep(3);
64+
$item = $cache->getItem('k1');
65+
$this->assertFalse($item->isHit());
66+
$this->assertNull($item->get(), "Item's value must be null when isHit() is false.");
67+
68+
$item = $cache->getItem('k2');
69+
$this->assertTrue($item->isHit());
70+
$this->assertSame('v2', $item->get());
71+
}
72+
5373
public function testNotUnserializable()
5474
{
5575
if (isset($this->skippedTests[__FUNCTION__])) {

src/Symfony/Component/Cache/Tests/Adapter/ApcuAdapterTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,31 @@ public function testVersion()
7777
$this->assertNull($item->get());
7878
}
7979

80+
public function testNamespace()
81+
{
82+
$namespace = str_replace('\\', '.', get_class($this));
83+
84+
$pool1 = new ApcuAdapter($namespace.'_1', 0, 'p1');
85+
86+
$item = $pool1->getItem('foo');
87+
$this->assertFalse($item->isHit());
88+
$this->assertTrue($pool1->save($item->set('bar')));
89+
90+
$item = $pool1->getItem('foo');
91+
$this->assertTrue($item->isHit());
92+
$this->assertSame('bar', $item->get());
93+
94+
$pool2 = new ApcuAdapter($namespace.'_2', 0, 'p1');
95+
96+
$item = $pool2->getItem('foo');
97+
$this->assertFalse($item->isHit());
98+
$this->assertNull($item->get());
99+
100+
$item = $pool1->getItem('foo');
101+
$this->assertTrue($item->isHit());
102+
$this->assertSame('bar', $item->get());
103+
}
104+
80105
public function testWithCliSapi()
81106
{
82107
try {

0 commit comments

Comments
 (0)