function brightcove_invalidate_cache in Brightcove Video Connect 7.4
Same name and namespace in other branches
- 7.7 brightcove.module \brightcove_invalidate_cache()
- 7.3 brightcove.module \brightcove_invalidate_cache()
- 7.5 brightcove.module \brightcove_invalidate_cache()
- 7.6 brightcove.module \brightcove_invalidate_cache()
Invalidate outdated cache records.
Parameters
$cid:
bool $wildcard:
5 calls to brightcove_invalidate_cache()
- brightcove_add_playlist in ./
brightcove.module - Wrapper function around playlist save.
- brightcove_playlist_delete_form_submit in ./
brightcove.module - Playlist delete confirm form submit handler.
- brightcove_update_playlist in ./
brightcove.module - Wrapper function around playlist update.
- _brightcove_create_form_callback in ./
brightcove.module - Create the new playlist.
- _brightcove_upload_form_callback in ./
brightcove.module - Upload the submitted video.
File
- ./
brightcove.module, line 1242 - Brightcove module is an integration layer between any modules using Brightcove API. It makes all necessary checks for the API and makes settings available to the user.
Code
function brightcove_invalidate_cache($cid, $wildcard = FALSE) {
// If cache is enabled.
if (variable_get('brightcove_cache_enabled', TRUE)) {
// Get the type of cache being set.
$type = variable_get('brightcove_cache_type', 'db');
switch ($type) {
case 'db':
cache_clear_all($cid, 'cache_brightcove', $wildcard);
break;
case 'file':
if ($wildcard) {
// Remove all the cache files, when new file is added or an existing one is deleted, because we can't use
// wildcard like we can when we cache to database.
_brightcove_delete_cache_files();
}
else {
_brightcove_delete_cache_files($cid);
}
break;
case 'memcached':
if ($wildcard) {
// Remove all the cache files, when new file is added or an existing one is deleted, because we can't use
// wildcard like we can when we cache to database.
_brightcove_delete_memcached();
}
else {
_brightcove_delete_memcached($cid);
}
break;
}
}
}