[zi-cvs] packages/com.zzoss.installer.lib Registry.php,1.6,1.7 Utils.php,1.4,1.5

[email protected] Wed, 21 Jan 2004 10:16:16 -0800
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:/tmp/cvs-serv6596/com.zzoss.installer.lib

Modified Files:
	Registry.php Utils.php 
Log Message:
some more windows and MSIE support

Index: Registry.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/Registry.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Registry.php	14 Jan 2004 15:40:55 -0000	1.6
--- Registry.php	21 Jan 2004 18:16:14 -0000	1.7
***************
*** 472,476 ****
  		$config->setFile($application['install']['path'].'application.xml');
  		ZZOSS_InstallerUtils::serializeToFile(
!             $application['install']['path'].'installer/application_installed.reg',
  			$config->query('/application')
  			);
--- 472,476 ----
  		$config->setFile($application['install']['path'].'application.xml');
  		ZZOSS_InstallerUtils::serializeToFile(
!             $application['install']['path'].'installer'.DIRECTORY_SEPARATOR.'application_installed.reg',
  			$config->query('/application')
  			);
***************
*** 629,633 ****
              $application = $this->application;
              
!             while (false !== ($entry = readdir($dp))) { 
                  $dir = $this->distribution_path.'applications'.DIRECTORY_SEPARATOR.$entry;
                  $file = $dir.DIRECTORY_SEPARATOR.'application.xml';
--- 629,633 ----
              $application = $this->application;
              
!             while (false !== ($entry = readdir($dp))) {
                  $dir = $this->distribution_path.'applications'.DIRECTORY_SEPARATOR.$entry;
                  $file = $dir.DIRECTORY_SEPARATOR.'application.xml';
***************
*** 636,640 ****
                      $config->setFile($file);
                      $xml = $config->query('/application');
!                     $xml["install"]["path"] = $this->distribution_path.'applications'.DIRECTORY_SEPARATOR.$entry.'/';
                      $xml["id"] = $count;
                      // is this application installed ?
--- 636,640 ----
                      $config->setFile($file);
                      $xml = $config->query('/application');
!                     $xml["install"]["path"] = $this->distribution_path.'applications'.DIRECTORY_SEPARATOR.$entry.DIRECTORY_SEPARATOR;
                      $xml["id"] = $count;
                      // is this application installed ?
***************
*** 659,665 ****
              closedir($dp);
              
-             // Set back application
-             $this->setApplication($application);
-             
              // sort array
              if(is_array($applications)) {
--- 659,662 ----
***************
*** 672,675 ****
--- 669,677 ----
              // remove possible flag
              $this->unlockApplications();
+             
+             // Set back application
+             if(strlen($application)){
+                 $this->setApplication($application);
+             }
          }
      }
***************
*** 843,847 ****
          
          $application = $this->getApplicationById($id);
!      	$file = $application["install"]["path"].'installer/application_settings.reg';
  		if(file_exists($file)) {
  			$old_settings = ZZOSS_InstallerUtils::unserializeFromFile( $file );
--- 845,849 ----
          
          $application = $this->getApplicationById($id);
!      	$file = $application["install"]["path"].'installer'.DIRECTORY_SEPARATOR.'application_settings.reg';
  		if(file_exists($file)) {
  			$old_settings = ZZOSS_InstallerUtils::unserializeFromFile( $file );
***************
*** 862,866 ****
          
          $application = $this->getApplication();
!      	$file = $application["install"]["path"].'installer/application_settings.reg';
  		if(file_exists($file)) {
  			$old_settings = ZZOSS_InstallerUtils::unserializeFromFile( $file );
--- 864,868 ----
          
          $application = $this->getApplication();
!      	$file = $application["install"]["path"].'installer'.DIRECTORY_SEPARATOR.'application_settings.reg';
  		if(file_exists($file)) {
  			$old_settings = ZZOSS_InstallerUtils::unserializeFromFile( $file );
***************
*** 878,882 ****
          
          $application = $this->getApplicationById($id);
!         $file = $application["install"]["path"].'installer/application_settings.reg';
  		if(file_exists($file)){
  			return ZZOSS_InstallerUtils::unserializeFromFile( $file );
--- 880,884 ----
          
          $application = $this->getApplicationById($id);
!         $file = $application["install"]["path"].'installer'.DIRECTORY_SEPARATOR.'application_settings.reg';
  		if(file_exists($file)){
  			return ZZOSS_InstallerUtils::unserializeFromFile( $file );
***************
*** 1033,1037 ****
          }
          
!         $file = $this->application_path.'installer/profile.reg';
  	    ZZOSS_InstallerUtils::serializeToFile( $file, $profile );
      }
--- 1035,1039 ----
          }
          
!         $file = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'profile.reg';
  	    ZZOSS_InstallerUtils::serializeToFile( $file, $profile );
      }
***************
*** 1046,1050 ****
          }
  	  	// load package selection
! 		$file = $this->application_path.'installer/profile.reg';
  		return ZZOSS_InstallerUtils::unserializeFromFile( $file );
  	}
--- 1048,1052 ----
          }
  	  	// load package selection
! 		$file = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'profile.reg';
  		return ZZOSS_InstallerUtils::unserializeFromFile( $file );
  	}
***************
*** 1132,1136 ****
  			$package_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('dep','file', 'build', 'maintainer')));
  			$package_config->setFile($file); 
! 			//$package_config->setCacheDir($this->application_path.'cache/');
  			return $package_config->query('/package');
  		}
--- 1134,1138 ----
  			$package_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('dep','file', 'build', 'maintainer')));
  			$package_config->setFile($file); 
! 			//$package_config->setCacheDir($this->application_path.'cache'.DIRECTORY_SEPARATOR);
  			return $package_config->query('/package');
  		}
***************
*** 1182,1186 ****
          $application = $this->getApplicationById($id);
          // set package rebuild flag
!         $fp = fopen($application["install"]["path"]."installer/packages.lock","w");
          fputs($fp,'dummy');
          fclose($fp);
--- 1184,1188 ----
          $application = $this->getApplicationById($id);
          // set package rebuild flag
!         $fp = fopen($application["install"]["path"]."installer".DIRECTORY_SEPARATOR."packages.lock","w");
          fputs($fp,'dummy');
          fclose($fp);
***************
*** 1303,1307 ****
                              $package_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('dep','file', 'build', 'maintainer')));
                              $package_config->setFile($file); 
!                             $package_config->setCacheDir($this->application_path.'cache/');
                              $package_config->writeCacheUnique();
                              $xml = array();
--- 1305,1309 ----
                              $package_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('dep','file', 'build', 'maintainer')));
                              $package_config->setFile($file); 
!                             $package_config->setCacheDir($this->application_path.'cache'.DIRECTORY_SEPARATOR);
                              $package_config->writeCacheUnique();
                              $xml = array();
***************
*** 1347,1351 ****
          }
          // add remote packages if exist
!         $file = $this->application_path.'installer/remote_packages.xml';
          if(file_exists($file)) {
              $remote_packages_xml = new ZZOSS_Config( array( 'cache' => true, 
--- 1349,1353 ----
          }
          // add remote packages if exist
!         $file = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'remote_packages.xml';
          if(file_exists($file)) {
              $remote_packages_xml = new ZZOSS_Config( array( 'cache' => true, 
***************
*** 1401,1405 ****
                          $package_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('dep','file', 'maintainer')));
                          $package_config->setFile($file); 
!                         $package_config->setCacheDir($this->application_path.'cache/');
                          $package_config->writeCacheUnique();
                          $xml = $package_config->query('/package');
--- 1403,1407 ----
                          $package_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('dep','file', 'maintainer')));
                          $package_config->setFile($file); 
!                         $package_config->setCacheDir($this->application_path.'cache'.DIRECTORY_SEPARATOR);
                          $package_config->writeCacheUnique();
                          $xml = $package_config->query('/package');
***************
*** 1436,1450 ****
      function setPackages($packages)
      {
!         ZZOSS_InstallerUtils::serializeToFile( $this->application_path.'installer/packages.reg', $packages );
      }
      
      function setPackagesResolve($packages_resolve)
      {
!         ZZOSS_InstallerUtils::serializeToFile( $this->application_path.'installer/packages_resolve.reg', $packages_resolve );
      }
      
      function setPackagesVersions($packages)
      {
!         ZZOSS_InstallerUtils::serializeToFile( $this->application_path.'installer/packages_versions.reg', $packages );
      }
      
--- 1438,1452 ----
      function setPackages($packages)
      {
!         ZZOSS_InstallerUtils::serializeToFile( $this->application_path.'installer'.DIRECTORY_SEPARATOR.'packages.reg', $packages );
      }
      
      function setPackagesResolve($packages_resolve)
      {
!         ZZOSS_InstallerUtils::serializeToFile( $this->application_path.'installer'.DIRECTORY_SEPARATOR.'packages_resolve.reg', $packages_resolve );
      }
      
      function setPackagesVersions($packages)
      {
!         ZZOSS_InstallerUtils::serializeToFile( $this->application_path.'installer'.DIRECTORY_SEPARATOR.'packages_versions.reg', $packages );
      }
      
***************
*** 1458,1462 ****
          }
          
!         $file = $this->application_path.'installer/installation_packages.reg';
  	    ZZOSS_InstallerUtils::serializeToFile( $file, $packages );
      }
--- 1460,1464 ----
          }
          
!         $file = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'installation_packages.reg';
  	    ZZOSS_InstallerUtils::serializeToFile( $file, $packages );
      }
***************
*** 1483,1487 ****
          echo '</pre>';
          */
!         $file = $this->application_path.'installer/installation_packages.reg';
          @unlink($file);
  	    ZZOSS_InstallerUtils::serializeToFile( $file, $packages );
--- 1485,1489 ----
          echo '</pre>';
          */
!         $file = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'installation_packages.reg';
          @unlink($file);
  	    ZZOSS_InstallerUtils::serializeToFile( $file, $packages );
***************
*** 1497,1501 ****
          }
  	  	// load package selection
! 		$file = $this->application_path.'installer/installation_packages.reg';
  		return ZZOSS_InstallerUtils::unserializeFromFile( $file );
  	}
--- 1499,1503 ----
          }
  	  	// load package selection
! 		$file = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'installation_packages.reg';
  		return ZZOSS_InstallerUtils::unserializeFromFile( $file );
  	}
***************
*** 1510,1514 ****
          }
          
!         $file = $this->application_path.'installer/installation_packages_deps.reg';
  	    ZZOSS_InstallerUtils::serializeToFile( $file, $packages );
      }
--- 1512,1516 ----
          }
          
!         $file = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'installation_packages_deps.reg';
  	    ZZOSS_InstallerUtils::serializeToFile( $file, $packages );
      }
***************
*** 1523,1527 ****
          }
  	  	// load package selection
! 		$file = $this->application_path.'installer/installation_packages_deps.reg';
  		return ZZOSS_InstallerUtils::unserializeFromFile( $file );
  	}
--- 1525,1529 ----
          }
  	  	// load package selection
! 		$file = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'installation_packages_deps.reg';
  		return ZZOSS_InstallerUtils::unserializeFromFile( $file );
  	}
***************
*** 1538,1542 ****
              $package_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('dep','file', 'build', 'maintainer')));
              $package_config->setFile($xml); 
!             $package_config->setCacheDir($this->application_path.'cache/');
              $xml = $package_config->query('/package');
              $xml["install"]["path"] = $dir;
--- 1540,1544 ----
              $package_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('dep','file', 'build', 'maintainer')));
              $package_config->setFile($xml); 
!             $package_config->setCacheDir($this->application_path.'cache'.DIRECTORY_SEPARATOR);
              $xml = $package_config->query('/package');
              $xml["install"]["path"] = $dir;
***************
*** 1564,1568 ****
  	{
  		// save process queue
! 		$file = $this->application_path.'installer/installation_packages_queue.reg';
          $queue_old = ZZOSS_InstallerUtils::unserializeFromFile($file);
          if(is_array($queue_old) && count($queue_old)){
--- 1566,1570 ----
  	{
  		// save process queue
! 		$file = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'installation_packages_queue.reg';
          $queue_old = ZZOSS_InstallerUtils::unserializeFromFile($file);
          if(is_array($queue_old) && count($queue_old)){
***************
*** 1578,1582 ****
  	{
  		// save process queue
! 		$file = $this->application_path.'installer/installation_packages_queue.reg';
  		return ZZOSS_InstallerUtils::unserializeFromFile( $file );
  	}
--- 1580,1584 ----
  	{
  		// save process queue
! 		$file = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'installation_packages_queue.reg';
  		return ZZOSS_InstallerUtils::unserializeFromFile( $file );
  	}

Index: Utils.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/Utils.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Utils.php	11 Jan 2004 16:24:19 -0000	1.4
--- Utils.php	21 Jan 2004 18:16:14 -0000	1.5
***************
*** 426,433 ****
  	}
  	
!     function fixPath($path) {
! 		$path = preg_replace('/\/{2,}|\\\{1,}/i', DIRECTORY_SEPARATOR, $path);
  		return $path;
  	}
  }
  ?>
\ No newline at end of file
--- 426,455 ----
  	}
  	
!     /**
!     * Takes care that a slash occurs only once.
!     */
!     function fixPath($path, $slash = NULL)
!     {
!         if(is_null($slash)){
!             $slash = DIRECTORY_SEPARATOR;
!         }
! 		$path = preg_replace('/\/{2,}|\\\{1,}/i', $slash, $path);
  		return $path;
  	}
+     
+     /**
+     * Fixes wrong slashes (e.g. Linux slashes on Windows) and takes care
+     * that a slash occurs only once.
+     */
+     function fixSlashes($path)
+     {
+         if(DIRECTORY_SEPARATOR == '/'){
+             $wrong_separator = '\\';
+         } else {
+             $wrong_separator = '/';
+         }
+ 		$path = preg_replace('/\\'.DIRECTORY_SEPARATOR.'{2,}|\\'.$wrong_separator.'{1,}/i', DIRECTORY_SEPARATOR, $path);
+         return $path;
+     }
  }
  ?>
\ No newline at end of file




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn