8000 Merge branch '3.4' into 4.1 · symfony/cache@6fedee3 · GitHub
[go: up one dir, main page]

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
8000

Commit 6fedee3

Browse files
Merge branch '3.4' into 4.1
* 3.4: [VarDumper] fix dump of closures created from callables [DI] fix dumping inlined services Add framework asset changes to upgrade 3.0 guide [Travis] Bump ext-mongodb to 1.5.2 on Travis [DI] dont track classes/interfaces used to compute autowiring error messages [DI] fix GraphvizDumper ignoring inline definitions bumped Symfony version to 3.4.19 updated VERSION for 3.4.18 updated CHANGELOG for 3.4.18 bumped Symfony version to 2.8.48 updated VERSION for 2.8.47 update CONTRIBUTORS for 2.8.47 updated CHANGELOG for 2.8.47 Fix ini_get() for boolean values
2 parents 05ce0dd + 503573d commit 6fedee3

11 files changed

+19
-19
lines changed

Adapter/AbstractAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public static function createSystemCache($namespace, $defaultLifetime, $version,
114114
}
115115

116116
$apcu = new ApcuAdapter($namespace, (int) $defaultLifetime / 5, $version);
117-
if ('cli' === \PHP_SAPI && !ini_get('apc.enable_cli')) {
117+
if ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
118118
$apcu->setLogger(new NullLogger());
119119
} elseif (null !== $logger) {
120120
$apcu->setLogger($logger);

Adapter/PhpArrayAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(string $file, AdapterInterface $fallbackPool)
4040
{
4141
$this->file = $file;
4242
$this->pool = $fallbackPool;
43-
$this->zendDetectUnicode = ini_get('zend.detect_unicode');
43+
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), FILTER_VALIDATE_BOOLEAN);
4444
$this->createCacheItem = \Closure::bind(
4545
function ($key, $value, $isHit) {
4646
$item = new CacheItem();
@@ -66,7 +66,7 @@ function ($key, $value, $isHit) {
6666
public static function create($file, CacheItemPoolInterface $fallbackPool)
6767
{
6868
// Shared memory is available in PHP 7.0+ with OPCache enabled
69-
if (ini_get('opcache.enable')) {
69+
if (filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
7070
if (!$fallbackPool instanceof AdapterInterface) {
7171
$fallbackPool = new ProxyAdapter($fallbackPool);
7272
}

Adapter/PhpFilesAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ public function __construct(string $namespace = '', int $defaultLifetime = 0, st
3232

3333
$e = new \Exception();
3434
$this->includeHandler = function () use ($e) { throw $e; };
35-
$this->zendDetectUnicode = ini_get('zend.detect_unicode');
35+
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), FILTER_VALIDATE_BOOLEAN);
3636
}
3737
}

Simple/PhpArrayCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(string $file, CacheInterface $fallbackPool)
3636
{
3737
$this->file = $file;
3838
$this->pool = $fallbackPool;
39-
$this->zendDetectUnicode = ini_get('zend.detect_unicode');
39+
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), FILTER_VALIDATE_BOOLEAN);
4040
}
4141

4242
/**
@@ -49,7 +49,7 @@ public function __construct(string $file, CacheInterface $fallbackPool)
4949
public static function create($file, CacheInterface $fallbackPool)
5050
{
5151
// Shared memory is available in PHP 7.0+ with OPCache enabled
52-
if (ini_get('opcache.enable')) {
52+
if (filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
5353
return new static($file, $fallbackPool);
5454
}
5555

Simple/PhpFilesCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ public function __construct(string $namespace = '', int $defaultLifetime = 0, st
3232

3333
$e = new \Exception();
3434
$this->includeHandler = function () use ($e) { throw $e; };
35-
$this->zendDetectUnicode = ini_get('zend.detect_unicode');
35+
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), FILTER_VALIDATE_BOOLEAN);
3636
}
3737
}

Tests/Adapter/ApcuAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ class ApcuAdapterTest extends AdapterTestCase
2424

2525
public function createCachePool($defaultLifetime = 0)
2626
{
27-
if (!\function_exists('apcu_fetch') || !ini_get('apc.enabled')) {
27+
if (!\function_exists('apcu_fetch') || !filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN)) {
2828
$this->markTestSkipped('APCu extension is required.');
2929
}
30-
if ('cli' === \PHP_SAPI && !ini_get('apc.enable_cli')) {
30+
if ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
3131
if ('testWithCliSapi' !== $this->getName()) {
3232
$this->markTestSkipped('apc.enable_cli=1 is required.');
3333
}

Tests/Adapter/MemcachedAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function provideServersSetting()
137137
'localhost',
138138
11222,
139139
);
140-
if (ini_get('memcached.use_sasl')) {
140+
if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) {
141141
yield array(
142142
'memcached://user:password@127.0.0.1?weight=50',
143143
'127.0.0.1',
@@ -154,7 +154,7 @@ public function provideServersSetting()
154154
'/var/local/run/memcached.socket',
155155
0,
156156
);
157-
if (ini_get('memcached.use_sasl')) {
157+
if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) {
158158
yield array(
159159
'memcached://user:password@/var/local/run/memcached.socket?weight=25',
160160
'/var/local/run/memcached.socket',

Tests/Simple/ApcuCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ApcuCacheTest extends CacheTestCase
2323

2424
public function createSimpleCache($defaultLifetime = 0)
2525
{
26-
if (!\function_exists('apcu_fetch') || !ini_get('apc.enabled') || ('cli' === \PHP_SAPI && !ini_get('apc.enable_cli'))) {
26+
if (!\function_exists('apcu_fetch') || !filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) || ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN))) {
2727
$this->markTestSkipped('APCu extension is required.');
2828
}
2929
if ('\\' === \DIRECTORY_SEPARATOR) {

Tests/Simple/MemcachedCacheTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function provideServersSetting()
146146
'localhost',
147147
11222,
148148
);
149-
if (ini_get('memcached.use_sasl')) {
149+
if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) {
150150
yield array(
151151
'memcached://user:password@127.0.0.1?weight=50',
152152
'127.0.0.1',
@@ -163,7 +163,7 @@ public function provideServersSetting()
163163
'/var/local/run/memcached.socket',
164164
0,
165165
);
166-
if (ini_get('memcached.use_sasl')) {
166+
if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) {
167167
yield array(
168168
'memcached://user:password@/var/local/run/memcached.socket?weight=25',
169169
'/var/local/run/memcached.socket',

Traits/ApcuTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ trait ApcuTrait
2323
{
2424
public static function isSupported()
2525
{
26-
return \function_exists('apcu_fetch') && ini_get('apc.enabled');
26+
return \function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN);
2727
}
2828

2929
private function init($namespace, $defaultLifetime, $version)
@@ -75,7 +75,7 @@ protected function doHave($id)
7575
*/
7676
protected function doClear($namespace)
7777
{
78-
return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== \PHP_SAPI || ini_get('apc.enable_cli'))
78+
return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== \PHP_SAPI || filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN))
7979
? apcu_delete(new \APCuIterator(sprintf('/^%s/', preg_quote($namespace, '/')), APC_ITER_KEY))
8080
: apcu_clear_cache();
8181
}

Traits/PhpFilesTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ trait PhpFilesTrait
3030

3131
public static function isSupported()
3232
{
33-
return \function_exists('opcache_invalidate') && ini_get('opcache.enable');
33+
return \function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN);
3434
}
3535

3636
/**
@@ -40,7 +40,7 @@ public function prune()
4040
{
4141
$time = time();
4242
$pruned = true;
43-
$allowCompile = 'cli' !== \PHP_SAPI || ini_get('opcache.enable_cli');
43+
$allowCompile = 'cli' !== \PHP_SAPI || filter_var(ini_get('opcache.enable_cli'), FILTER_VALIDATE_BOOLEAN);
4444

4545
set_error_handler($this->includeHandler);
4646
try {
@@ -119,7 +119,7 @@ protected function doSave(array $values, $lifetime)
119119
{
120120
$ok = true;
121121
$data = array($lifetime ? time() + $lifetime : PHP_INT_MAX, '');
122-
$allowCompile = 'cli' !== \PHP_SAPI || ini_get('opcache.enable_cli');
122+
$allowCompile = 'cli' !== \PHP_SAPI || filter_var(ini_get('opcache.enable_cli'), FILTER_VALIDATE_BOOLEAN);
123123

124124
foreach ($values as $key => $value) {
125125
if (null === $value || \is_object($value)) {

0 commit comments

Comments
 (0)
0