src/FS/Folder/Editor.php
public static function moveFolder( $sourceFolder, $targetPath, $force = FALSE )
	{
		$sourceName	= basename( $sourceFolder );											//  Folder Name of Source Folder
		$sourcePath	= dirname( $sourceFolder );												//  Path to Source Folder
		$sourceFolder	= self::correctPath( $sourceFolder );								//  add Slash to Source Path
		$targetPath		= self::correctPath( $targetPath );									//  add Slash to Target Path
		if( !self::isFolder( $sourcePath ) )												//  Path of Source Folder not existing
			throw new RuntimeException( 'Folder "'.$sourceFolder.'" cannot be moved since it is not existing' );
		if( self::isFolder( $targetPath.$sourceName ) && !$force )							//  Path of Target Folder is already existing
			throw new RuntimeException( 'Folder "'.$targetPath.$sourceName.'" is already existing' );
		if( !self::isFolder( $targetPath ) )												//  Path to Target Folder not existing
			self::createFolder( $targetPath );												//
		if( $sourceFolder == $targetPath )													//  Source and Target Path are equal
			return FALSE;																	//  do nothing and return
		if( FALSE === @rename( $sourceFolder, $targetPath.$sourceName ) )					//  move Source Folder to Target Path
			throw new RuntimeException( 'Folder "'.$sourceFolder.'" cannot be moved to "'.$targetPath.'"' );
		return TRUE;
	}
public static function moveFolder( $sourceFolder, $targetPath, $force = FALSE )
	{
		$sourceName	= basename( $sourceFolder );											//  Folder Name of Source Folder
		$sourcePath	= dirname( $sourceFolder );												//  Path to Source Folder
		$sourceFolder	= self::correctPath( $sourceFolder );								//  add Slash to Source Path
		$targetPath		= self::correctPath( $targetPath );									//  add Slash to Target Path
		if( !self::isFolder( $sourcePath ) )												//  Path of Source Folder not existing
			throw new RuntimeException( 'Folder "'.$sourceFolder.'" cannot be moved since it is not existing' );
		if( self::isFolder( $targetPath.$sourceName ) && !$force )							//  Path of Target Folder is already existing
			throw new RuntimeException( 'Folder "'.$targetPath.$sourceName.'" is already existing' );
		if( !self::isFolder( $targetPath ) )												//  Path to Target Folder not existing
			self::createFolder( $targetPath );												//
		if( $sourceFolder == $targetPath )													//  Source and Target Path are equal
			return FALSE;																	//  do nothing and return
		if( FALSE === @rename( $sourceFolder, $targetPath.$sourceName ) )					//  move Source Folder to Target Path
			throw new RuntimeException( 'Folder "'.$sourceFolder.'" cannot be moved to "'.$targetPath.'"' );
		return TRUE;
	}
public static function moveFolder ( $ sourceFolder , $ targetPath , $ force = FALSE ) { $ sourceName = basename ( $ sourceFolder ) ; //  Folder Name of Source Folder $ sourcePath = dirname ( $ sourceFolder ) ; //  Path to Source Folder $ sourceFolder = self :: correctPath ( $ sourceFolder ) ; //  add Slash to Source Path $ targetPath = self :: correctPath ( $ targetPath ) ; //  add Slash to Target Path if ( ! self :: isFolder ( $ sourcePath ) ) //  Path of Source Folder not existing throw new RuntimeException ( 'Folder "' . $ sourceFolder . '" cannot be moved since it is not existing' ) ; if ( self :: isFolder ( $ targetPath . $ sourceName ) && ! $ force ) //  Path of Target Folder is already existing throw new RuntimeException ( 'Folder "' . $ targetPath . $ sourceName . '" is already existing' ) ; if ( ! self :: isFolder ( $ targetPath ) ) //  Path to Target Folder not existing self :: createFolder ( $ targetPath ) ; // if ( $ sourceFolder == $ targetPath ) //  Source and Target Path are equal return FALSE ; //  do nothing and return if ( FALSE === @ rename ( $ sourceFolder , $ targetPath . $ sourceName ) ) //  move Source Folder to Target Path throw new RuntimeException ( 'Folder "' . $ sourceFolder . '" cannot be moved to "' . $ targetPath . '"' ) ; return TRUE ; }
Moves a Folder to another Path.
@access		public
@static
@param		string		$sourceFolder	Folder Name of Source Folder, eg. /path/to/source/folder
@param		string		$targetPath		Folder Path of Target Folder, eg. /path/to/target
@param		string		$force			Flag: continue if Target Folder is already existing, otherwise break
@return		bool
Moves a Folder to another Path .