Skip to content
Snippets Groups Projects
Commit 6a5ee788 authored by Barrett Smith's avatar Barrett Smith
Browse files

Issue #2336381 by Barrett, dstol: Add a means to temporarily disable URL...

Issue #2336381 by Barrett, dstol: Add a means to temporarily disable URL clearing to support batch imports/migrations
parent 4324aed3
Branches 7.x-2.x
Tags 7.x-2.2
No related merge requests found
......@@ -12,6 +12,18 @@
function akamai_settings() {
$form = array();
$form['disable_fieldset'] = array(
'#type' => 'fieldset',
'#title' => 'Disable Akamai Cache Clearing',
'#description' => 'Set this field to temporarity disable cache clearing during imports, migrations, or other batch processes.',
);
$form['disable_fieldset']['akamai_disabled'] = array(
'#type' => 'checkbox',
'#title' => t('Disable cache clearing'),
'#default_value' => variable_get('akamai_disabled', FALSE),
);
$form['akamai_restapi'] = array(
'#type' => 'textfield',
'#title' => t('REST API URL'),
......
......@@ -41,4 +41,5 @@ function akamai_uninstall() {
variable_del('akamai_restapi');
variable_del('akamai_timeout');
variable_del('akamai_username');
variable_del('akamai_disabled');
}
......@@ -216,6 +216,11 @@ function akamai_page_cache_control_form_submit($form, &$form_state) {
* TRUE if it was successfully cleared, FALSE otherwise.
*/
function akamai_clear_url($paths_in, $params = array(), $node = NULL) {
if (variable_get('akamai_disabled', FALSE)) {
watchdog('akamai', 'Request to clear paths ignored because clearing is disabled. Check module settings.');
return FALSE;
}
if (!is_array($paths_in)) {
$paths_in = array($paths_in);
}
......
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