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;
    }
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;
    }
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 ; }
Empty a directory without deleting it

@param string $path
@param boolean $ignoreSystemFiles
@return boolean
Empty a directory without deleting it