private function deleteDirByFullPath($path, $delete_self = true, array $exclude = [])
    {
        $dir = $this->withSlash($path);

        if ($dh = opendir($dir)) {
            while ($file = readdir($dh)) {
                if (($file != '.') && ($file != '..')) {
                    $fullpath = $dir . $file;

                    if (!$delete_self && in_array($fullpath, $exclude)) {
                        continue;
                    }

                    if (is_link($fullpath)) {
                        unlink($fullpath);
                    } else {
                        if (is_dir($fullpath)) {
                            $this->deleteDirByFullPath($fullpath);
                        } else {
                            unlink($fullpath);
                        }
                    }
                }
            }

            closedir($dh);
        }

        if ($delete_self) {
            rmdir($dir);
        }
    }