[zi-cvs] packages/com.zzoss.installer.lib Utils.php,1.8,1.9

Christian Zonsius <[email protected]> Tue, 06 Apr 2004 16:40:14 +0000
Newsgroups gmane.comp.php.zzoss.installer.cvs
Message-ID <[email protected]>
Update of /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23374

Modified Files:
	Utils.php 
Log Message:
added DIRECTORY_SEPARATOR instead of hardcoded os-depandant separators

Index: Utils.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/Utils.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Utils.php	6 Apr 2004 14:45:16 -0000	1.8
--- Utils.php	6 Apr 2004 16:40:11 -0000	1.9
***************
*** 56,63 ****
  			while($entry = @readdir($d)) { 
  				if ($entry != "." && $entry != ".." && $entry != "") { 
! 					if (is_dir($dirName."/".$entry)) { 
! 						ZZOSS_InstallerUtils::rmdir($dirName."/".$entry); 
  					} else { 
! 						@unlink($dirName."/".$entry); 
  					} 
  				} 
--- 56,63 ----
  			while($entry = @readdir($d)) { 
  				if ($entry != "." && $entry != ".." && $entry != "") { 
! 					if (is_dir($dirName.DIRECTORY_SEPARATOR.$entry)) { 
! 						ZZOSS_InstallerUtils::rmdir($dirName.DIRECTORY_SEPARATOR.$entry); 
  					} else { 
! 						@unlink($dirName.DIRECTORY_SEPARATOR.$entry); 
  					} 
  				} 
***************
*** 76,88 ****
  	function mkdir ( $path ) 
  	{
! 		// check if there are two succeeding slashes, then
! 		// this might be an error of merged paths
! 		$path = str_replace('//', '/', $path);
  		
  		// split data path in directories 
! 		$dataDirs = explode( '/', $path );
!         $currPath = '';
  		for( $a=0; $a<count($dataDirs); $a++) { 
! 			$currPath .= $dataDirs[$a].'/'; 
  			// does directory to store data exist? 
  			if(!is_dir( $currPath )) { 
--- 76,87 ----
  	function mkdir ( $path ) 
  	{
! 		// fix incorrect path
! 		$path = ZZOSS_InstallerUtils::fixPath( $path );
  		
  		// split data path in directories 
! 		$dataDirs = explode( DIRECTORY_SEPARATOR, $path );
! 	        $currPath = '';
  		for( $a=0; $a<count($dataDirs); $a++) { 
! 			$currPath .= $dataDirs[$a].DIRECTORY_SEPARATOR; 
  			// does directory to store data exist? 
  			if(!is_dir( $currPath )) { 



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click