diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-11-05 04:17:07 -0700 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-11-05 04:17:07 -0700 |
commit | 3d15233dcbed837e4471d6d75781242e73c2ed9b (patch) | |
tree | 1293f8f4591c9fbab3cae19bb819cb5c01a34062 /engine/lib/entities.php | |
parent | 0759c227bf7b73254cf6eb5e8502463875f2469f (diff) | |
parent | b7312bf7096401f8501086c9c4ab20478843a687 (diff) | |
download | elgg-3d15233dcbed837e4471d6d75781242e73c2ed9b.tar.gz elgg-3d15233dcbed837e4471d6d75781242e73c2ed9b.tar.bz2 |
Merge pull request #89 from janeklb/t4041
Fixes #4041 (Deleted entities remain in memcache)
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r-- | engine/lib/entities.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 4b8b6694f..ff90e3185 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -412,7 +412,7 @@ function update_entity($guid, $owner_guid, $access_id, $container_guid = null, $ $newentity_cache = new ElggMemcache('new_entity_cache'); } if ($newentity_cache) { - $new_entity = $newentity_cache->delete($guid); + $newentity_cache->delete($guid); } // Handle cases where there was no error BUT no rows were updated! @@ -1491,6 +1491,15 @@ function delete_entity($guid, $recursive = true) { if (isset($ENTITY_CACHE[$guid])) { invalidate_cache_for_entity($guid); } + + // If memcache is available then delete this entry from the cache + static $newentity_cache; + if ((!$newentity_cache) && (is_memcache_available())) { + $newentity_cache = new ElggMemcache('new_entity_cache'); + } + if ($newentity_cache) { + $newentity_cache->delete($guid); + } // Delete contained owned and otherwise releated objects (depth first) if ($recursive) { |