本文整理汇总了PHP中cache_helper::purge_store方法的典型用法代码示例。如果您正苦于以下问题:PHP cache_helper::purge_store方法的具体用法?PHP cache_helper::purge_store怎么用?PHP cache_helper::purge_store使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cache_helper
的用法示例。
在下文中一共展示了cache_helper::purge_store方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
$factory = cache_factory::instance();
$definition = $factory->create_definition($component, $area);
if ($definition->has_required_identifiers()) {
// We will have to purge the stores used by this definition.
cache_helper::purge_stores_used_by_definition($component, $area);
} else {
// Alrighty we can purge just the data belonging to this definition.
cache_helper::purge_by_definition($component, $area);
}
redirect($PAGE->url, get_string('purgedefinitionsuccess', 'cache'), 5);
break;
case 'purgestore':
case 'purge':
// Purge a store cache.
$store = required_param('store', PARAM_TEXT);
cache_helper::purge_store($store);
redirect($PAGE->url, get_string('purgestoresuccess', 'cache'), 5);
break;
case 'newlockinstance':
// Adds a new lock instance.
$lock = required_param('lock', PARAM_ALPHANUMEXT);
$mform = cache_administration_helper::get_add_lock_form($lock);
if ($mform->is_cancelled()) {
redirect($PAGE->url);
} else {
if ($data = $mform->get_data()) {
$factory = cache_factory::instance();
$config = $factory->create_config_instance(true);
$name = $data->name;
$data = cache_administration_helper::get_lock_configuration_from_data($lock, $data);
$config->add_lock_instance($name, $lock, $data);