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 5f48ccd

Browse filesBrowse files
Cleanup
1 parent e229dd0 commit 5f48ccd
Copy full SHA for 5f48ccd

File tree

Expand file treeCollapse file tree

14 files changed

+35
-96
lines changed
Filter options
Expand file treeCollapse file tree

14 files changed

+35
-96
lines changed

‎.github/build-packages.php

Copy file name to clipboardExpand all lines: .github/build-packages.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
$dirs = $_SERVER['argv'];
1010
array_shift($dirs);
1111
$mergeBase = trim(shell_exec(sprintf('git merge-base %s HEAD', array_shift($dirs))));
12+
1213
$packages = array();
1314
$flags = \PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
1415

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
+4-12Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,8 @@ env:
1818

1919
matrix:
2020
include:
21-
- php: hhvm-3.18
22-
sudo: required
23-
group: edge
24-
- php: 5.4
25-
- php: 5.5
26-
- php: 5.6
27-
- php: 7.0
28-
env: deps=high
29-
- php: 7.1
3021
- php: 7.2
22+
env: deps=low
3123
fast_finish: true
3224

3325
cache:
@@ -137,7 +129,7 @@ install:
137129
export SYMFONY_DEPRECATIONS_HELPER=weak &&
138130
cp composer.json composer.json.orig &&
139131
echo -e '{\n"require":{'"$(grep phpunit-bridge composer.json)"'"php":"*"},"minimum-stability":"dev"}' > composer.json &&
140-
(php .github/build-packages.php HEAD^ $COMPONENTS) &&
132+
php .github/build-packages.php HEAD^ $COMPONENTS &&
141133
mv composer.json composer.json.phpunit &&
142134
mv composer.json.orig composer.json
143135
fi
@@ -176,9 +168,9 @@ install:
176168
if [[ $skip ]]; then
177169
echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
178170
elif [[ $deps = high ]]; then
179-
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && ($COMPOSER_UP) && $PHPUNIT_X$LEGACY'"
171+
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'"
180172
elif [[ $deps = low ]]; then
181-
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && ($COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'"
173+
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP --prefer-lowest --prefer-stable && $PHPUNIT_X'"
182174
elif [[ $PHP = hhvm* ]]; then
183175
$PHPUNIT --exclude-group benchmark,intl-data
184176
else

‎src/Symfony/Bridge/Twig/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"symfony/asset": "~2.7",
2424
"symfony/finder": "~2.3",
2525
"symfony/form": "~2.7.30|^2.8.23",
26+
"symfony/http-foundation": "~2.7.36|^2.8.29",
2627
"symfony/http-kernel": "~2.3",
2728
"symfony/intl": "~2.3",
2829
"symfony/routing": "~2.2",

‎src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testCacheIsFreshAfterCacheClearedWithWarmup()
5555
$finder = new Finder();
5656
$metaFiles = $finder->files()->in($this->kernel->getCacheDir())->name('*.php.meta');
5757
// simply check that cache is warmed up
58-
$this->assertGreaterThanOrEqual(1, count($metaFiles));
58+
$this->assertNotEmpty($metaFiles);
5959
foreach ($metaFiles as $file) {
6060
$configCache = new ConfigCache(substr($file, 0, -5), true);
6161
$this->assertTrue(

‎src/Symfony/Bundle/FrameworkBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"symfony/config": "~2.4",
2424
"symfony/event-dispatcher": "~2.5",
2525
"symfony/finder": "^2.0.5",
26-
"symfony/http-foundation": "~2.7",
26+
"symfony/http-foundation": "~2.7.36|^2.8.29",
2727
"symfony/http-kernel": "~2.7.29|^2.8.22",
2828
"symfony/filesystem": "~2.3",
2929
"symfony/routing": "~2.7.24|^2.8.17",

‎src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ public function testNotice()
7979
$this->assertEquals(E_NOTICE, $exception->getSeverity());
8080
$this->assertEquals(__FILE__, $exception->getFile());
8181
$this->assertRegExp('/^Notice: Undefined variable: (foo|bar)/', $exception->getMessage());
82-
$this->assertArrayHasKey('foobar', $exception->getContext());
82+
if (\PHP_VERSION_ID < 70200) {
83+
$this->assertArrayHasKey('foobar', $exception->getContext());
84+
}
8385

8486
$trace = $exception->getTrace();
8587
$this->assertEquals(__FILE__, $trace[0]['file']);

‎src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/LegacyDefaultCsrfProviderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/LegacyDefaultCsrfProviderTest.php
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ class LegacyDefaultCsrfProviderTest extends TestCase
2323
{
2424
protected $provider;
2525

26-
public static function setUpBeforeClass()
27-
{
28-
if (\PHP_VERSION_ID < 70200) {
29-
ini_set('session.save_handler', 'files');
30-
ini_set('session.save_path', sys_get_temp_dir());
31-
}
32-
}
33-
3426
protected function setUp()
3527
{
3628
$this->provider = new DefaultCsrfProvider('SECRET');

‎src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
+17-12Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,11 @@ class NativeSessionStorage implements SessionStorageInterface
101101
*/
102102
public function __construct(array $options = array(), $handler = null, MetadataBag $metaBag = null)
103103
{
104-
if (empty($options)) {
105-
$options += array('cache_limiter' => 'public');
106-
}
107-
if (1 !== (int) ini_get('session.use_cookies')) {
108-
ini_set('session.use_cookies', 1);
109-
}
104+
$options += array(
105+
// disable by default because it's managed by HeaderBag (if used)
106+
'cache_limiter' => '',
107+
'use_cookies' => 1,
108+
);
110109

111110
if (\PHP_VERSION_ID >= 50400) {
112111
session_register_shutdown();
@@ -212,6 +211,10 @@ public function regenerate($destroy = false, $lifetime = null)
212211
return false;
213212
}
214213

214+
if (headers_sent()) {
215+
return false;
216+
}
217+
215218
if (null !== $lifetime) {
216219
ini_set('session.cookie_lifetime', $lifetime);
217220
}
@@ -336,6 +339,10 @@ public function isStarted()
336339
*/
337340
public function setOptions(array $options)
338341
{
342+
if (headers_sent()) {
343+
return;
344+
}
345+
339346
$validOptions = array_flip(array(
340347
'cache_limiter', 'cookie_domain', 'cookie_httponly',
341348
'cookie_lifetime', 'cookie_path', 'cookie_secure',
@@ -349,11 +356,9 @@ public function setOptions(array $options)
349356
'sid_length', 'sid_bits_per_character', 'trans_sid_hosts', 'trans_sid_tags',
350357
));
351358

352-
if (PHP_VERSION_ID < 70200 || !headers_sent()) {
353-
foreach ($options as $key => $value) {
354-
if (isset($validOptions[$key])) {
355-
ini_set('session.'.$key, $value);
356-
}
359+
foreach ($options as $key => $value) {
360+
if (isset($validOptions[$key])) {
361+
ini_set('session.'.$key, $value);
357362
}
358363
}
359364
}
@@ -398,7 +403,7 @@ public function setSaveHandler($saveHandler = null)
398403
}
399404
$this->saveHandler = $saveHandler;
400405

401-
if ($this->saveHandler instanceof \SessionHandlerInterface && false === headers_sent()) {
406+
if ($this->saveHandler instanceof \SessionHandlerInterface && !headers_sent()) {
402407
if (\PHP_VERSION_ID >= 50400) {
403408
session_set_save_handler($this->saveHandler, false);
404409
} else {

‎src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
+3-41Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,7 @@ public function testSessionDestroy()
271271

272272
public function testSessionGC()
273273
{
274-
if (\PHP_VERSION_ID >= 70200) {
275-
$this->markTestSkipped('PHP version is 7.2');
276-
}
277-
278-
$previousLifeTime = ini_set('session.gc_maxlifetime', 1000);
274+
$previousLifeTime = @ini_set('session.gc_maxlifetime', 1000);
279275
$pdo = $this->getMemorySqlitePdo();
280276
$storage = new PdoSessionHandler($pdo);
281277

@@ -286,52 +282,18 @@ public function testSessionGC()
286282

287283
$storage->open('', 'sid');
288284
$storage->read('gc_id');
289-
// IN 7.2 this does not work
290-
ini_set('session.gc_maxlifetime', -1); // test that you can set lifetime of a session after it has been read
285+
@ini_set('session.gc_maxlifetime', -1); // test that you can set lifetime of a session after it has been read
291286
$storage->write('gc_id', 'data');
292287
$storage->close();
293288
$this->assertEquals(2, $pdo->query('SELECT COUNT(*) FROM sessions')->fetchColumn(), 'No session pruned because gc not called');
294-
$storage->destroy('gc_id');
295289

296290
$storage->open('', 'sid');
297291
$data = $storage->read('gc_id');
298292
$storage->gc(-1);
299293
$storage->close();
300294

301-
ini_set('session.gc_maxlifetime', $previousLifeTime);
302-
$this->assertSame('', $data, 'Session already considered garbage, so not returning data even if it is not pruned yet');
303-
$this->assertEquals(1, $pdo->query('SELECT COUNT(*) FROM sessions')->fetchColumn(), 'Expired session is pruned');
304-
}
305-
306-
public function testSessionGC72()
307-
{
308-
if (\PHP_VERSION_ID <= 70200) {
309-
$this->markTestSkipped('PHP version is not 7.2');
310-
}
311-
312-
$previousLifeTime = false === headers_sent() && ini_set('session.gc_maxlifetime', 1000);
313-
$pdo = $this->getMemorySqlitePdo();
314-
$storage = new PdoSessionHandler($pdo);
315-
316-
$storage->open('', 'sid');
317-
$storage->read('id');
318-
$storage->write('id', 'data');
319-
$storage->close();
320-
321-
$storage->open('', 'sid');
322-
$storage->read('gc_id');
323-
false === headers_sent() && ini_set('session.gc_maxlifetime', -1); // test that you can set lifetime of a session after it has been read
324-
$storage->write('gc_id', 'data');
325-
$storage->close();
326-
$this->assertEquals(2, $pdo->query('SELECT COUNT(*) FROM sessions')->fetchColumn(), 'No session pruned because gc not called');
327-
true === headers_sent() && $storage->destroy('gc_id');
328-
329-
$storage->open('', 'sid');
330-
$data = $storage->read('gc_id');
331-
$storage->gc(-1);
332-
$storage->close();
295+
@ini_set('session.gc_maxlifetime', $previousLifeTime);
333296

334-
false === headers_sent() && ini_set('session.gc_maxlifetime', $previousLifeTime);
335297
$this->assertSame('', $data, 'Session already considered garbage, so not returning data even if it is not pruned yet');
336298
$this->assertEquals(1, $pdo->query('SELECT COUNT(*) FROM sessions')->fetchColumn(), 'Expired session is pruned');
337299
}

‎src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function testDefaultSessionCacheLimiter()
152152
{
153153
$this->iniSet('session.cache_limiter', 'nocache');
154154

155-
$storage = new NativeSessionStorage(array('cache_limiter' => ''));
155+
$storage = new NativeSessionStorage();
156156
$this->assertEquals('', ini_get('session.cache_limiter'));
157157
}
158158

‎src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleListenerTest.php
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,7 @@ public function testDefaultLocaleWithoutSession()
3838
public function testLocaleFromRequestAttribute()
3939
{
4040
$request = Request::create('/');
41-
42-
if (PHP_VERSION_ID < 70200 || !headers_sent()) {
43-
session_name('foo');
44-
}
45-
46-
$request->cookies->set('foo', 'value');
41+
$request->cookies->set(session_name(), 'value');
4742

4843
$request->attributes->set('_locale', 'es');
4944
$listener = new LocaleListener('fr', null, $this->requestStack);

‎src/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ public function testDoesNotDeleteCookieIfUsingSessionLifetime()
6262
{
6363
$this->sessionHasBeenStarted();
6464

65-
$params = session_get_cookie_params();
66-
// session_set_cookie_params(0, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
65+
@ini_set('session.cookie_lifetime', 0);
6766

6867
$response = $this->filterResponse(new Request(), HttpKernelInterface::MASTER_REQUEST);
6968
$cookies = $response->headers->getCookies();

‎src/Symfony/Component/HttpKernel/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=5.3.9",
2020
"symfony/event-dispatcher": "^2.6.7",
21-
"symfony/http-foundation": "~2.7.20|^2.8.13",
21+
"symfony/http-foundation": "~2.7.36|^2.8.29",
2222
"symfony/debug": "^2.6.2",
2323
"psr/log": "~1.0"
2424
},

‎src/Symfony/Component/Security/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php
-10Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ class NativeSessionTokenStorageTest extends TestCase
2929
*/
3030
private $storage;
3131

32-
public static function setUpBeforeClass()
33-
{
34-
if (\PHP_VERSION_ID < 70200) {
35-
ini_set('session.save_handler', 'files');
36-
ini_set('session.save_path', sys_get_temp_dir());
37-
}
38-
39-
parent::setUpBeforeClass();
40-
}
41-
4232
protected function setUp()
4333
{
4434
$_SESSION = array();

0 commit comments

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