Skip to content

Commit

Permalink
Remove support for obsolete APC caching functions. Fixes #728
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Mar 12, 2018
1 parent 44e4f56 commit 7607f89
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions model/Cache.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Wrapper class for key-value caching. Currently supports APC and APCu.
* Wrapper class for key-value caching. Currently supports only APCu.
*/
class Cache
{
Expand All @@ -10,9 +10,6 @@ class Cache
* Wraps apc_fetch() & apcu_fetch()
*/
public function fetch($key) {
if (function_exists('apc_fetch')) {
return apc_fetch($key);
}
if (function_exists('apcu_fetch')) {
return apcu_fetch($key);
}
Expand All @@ -23,15 +20,12 @@ public function fetch($key) {
* Wraps apc_store() and apcu_store()
*/
public function store($key, $value, $ttl=3600) {
if (function_exists('apc_store')) {
return apc_store($key, $value);
}
else if (function_exists('apcu_store')) {
if (function_exists('apcu_store')) {
return apcu_store($key, $value, $ttl);
}
}

public function isAvailable() {
return ((function_exists('apc_store') && function_exists('apc_fetch')) || (function_exists('apcu_store') && function_exists('apcu_fetch')));
return (function_exists('apcu_store') && function_exists('apcu_fetch'));
}
}

0 comments on commit 7607f89

Please sign in to comment.