You are here

function drd_server_domain_flush_cache in Drupal Remote Dashboard Server 7.2

Same name and namespace in other branches
  1. 6.2 drd_server.domain.inc \drd_server_domain_flush_cache()
  2. 6 drd_server.domain.inc \drd_server_domain_flush_cache()
  3. 7 drd_server.domain.inc \drd_server_domain_flush_cache()

DRD Server Action to flush all caches from the current domain.

Parameters

boolean $redirect: If TRUE, a redirect will be performed at the end, otherwise it returns normally.

Return value

string Returnable string to DRD.

2 string references to 'drd_server_domain_flush_cache'
drd_server_drd_server_actions in ./drd_server.module
Implements hook_drd_server_actions().
drd_server_menu in ./drd_server.module
Implements hook_menu().

File

./drd_server.domain.inc, line 81
Provides domain related functionality triggered by DRD.

Code

function drd_server_domain_flush_cache($redirect = FALSE) {
  drupal_flush_all_caches();
  registry_rebuild();
  drupal_set_message('Caches cleared');
  if ($redirect) {
    $destination = empty($_SERVER['HTTP_REFERER']) ? NULL : $_SERVER['HTTP_REFERER'];
    drupal_goto($destination);
  }
  return drd_server_result('cache.flush', '');
}