Skip to content

Commit

Permalink
Making cache tags more efficient by rewriting the API.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Feb 23, 2016
1 parent da5dcc6 commit 2cd37f0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 32 deletions.
6 changes: 3 additions & 3 deletions ApcuCachePool.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function fetchObjectFromCache($key)
$success = false;
$data = apcu_fetch($key, $success);

return [$success, $data];
return [$success, $data, []];
}

protected function clearAllObjectsFromCache()
Expand All @@ -39,12 +39,12 @@ protected function clearOneObjectFromCache($key)
return true;
}

protected function storeItemInCache($key, CacheItemInterface $item, $ttl)
protected function storeItemInCache(CacheItemInterface $item, $ttl)
{
if ($ttl < 0) {
return false;
}

return apcu_store($key, $item->get(), $ttl);
return apcu_store($item->getKey(), $item->get(), $ttl);
}
}
4 changes: 3 additions & 1 deletion Tests/IntegrationPoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
class IntegrationPoolTest extends BaseTest
{
protected $skippedTests = [
'testExpiration' => 'The cache expire at the next request.',
'testExpiration' => 'The cache expire at the next request.',
'testSaveExpired' => 'The cache expire at the next request.',
'testDeferredExpired' => 'The cache expire at the next request.',
];

public function createCachePool()
Expand Down
27 changes: 0 additions & 27 deletions Tests/IntegrationTagTest.php

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"require-dev": {
"phpunit/phpunit": "^4.0|^5.1",
"cache/integration-tests": "0.7.0"
"cache/integration-tests": "0.9.0"
},
"provide": {
"psr/cache-implementation": "^1.0"
Expand Down

0 comments on commit 2cd37f0

Please sign in to comment.