public static function recursiveChmod($path, $filePerm = 0644, $dirPerm = 0755)
    {

        // don't do anything under Windows
        if (FileSystem::getOsIdentifier() === self::OS_IDENTIFIER_WIN) {
            return;
        }

        // check if the directory exists
        if (is_dir($path) === false) {
            return false;
        }

        // get all the files recursively
        $files = FileSystem::globDir($path . '/*');

        // iterate over all directories and files
        foreach ($files as $file) {
            // see whether this is a file
            if (is_file($file)) {
                // chmod the file with our given file permissions
                FileSystem::chmod($file, $filePerm);
            // if this is a directory...
            } elseif (is_dir($file)) {
                // chmod the directory itself
                FileSystem::chmod($file, $dirPerm);
            }
        }

        // change the permmissions of the directory itself
        FileSystem::chmod($path, $dirPerm);
    }