static public function emptyDirectory($path, $ignoreSystemFiles = false)
    {
        $success = true;
        $handle = opendir($path);
        while (false !== ($entry = readdir($handle))) {
            if ($entry != "." && $entry != "..") {
                if ($entry[0] === '.' && $ignoreSystemFiles === true) {
                    continue;
                }

                $success = self::remove($path . DIRECTORY_SEPARATOR . $entry) ? $success : false;
            }
        }
        closedir($handle);
        return $success;
    }