You are here

public static function FormBase::purge in Form Builder 7.2

Purge old cache entries.

Parameters

int $max_age: All form_builder_cache entries older than $max_age seconds are purged.

4 calls to FormBase::purge()
AdminTest::tearDown in tests/AdminTest.php
Purge data stored to the form cache during the tests.
FormBaseTest::tearDown in tests/FormBaseTest.php
form_builder_cache_purge in includes/form_builder.cache.inc
Delete outdated cache entries.
form_builder_cron in ./form_builder.module
Implement hook_cron().

File

src/FormBase.php, line 128

Class

FormBase

Namespace

Drupal\form_builder

Code

public static function purge($max_age = NULL) {
  $expire = isset($max_age) ? $max_age : ini_get('session.cache_expire');
  return db_delete('ctools_object_cache')
    ->condition('name', 'form_builder_cache')
    ->condition('updated', REQUEST_TIME - $max_age, '<')
    ->execute();
  drupal_static_reset('ctools_object_cache_get');
}