Skip to content

Apcu driver should not call apc_ functions #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/phpFastCache/Drivers/Apcu/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function driverWrite(CacheItemInterface $item)
if ($item instanceof Item) {
$ttl = $item->getExpirationDate()->getTimestamp() - time();

return apc_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0));
return apcu_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0));
} else {
throw new \InvalidArgumentException('Cross-Driver type confusion detected');
}
Expand All @@ -78,7 +78,7 @@ protected function driverWrite(CacheItemInterface $item)
*/
protected function driverRead(CacheItemInterface $item)
{
$data = apc_fetch($item->getKey(), $success);
$data = apcu_fetch($item->getKey(), $success);
if ($success === false) {
return null;
}
Expand All @@ -97,7 +97,7 @@ protected function driverDelete(CacheItemInterface $item)
* Check for Cross-Driver type confusion
*/
if ($item instanceof Item) {
return apc_delete($item->getKey());
return apcu_delete($item->getKey());
} else {
throw new \InvalidArgumentException('Cross-Driver type confusion detected');
}
Expand All @@ -108,7 +108,7 @@ protected function driverDelete(CacheItemInterface $item)
*/
protected function driverClear()
{
return @apc_clear_cache() && @apc_clear_cache('user');
return @apcu_clear_cache() && @apcu_clear_cache('user');
}

/**
Expand All @@ -130,7 +130,7 @@ protected function driverConnect()
*/
public function getStats()
{
$stats = (array) apc_cache_info('user');
$stats = (array) apcu_cache_info('user');
$date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]);

return (new driverStatistic())
Expand Down