protected static function chmodPathRecursive($path, $dirMode, $fileMode)
    {
        $result = false;

        $dirMode = self::valueToOct($dirMode);
        $fileMode = self::valueToOct($fileMode);

        $finder = new Finder();
        // Folders first
        foreach ($finder->directories()->in($path) as $item) {
            $result = chmod($item->getRealPath(), $dirMode);
        }
        // Files next
        foreach ($finder->files()->in($path) as $item) {
            $result = chmod($item->getRealPath(), $fileMode);
        }

        return $result;
    }
protected static function chmodPathRecursive($path, $dirMode, $fileMode)
    {
        $result = false;

        $dirMode = self::valueToOct($dirMode);
        $fileMode = self::valueToOct($fileMode);

        $finder = new Finder();
        // Folders first
        foreach ($finder->directories()->in($path) as $item) {
            $result = chmod($item->getRealPath(), $dirMode);
        }
        // Files next
        foreach ($finder->files()->in($path) as $item) {
            $result = chmod($item->getRealPath(), $fileMode);
        }

        return $result;
    }
protected static function chmodPathRecursive ( $ path , $ dirMode , $ fileMode ) { $ result = false ; $ dirMode = self :: valueToOct ( $ dirMode ) ; $ fileMode = self :: valueToOct ( $ fileMode ) ; $ finder = new Finder ( ) ; // Folders first foreach ( $ finder -> directories ( ) -> in ( $ path ) as $ item ) { $ result = chmod ( $ item -> getRealPath ( ) , $ dirMode ) ; } // Files next foreach ( $ finder -> files ( ) -> in ( $ path ) as $ item ) { $ result = chmod ( $ item -> getRealPath ( ) , $ fileMode ) ; } return $ result ; }
Change permissions recursively

@param string $path Path to chmod
@param numeric $dirMode Mode to set for folders
@param numeric $fileMode Mode to set for files
@return boolean
Change permissions recursively