public function FileProfilerStorage::purge in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php \Symfony\Component\HttpKernel\Profiler\FileProfilerStorage::purge()
Purges all data from the database.
Overrides ProfilerStorageInterface::purge
File
- vendor/
symfony/ http-kernel/ Profiler/ FileProfilerStorage.php, line 102
Class
- FileProfilerStorage
- Storage for profiler using files.
Namespace
Symfony\Component\HttpKernel\ProfilerCode
public function purge() {
$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);
}
}
}