-
Notifications
You must be signed in to change notification settings - Fork 346
Description
I just ran into an issue where delete_all wasn't working as I expected.
The first argument to Cache::delete_all() is $section, with the following description:
Name of a section or directory of the cache, null to delete everything
On fuel/core 1.8.2, I'm getting this behavior using the memcached driver:
\Cache::set('section_name.item', 'value');
\Cache::delete_all(); // expected to remove everything
\Cache::get('section_name.item'); // 'value'
\Cache::delete_all('section_name');
\Cache::get('section_name.item'); // nullLooking at https://github.com/fuel/core/blob/1.8.2/classes/cache/storage/memcached.php#L149
$section is prepended with the configured cache_id.
Then looking at https://github.com/fuel/core/blob/1.8.2/classes/cache/storage/memcached.php#L157
This is the branch for choosing between deleting everything or just the matching section - however, ! empty($section) looks like it can't ever be false because it will always contain the prepended cache_id.
Also note - it won't be an issue if cache.memcached.cache_id is an empty string.
Just checking to see if I'm seeing this correctly?