Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FileProfilerStorage.php

function FileProfilerStorage::purge

Overrides ProfilerStorageInterface::purge

File

vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php, line 108

Class

FileProfilerStorage
Storage for profiler using files.

Namespace

Symfony\Component\HttpKernel\Profiler

Code

public function purge() : void {
    $flags = \FilesystemIterator::SKIP_DOTS;
    $iterator = new \RecursiveDirectoryIterator($this->folder, $flags);
    $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST);
    foreach ($iterator as $file) {
        if (is_file($file)) {
            unlink($file);
        }
        else {
            rmdir($file);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal