public static function deleteFolder($strPath)
    {

        if (!is_dir($strPath)) {
            unlink($strPath);

            return 1;
        }

        $d = dir($strPath);
        $count = 0;
        while ($entry = $d->read()) {
            if ($entry != "." && $entry != "..") {
                if (is_dir($strPath)) {
                    $count += Folder::deleteFolder($strPath . "/" . $entry);
                }
            }
        }

        $d->close();
        rmdir($strPath);

        return $count;
    }