Skip to content

Commit

Permalink
Merge pull request #6 from art-spilgames/master
Browse files Browse the repository at this point in the history
Yourls 1.7 compatibility fix
  • Loading branch information
ianbarber committed Dec 30, 2014
2 parents 03b6643 + 9460c5d commit a488957
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/apc-cache/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
define('APC_CACHE_LOG_INDEX', 'cachelogindex');
define('APC_CACHE_LOG_TIMER', 'cachelogtimer');
define('APC_CACHE_ALL_OPTIONS', 'cache-get_all_options');
define('APC_CACHE_YOURLS_INSTALLED', 'cache-yourls_installed');
if(!defined('APC_CACHE_LONG_TIMEOUT')) {
define('APC_CACHE_LONG_TIMEOUT', 86400);
}
Expand Down Expand Up @@ -50,6 +51,7 @@ function apc_cache_shunt_all_options($false) {
$key = APC_CACHE_ALL_OPTIONS;
if(apc_exists($key)) {
$ydb->option = apc_fetch($key);
$ydb->installed = apc_fetch(APC_CACHE_YOURLS_INSTALLED);
return true;
}

Expand All @@ -64,6 +66,8 @@ function apc_cache_shunt_all_options($false) {
*/
function apc_cache_get_all_options($option) {
apc_store(APC_CACHE_ALL_OPTIONS, $option, APC_READ_CACHE_TIMEOUT);
// Set timeout on installed property twice as long as the options as otherwise there could be a split second gap
apc_store(APC_CACHE_YOURLS_INSTALLED, true, (2 * APC_READ_CACHE_TIMEOUT));
return $option;
}

Expand Down

0 comments on commit a488957

Please sign in to comment.