Skip to content

Commit 519b242

Browse files
committed
Making cache tags more efficient by rewriting the API.
Related to php-cache/issues#21
1 parent 8f937a9 commit 519b242

File tree

4 files changed

+7
-32
lines changed

4 files changed

+7
-32
lines changed

ApcCachePool.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected function fetchObjectFromCache($key)
2424
$success = false;
2525
$data = apc_fetch($key, $success);
2626

27-
return [$success, $data];
27+
return [$success, $data, []];
2828
}
2929

3030
protected function clearAllObjectsFromCache()
@@ -39,12 +39,12 @@ protected function clearOneObjectFromCache($key)
3939
return true;
4040
}
4141

42-
protected function storeItemInCache($key, CacheItemInterface $item, $ttl)
42+
protected function storeItemInCache(CacheItemInterface $item, $ttl)
4343
{
4444
if ($ttl < 0) {
4545
return false;
4646
}
4747

48-
return apc_store($key, $item->get(), $ttl);
48+
return apc_store($item->getKey(), $item->get(), $ttl);
4949
}
5050
}

Tests/IntegrationPoolTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
class IntegrationPoolTest extends BaseTest
1818
{
1919
protected $skippedTests = [
20-
'testExpiration' => 'The cache expire at the next request.',
20+
'testExpiration' => 'The cache expire at the next request.',
21+
'testSaveExpired' => 'The cache expire at the next request.',
22+
'testDeferredExpired' => 'The cache expire at the next request.',
2123
];
2224

2325
public function createCachePool()

Tests/IntegrationTagTest.php

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

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"require-dev": {
3434
"phpunit/phpunit": "^4.0|^5.1",
35-
"cache/integration-tests": "0.7.0"
35+
"cache/integration-tests": "0.9.0"
3636
},
3737
"provide": {
3838
"psr/cache-implementation": "^1.0"

0 commit comments

Comments
 (0)