public static function chmodPath($path, $dirMode = null, $fileMode = null, $recursive = true)
    {
        $result = false;

        $path = realpath($path);
        if (empty($path)) {
            return false;
        }

        $dirMode = $dirMode ?: self::getDefaultDirMode();
        $fileMode = $fileMode ?: self::getDefaultFileMode();

        $result = self::chmodPathSingle($path, $dirMode, $fileMode);
        if ($recursive && is_dir($path)) {
            $result = self::chmodPathRecursive($path, $dirMode, $fileMode);
        }

        return $result;
    }
public static function chmodPath($path, $dirMode = null, $fileMode = null, $recursive = true)
    {
        $result = false;

        $path = realpath($path);
        if (empty($path)) {
            return false;
        }

        $dirMode = $dirMode ?: self::getDefaultDirMode();
        $fileMode = $fileMode ?: self::getDefaultFileMode();

        $result = self::chmodPathSingle($path, $dirMode, $fileMode);
        if ($recursive && is_dir($path)) {
            $result = self::chmodPathRecursive($path, $dirMode, $fileMode);
        }

        return $result;
    }
public static function chmodPath ( $ path , $ dirMode = null , $ fileMode = null , $ recursive = true ) { $ result = false ; $ path = realpath ( $ path ) ; if ( empty ( $ path ) ) { return false ; } $ dirMode = $ dirMode ? : self :: getDefaultDirMode ( ) ; $ fileMode = $ fileMode ? : self :: getDefaultFileMode ( ) ; $ result = self :: chmodPathSingle ( $ path , $ dirMode , $ fileMode ) ; if ( $ recursive && is_dir ( $ path ) ) { $ result = self :: chmodPathRecursive ( $ path , $ dirMode , $ fileMode ) ; } return $ result ; }
Change permissions on path

@param  string  $path      Path to chmod
@param  numeric $dirMode   Mode to set for folders (octal)
@param  numeric $fileMode  Mode to set for files (octal)
@param  boolean $recursive Recurse into path or no (default: yes)
@return boolean True on success, false otherwise
@SuppressWarnings(PHPMD.NPathComplexity)
Change permissions on path