Skip to content
Snippets Groups Projects
Verified Commit 1850c649 authored by Alberto Paderno's avatar Alberto Paderno
Browse files

Follow-up to #3463517: Added a call to apcu_enabled() to a form submission handler as safeguard

parent 3f77e08c
No related branches found
No related tags found
No related merge requests found
Pipeline #232977 passed
......@@ -74,13 +74,18 @@ function apc_form_system_performance_settings_alter(&$form, $form_state) {
* Submission form handler for system_performance_settings().
*/
function apc_clear_apcu_cache() {
$iterator = new APCUIterator("/^apc_cache_/", APC_ITER_KEY);
if (apcu_enabled()) {
$iterator = new APCUIterator("/^apc_cache_/", APC_ITER_KEY);
if (apcu_delete($iterator)) {
drupal_set_message(t('The APCu cache has been cleared.'));
if (apcu_delete($iterator)) {
drupal_set_message(t('The APCu cache has been cleared.'));
}
else {
drupal_set_message(t('The APCu cache could not be cleared.'), 'error');
}
}
else {
drupal_set_message(t('The APCu cache could not be cleared.'), 'error');
drupal_set_message(t('APCu is not enabled.'), 'warning');
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment