Skip to content

Commit

Permalink
Support second argument on keyword pre-fetch
Browse files Browse the repository at this point in the history
Allow the use cache flag to skip calling the cache if necessary.
  • Loading branch information
ianbarber committed Apr 3, 2013
1 parent ea8f768 commit 03b6643
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/apc-cache/plugin.php
Expand Up @@ -84,9 +84,10 @@ function apc_cache_plugin_statechange($plugin) {
function apc_cache_pre_get_keyword($args) {
global $ydb;
$keyword = $args[0];
$use_cache = isset($args[1]) ? $args[1] : true;

// Lookup in cache
if(apc_exists($keyword)) {
if($use_cache && apc_exists($keyword)) {
$ydb->infos[$keyword] = apc_fetch($keyword);
}
}
Expand Down

0 comments on commit 03b6643

Please sign in to comment.