src/FS/Folder/Editor.php
public function changeMode( $mode, $recursive = FALSE )
	{
		if( !is_int( $mode ) )
			throw new InvalidArgumentException( 'Mode must be of integer' );

		$number	= (int) chmod( $this->folderName, $mode );
		if( !$recursive )
			return $number;

		$iterator = new RecursiveIteratorIterator(
			new RecursiveDirectoryIterator( $this->folderName ),
			RecursiveIteratorIterator::SELF_FIRST
		);
		foreach( $iterator as $item )
			$number += (int) chmod( $item, $mode );
		return $number;
 	}
public function changeMode( $mode, $recursive = FALSE )
	{
		if( !is_int( $mode ) )
			throw new InvalidArgumentException( 'Mode must be of integer' );

		$number	= (int) chmod( $this->folderName, $mode );
		if( !$recursive )
			return $number;

		$iterator = new RecursiveIteratorIterator(
			new RecursiveDirectoryIterator( $this->folderName ),
			RecursiveIteratorIterator::SELF_FIRST
		);
		foreach( $iterator as $item )
			$number += (int) chmod( $item, $mode );
		return $number;
 	}
public function changeMode ( $ mode , $ recursive = FALSE ) { if ( ! is_int ( $ mode ) ) throw new InvalidArgumentException ( 'Mode must be of integer' ) ; $ number = ( int ) chmod ( $ this -> folderName , $ mode ) ; if ( ! $ recursive ) return $ number ; $ iterator = new RecursiveIteratorIterator ( new RecursiveDirectoryIterator ( $ this -> folderName ) , RecursiveIteratorIterator :: SELF_FIRST ) ; foreach ( $ iterator as $ item ) $ number += ( int ) chmod ( $ item , $ mode ) ; return $ number ; }
Sets permissions on current folder and its containing files and folders.
@access		public
@param		int			$mode			Permission mode, like 0750, 01770, 02755
@param		bool		$recursive		Flag: change nested files and folders,too
@return		int			Number of affected files and folders
Sets permissions on current folder and its containing files and folders .