[zi-cvs] packages/com.zzoss.installer.lib Registry.php,1.15,1.16 Widget.php,1.5,1.6

Sandro Zic <[email protected]> Thu, 18 Mar 2004 09:41:40 +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-serv15653/com.zzoss.installer.lib

Modified Files:
	Registry.php Widget.php 
Log Message:
quick install of dev apps

Index: Widget.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/Widget.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Widget.php	9 Mar 2004 08:13:51 -0000	1.5
--- Widget.php	18 Mar 2004 09:41:38 -0000	1.6
***************
*** 369,373 ****
  			  	foreach($options as $key => $val){
  				  	?>
! 					<option value="<?php echo $val; ?>" <?php if($_REQUEST['ZI_VALUES'][$this->name] == $val) echo 'selected';?>><?php echo $key; ?>
  					<?php
  				}
--- 369,373 ----
  			  	foreach($options as $key => $val){
  				  	?>
! 					<option value="<?php echo $val; ?>" <?php if(isset($_REQUEST['ZI_VALUES'][$this->name]) && $_REQUEST['ZI_VALUES'][$this->name] == $val) echo 'selected';?>><?php echo $key; ?>
  					<?php
  				}
***************
*** 403,407 ****
              
  			?><input type="radio" name="ZI_VALUES[<?php echo $this->name; ?>]" value="<?php echo $this->options['value']; ?>"<?php
!             if($_REQUEST['ZI_VALUES'][$this->name] == $this->options['value']){
                  echo ' checked';
              }?>>
--- 403,407 ----
              
  			?><input type="radio" name="ZI_VALUES[<?php echo $this->name; ?>]" value="<?php echo $this->options['value']; ?>"<?php
!             if(isset($_REQUEST['ZI_VALUES'][$this->name]) && $_REQUEST['ZI_VALUES'][$this->name] == $this->options['value']){
                  echo ' checked';
              }?>>

Index: Registry.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/Registry.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Registry.php	9 Mar 2004 06:06:15 -0000	1.15
--- Registry.php	18 Mar 2004 09:41:38 -0000	1.16
***************
*** 948,952 ****
              if(!
                  (filemtime($src_pkgs.'.') > $mtime_pkgs) &&
!                 (is_dir($installed_pkgs) && filemtime($installed_pkgs) > $mtime_pkgs)
                  ){
                  return true;
--- 948,952 ----
              if(!
                  (filemtime($src_pkgs.'.') > $mtime_pkgs) &&
!                 (is_dir($installed_pkgs) && filemtime($installed_pkgs) < $mtime_pkgs)
                  ){
                  return true;
***************
*** 1249,1276 ****
                              ZZOSS_Debug::log('ZZOSS_Registry', '$file = '.$package_xml, __FILE__, __LINE__, __FUNCTION__, __CLASS__);
                          }
!                         if(file_exists($package_xml)) {
!                             unset($package_config);
!                             $package_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('dep','file', 'build', 'maintainer')));
!                             $package_config->setFile($package_xml); 
!                             $package_config->setCacheDir($this->application_path.'cache'.DIRECTORY_SEPARATOR);
!                             $package_config->writeCacheUnique();
!                             $xml = array();
!                             $xml = $package_config->query('/package');
!                             $xml["install"]["path"] = $dir;
!                             $xml["install"]["type"] = 'local';
!                             $xml["id"] = $count;
                              $key = $xml["name"].'-'.$xml['release']['version'];
!                             if(isset($this->packages_specified[$key]['@']['use']) && $this->packages_specified[$key]['@']['use'] == 'required') {
!                                 $xml["install"]["required"] = true;
!                             } else {
!                                 $xml["install"]["required"] = false;
!                             }
!                             // only show packages defined in application.xml
!                             if(!isset($this->packages_specified[$key])){
!                                 $xml['_specified'] = false;
!                             } else {
!                                 $xml['_specified'] = true;
!                             }
!                             // already got this module ?
                              if(!isset($packages[$key])) {
                                  if(ZZOSS_INSTALLER_REGISTRY_DEBUG){
--- 1249,1255 ----
                              ZZOSS_Debug::log('ZZOSS_Registry', '$file = '.$package_xml, __FILE__, __LINE__, __FUNCTION__, __CLASS__);
                          }
!                         if($xml = $this->getPackageDescr($package_xml, $count)) {
                              $key = $xml["name"].'-'.$xml['release']['version'];
!                             // already got this package ?
                              if(!isset($packages[$key])) {
                                  if(ZZOSS_INSTALLER_REGISTRY_DEBUG){
***************
*** 1343,1352 ****
                      $dir = $this->application_path.$this->package_type.'s_installed'.DIRECTORY_SEPARATOR.$entry.DIRECTORY_SEPARATOR;
                      $file = $dir.'package.xml';
!                     if(file_exists($file)) {
!                         $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');
                          if(!isset($package[$xml["name"].'-'.$xml['release']['version']])) {
                              $key = $xml["name"].'-'.$xml['release']['version'];
--- 1322,1327 ----
                      $dir = $this->application_path.$this->package_type.'s_installed'.DIRECTORY_SEPARATOR.$entry.DIRECTORY_SEPARATOR;
                      $file = $dir.'package.xml';
!                     if($xml = $this->getPackageDescr($file, $count)) {
!                         $key = $xml["name"].'-'.$xml['release']['version'];
                          if(!isset($package[$xml["name"].'-'.$xml['release']['version']])) {
                              $key = $xml["name"].'-'.$xml['release']['version'];
***************
*** 1383,1386 ****
--- 1358,1392 ----
      }
      
+     function getPackageDescr($package_xml, $id = NULL)
+     {
+         if(!file_exists($package_xml)){
+             return false;
+         }
+         
+         $package_config = new ZZOSS_Config(array('numeric' => array('dep','file', 'build', 'maintainer')));
+         $package_config->setFile($package_xml); 
+         $xml = array();
+         $xml = $package_config->query('/package');
+         $xml["install"]["path"] = dirname($package_xml).DIRECTORY_SEPARATOR;
+         $xml["install"]["type"] = 'local';
+         if(isset($id)){
+             $xml["id"] = $id;
+         }
+         $key = $xml["name"].'-'.$xml['release']['version'];
+         if(isset($this->packages_specified[$key]['@']['use']) && $this->packages_specified[$key]['@']['use'] == 'required') {
+             $xml["install"]["required"] = true;
+         } else {
+             $xml["install"]["required"] = false;
+         }
+         // only show packages defined in application.xml
+         if(!isset($this->packages_specified[$key])){
+             $xml['_specified'] = false;
+         } else {
+             $xml['_specified'] = true;
+         }
+         
+         return $xml;
+     }
+     
      function setPackages($packages)
      {
***************
*** 1390,1394 ****
      function unsetPackages()
      {
!         echo $packages_reg = $this->application_path.'installer'.DIRECTORY_SEPARATOR.$this->package_type.'s_packages.reg';
          if(file_exists($packages_reg)){
              unlink($packages_reg);
--- 1396,1400 ----
      function unsetPackages()
      {
!         $packages_reg = $this->application_path.'installer'.DIRECTORY_SEPARATOR.$this->package_type.'s_packages.reg';
          if(file_exists($packages_reg)){
              unlink($packages_reg);
***************
*** 1734,1737 ****
--- 1740,1778 ----
      }
  
+     function setPluginDev($plugin_dev)
+     {
+         $plugins_dev_reg = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'plugins_dev.reg';
+         $plugins_dev_old = array();
+         
+         if(file_exists($plugins_dev_reg)){
+             $plugins_dev_old = ZZOSS_InstallerUtils::unserializeFromFile($plugins_dev_reg);
+         }
+         
+         if(count($plugins_dev_old)){
+             $plugins = $plugin_dev + $plugins_dev_old;
+             //@unlink($plugins_dev_reg);
+         } else {
+             $plugins = $plugin_dev;
+         }
+         
+         ZZOSS_InstallerUtils::serializeToFile($plugins_dev_reg, $plugins);
+     }
+     
+     function getPluginsDev($plugin = NULL)
+     {
+         $plugins_dev_reg = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'plugins_dev.reg';
+         
+         if(file_exists($plugins_dev_reg)){
+             $plugins_dev = ZZOSS_InstallerUtils::unserializeFromFile($plugins_dev_reg);
+             if(!isset($plugin)){
+                 return $plugins_dev;
+             } elseif (isset($plugins_dev[$plugin])){
+                 return $plugins_dev[$plugin];
+             } else {
+                 return false;
+             }
+         }
+     }
+     
      function isConfigured()
      {
***************
*** 1773,1776 ****
--- 1814,1856 ----
          System::mkdir(array('-p',$this->application_path.'plugins'));
      }
+ 
+     function setProcedures($procedure, $ident = '')
+     {
+         ZZOSS_InstallerUtils::serializeToFile( $this->application_path.'installer'.DIRECTORY_SEPARATOR.'procedures'.$ident.'.reg', $procedure );
+     }
+ 
+     function setProcedure($procedure, $val = 'on')
+     {
+         $procedures_new[$procedure] = $val;
+         
+         $procedures_reg = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'procedures.reg';
+ 		
+         $procedures_old = ZZOSS_InstallerUtils::unserializeFromFile($procedures_reg);
+         if(is_array($procedures_old) && count($procedures_old)){
+             $procedures = $procedures_new + $procedures_old;
+             @unlink($procedures_reg);
+         } else {
+             $procedures = $procedures_new;
+         }
+ 		ZZOSS_InstallerUtils::serializeToFile( $procedures_reg, $procedures );
+     }
+ 
+     function isProcedure($type)
+     {
+         $procedures_reg = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'procedures.reg';
+         $procedures = ZZOSS_InstallerUtils::unserializeFromFile($procedures_reg);
+         return (isset($procedures[$type]) && $procedures[$type] == 'on');
+     }
+ 
+     function getProcedures($ident = '')
+     {
+         return ZZOSS_InstallerUtils::unserializeFromFile( $this->application_path.'installer'.DIRECTORY_SEPARATOR.'procedures'.$ident.'.reg');
+     }
+ 
+     function getProcedure($procedure)
+     {
+         $procedures = ZZOSS_InstallerUtils::unserializeFromFile( $this->application_path.'installer'.DIRECTORY_SEPARATOR.'procedures.reg');
+         return (isset($procedures[$procedure])) ? $procedures[$procedure] : false;
+     }
  }
  ?>
\ No newline at end of file



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