public static function cpWorkingCopy($source, $destination, $recursive = true, $ignoreSystemFiles = true)
    {
        $returnValue = (bool) false;

        
		
		if (file_exists($source)) {
			if (is_dir($source) && $recursive) {
				foreach (scandir($source) as $file) {
					if ($file != '.' && $file != '..' && $file != '.svn') {
						if (!$ignoreSystemFiles && $file[0] == '.') {
							continue;
						} else {
							self::cpWorkingCopy($source . '/' . $file, $destination . '/' . $file, true, $ignoreSystemFiles);
						}
					}
				}
			} else {
				if (is_dir(dirname($destination))) {
					$returnValue = copy($source, $destination);
				} else if ($recursive) {
					if (mkdir(dirname($destination), 0775, true)) {
						$returnValue = self::cpWorkingCopy($source, $destination, false, $ignoreSystemFiles);
					}
				}
			}
		}
		
        

        return (bool) $returnValue;
    }
public static function cpWorkingCopy($source, $destination, $recursive = true, $ignoreSystemFiles = true)
    {
        $returnValue = (bool) false;

        
		
		if (file_exists($source)) {
			if (is_dir($source) && $recursive) {
				foreach (scandir($source) as $file) {
					if ($file != '.' && $file != '..' && $file != '.svn') {
						if (!$ignoreSystemFiles && $file[0] == '.') {
							continue;
						} else {
							self::cpWorkingCopy($source . '/' . $file, $destination . '/' . $file, true, $ignoreSystemFiles);
						}
					}
				}
			} else {
				if (is_dir(dirname($destination))) {
					$returnValue = copy($source, $destination);
				} else if ($recursive) {
					if (mkdir(dirname($destination), 0775, true)) {
						$returnValue = self::cpWorkingCopy($source, $destination, false, $ignoreSystemFiles);
					}
				}
			}
		}
		
        

        return (bool) $returnValue;
    }
public static function cpWorkingCopy ( $ source , $ destination , $ recursive = true , $ ignoreSystemFiles = true ) { $ returnValue = ( bool ) false ; if ( file_exists ( $ source ) ) { if ( is_dir ( $ source ) && $ recursive ) { foreach ( scandir ( $ source ) as $ file ) { if ( $ file != '.' && $ file != '..' && $ file != '.svn' ) { if ( ! $ ignoreSystemFiles && $ file [ 0 ] == '.' ) { continue ; } else { self :: cpWorkingCopy ( $ source . '/' . $ file , $ destination . '/' . $ file , true , $ ignoreSystemFiles ) ; } } } } else { if ( is_dir ( dirname ( $ destination ) ) ) { $ returnValue = copy ( $ source , $ destination ) ; } else if ( $ recursive ) { if ( mkdir ( dirname ( $ destination ) , 0775 , true ) ) { $ returnValue = self :: cpWorkingCopy ( $ source , $ destination , false , $ ignoreSystemFiles ) ; } } } } return ( bool ) $ returnValue ; }
Short description of method cpWorkingCopy

@access public
@author Somsack Sipasseuth, <somsack.sipasseuth@tudor.lu>
@param  string source
@param  string destination
@param  boolean recursive
@param  boolean ignoreSystemFiles
@return boolean
Short description of method cpWorkingCopy