8000 Always require symfony/polyfill-apcu to provide APCuIterator everywhere · symfony/symfony@9d44442 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d44442

Browse files
author
Guillaume LECERF
committed
Always require symfony/polyfill-apcu to provide APCuIterator everywhere
1 parent 2230e31 commit 9d44442

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

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",
@@ -96,7 +97,6 @@
9697
"predis/predis": "~1.0",
9798
"egulias/email-validator": "~1.2,>=1.2.8|~2.0",
9899
"symfony/phpunit-bridge": "~3.2",
99-
"symfony/polyfill-apcu": "~1.1",
100100
"symfony/security-acl": "~2.8|~3.0",
101101
"phpdocumentor/reflection-docblock": "^3.0|^4.0",
102102
"sensio/framework-extra-bundle": "^3.0.2"

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 {

src/Symfony/Component/Cache/composer.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"php": "^5.5.9|>=7.0.8",
2424
"psr/cache": "~1.0",
2525
"psr/log": "~1.0",
26-
"psr/simple-cache": "^1.0"
26+
"psr/simple-cache": "^1.0",
27+
"symfony/polyfill-apcu": "~1.1"
2728
},
2829
"require-dev": {
2930
"cache/integration-tests": "dev-master",
@@ -34,9 +35,6 @@
3435
"conflict": {
3536
"symfony/var-dumper": "<3.3"
3637
},
37-
"suggest": {
38-
"symfony/polyfill-apcu": "For using ApcuAdapter on HHVM"
39-
},
4038
"autoload": {
4139
"psr-4": { "Symfony\\Component\\Cache\\": "" },
4240
"exclude-from-classmap": [

0 commit comments

Comments
 (0)
0