phpbb_test_case_helpers::empty_dir PHP Méthode

empty_dir() public méthode

Empty directory (remove any subdirectories/files below)
public empty_dir ( $path )
    public function empty_dir($path)
    {
        $path = substr($path, -1) == '/' ? $path : $path . '/';
        $files = scandir($path);
        foreach ($files as $file) {
            if ($file == '.' || $file == '..') {
                continue;
            }
            if (is_dir($path . $file)) {
                $this->empty_dir($path . $file);
                rmdir($path . $file);
            } else {
                unlink($path . $file);
            }
        }
    }