[zi-cvs] packages/com.zzoss.zic.plugin.filerole role_php.php,1.9,1.10

Sandro Zic <[email protected]> Wed, 07 Apr 2004 06:12:06 +0000
Newsgroups gmane.comp.php.zzoss.installer.cvs
Message-ID <[email protected]>
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic.plugin.filerole
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12475/com.zzoss.zic.plugin.filerole

Modified Files:
	role_php.php 
Log Message:
deal with win files that already exist as dir

Index: role_php.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic.plugin.filerole/role_php.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** role_php.php	6 Apr 2004 14:45:18 -0000	1.9
--- role_php.php	7 Apr 2004 06:12:03 -0000	1.10
***************
*** 76,83 ****
                      $GLOBALS['ZI']['plugin_log'] .= 'Created directory '.dirname($file_dest)."\n";
                  }
                  //ZZOSS_InstallerUtils::mkdir($pathinfo["dirname"]);
                  //$log .= 'src: '.$src. 'dest: '.$dest."\n";
                  //echo 'src: '.$GLOBALS['ZI']['file_src']. 'dest: '.$file_dest."\n<br>";
!                 if(!copy(ZZOSS_InstallerUtils::fixPath($GLOBALS['ZI']['file_src']),$file_dest)) {
                      $GLOBALS['ZI']['plugin_log'] .=
                      'Cannot copy '.$GLOBALS['ZI']['file_src']."\n".
--- 76,104 ----
                      $GLOBALS['ZI']['plugin_log'] .= 'Created directory '.dirname($file_dest)."\n";
                  }
+                 if(substr(PHP_OS, 0, 3) == 'WIN'){
+                     // Windows case insensitivity problem:
+                     // We get a probem with files that have the same name as an
+                     // already existing directory, copied to the same root
+                     // directory where the already existing dir is located
+                     // (e.g. dir 'PEAR', file 'pear').
+                     if(is_dir($GLOBALS['ZI']['file_dest'])){
+                         if(!$this->is_debug){
+                             // don't procede
+                             break;
+                         } else {
+                             trigger_error(
+                                 "Windows case insensitivity problem: ".
+                                 "The file '".$GLOBALS['ZI']['file_dest']."' conflicts with already existing directory '".$GLOBALS['ZI']['file_dest']."'. ".
+                                 "We get a probem with files that have the same name as an ".
+                                 "already existing directory, copied to the same root ".
+                                 "directory where the already existing dir is located. "
+                                 );
+                         }
+                     }
+                 }
                  //ZZOSS_InstallerUtils::mkdir($pathinfo["dirname"]);
                  //$log .= 'src: '.$src. 'dest: '.$dest."\n";
                  //echo 'src: '.$GLOBALS['ZI']['file_src']. 'dest: '.$file_dest."\n<br>";
!                 if(!copy($GLOBALS['ZI']['file_src'], $file_dest)) {
                      $GLOBALS['ZI']['plugin_log'] .=
                      'Cannot copy '.$GLOBALS['ZI']['file_src']."\n".



-------------------------------------------------------
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