public static function recursiveChmod($path, $mod = 0777)
    {
        $path = Normalize::diskFullPath($path);
        if (!self::exist($path)) {
            return;
        }

        $dir = new \DirectoryIterator($path);
        foreach ($dir as $item) {
            // change chmod for folders and files
            if ($item->isDir() || $item->isFile()) {
                chmod($item->getPathname(), 0777);
            }
            // try to recursive chmod folders
            if ($item->isDir() && !$item->isDot()) {
                self::recursiveChmod($item->getPathname(), $mod);
            }
        }
    }
public static function recursiveChmod($path, $mod = 0777)
    {
        $path = Normalize::diskFullPath($path);
        if (!self::exist($path)) {
            return;
        }

        $dir = new \DirectoryIterator($path);
        foreach ($dir as $item) {
            // change chmod for folders and files
            if ($item->isDir() || $item->isFile()) {
                chmod($item->getPathname(), 0777);
            }
            // try to recursive chmod folders
            if ($item->isDir() && !$item->isDot()) {
                self::recursiveChmod($item->getPathname(), $mod);
            }
        }
    }
public static function recursiveChmod ( $ path , $ mod = 0777 ) { $ path = Normalize :: diskFullPath ( $ path ) ; if ( ! self :: exist ( $ path ) ) { return ; } $ dir = new \ DirectoryIterator ( $ path ) ; foreach ( $ dir as $ item ) { // change chmod for folders and files if ( $ item -> isDir ( ) || $ item -> isFile ( ) ) { chmod ( $ item -> getPathname ( ) , 0777 ) ; } // try to recursive chmod folders if ( $ item -> isDir ( ) && ! $ item -> isDot ( ) ) { self :: recursiveChmod ( $ item -> getPathname ( ) , $ mod ) ; } } }
Change chmod recursive inside defined folder
@param string $path
@param int $mod
Change chmod recursive inside defined folder