ManaPHP\Http\Session\Adapter\File::_clean PHP Method

_clean() protected method

protected _clean ( string $dir ) : void
$dir string
return void
    protected function _clean($dir)
    {
        foreach (scandir($dir) as $item) {
            if ($item === '.' || $item === '..') {
                continue;
            }
            $path = $dir . '/' . $item;
            if (is_file($path)) {
                if (time() > filemtime($path)) {
                    @unlink($path);
                }
            } else {
                $this->_clean($path);
            }
        }
    }