You are here

public function Store::cleanup in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/HttpCache/Store.php \Symfony\Component\HttpKernel\HttpCache\Store::cleanup()

Cleanups storage.

Overrides StoreInterface::cleanup

File

vendor/symfony/http-kernel/HttpCache/Store.php, line 49

Class

Store
Store implements all the logic for storing cache metadata (Request and Response headers).

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

public function cleanup() {

  // unlock everything
  foreach ($this->locks as $lock) {
    if (file_exists($lock)) {
      @unlink($lock);
    }
  }
  $error = error_get_last();
  if (1 === $error['type'] && false === headers_sent()) {

    // send a 503
    header('HTTP/1.0 503 Service Unavailable');
    header('Retry-After: 10');
    echo '503 Service Unavailable';
  }
}