function update_cache_flush

Implements hook_cache_flush().

Called from update.php (among others) to flush the caches. Since we're running update.php, we are likely to install a new version of something, in which case, we want to check for available update data again. However, because we have our own caching system, we need to directly clear the the database table ourselves at this point and return nothing.

However, we only want to do this from update.php, since otherwise, we'd lose all the available update data on every cron run. So, we specifically check if the site is in MAINTENANCE_MODE == 'update' (which indicates update.php is running, not update module... alas for overloaded names).

Related topics

File

drupal/core/modules/update/update.module, line 877
Handles updates of Drupal core and contributed projects.

Code

function update_cache_flush() {
  if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update') {
    _update_cache_clear();
  }
  return array();
}