public static function recursiveChown($path, $user, $group = null)
    {

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

        // we don't have a directory to change the user/group permissions for
        if (is_dir($path) === false) {
            return;
        }

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

        // query whether we've a user passed
        if (empty($user) === false) {
            // Change the rights of everything within the defined dirs
            foreach ($files as $file) {
                FileSystem::chown($file, $user, $group);
            }
            FileSystem::chown($path, $user, $group);
        }
    }
public static function recursiveChown($path, $user, $group = null)
    {

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

        // we don't have a directory to change the user/group permissions for
        if (is_dir($path) === false) {
            return;
        }

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

        // query whether we've a user passed
        if (empty($user) === false) {
            // Change the rights of everything within the defined dirs
            foreach ($files as $file) {
                FileSystem::chown($file, $user, $group);
            }
            FileSystem::chown($path, $user, $group);
        }
    }
public static function recursiveChown ( $ path , $ user , $ group = null ) { // we don't do anything under Windows if ( FileSystem :: getOsIdentifier ( ) === self :: OS_IDENTIFIER_WIN ) { return ; } // we don't have a directory to change the user/group permissions for if ( is_dir ( $ path ) === false ) { return ; } // get all the files recursively $ files = FileSystem :: globDir ( $ path . '/*' ) ; // query whether we've a user passed if ( empty ( $ user ) === false ) { // Change the rights of everything within the defined dirs foreach ( $ files as $ file ) { FileSystem :: chown ( $ file , $ user , $ group ) ; } FileSystem :: chown ( $ path , $ user , $ group ) ; } }
Will set the owner and group on the passed directory.

@param string $path  The directory to set the rights for
@param string $user  The user to set
@param string $group The group to set

@return void
Will set the owner and group on the passed directory .