[zi-cvs] packages/com.zzoss.installer.lib Setup.php,1.5,1.6

Sandro Zic <[email protected]> Fri, 19 Mar 2004 12:18:17 +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-serv12869/com.zzoss.installer.lib

Modified Files:
	Setup.php 
Log Message:
quick install

Index: Setup.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/Setup.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Setup.php	9 Mar 2004 06:12:04 -0000	1.5
--- Setup.php	19 Mar 2004 12:18:15 -0000	1.6
***************
*** 38,47 ****
      var $error = '';
      
!     function ZZOSS_InstallerSetup()
      {
-         $GLOBALS['ZI']['setup_obj'] =& $this;
-         
          // Set default data dir.
!         $this->init_dir = System::tmpdir().DIRECTORY_SEPARATOR.'zzoss_installer'.DIRECTORY_SEPARATOR;
          // Define the init file path. This file holds the info, where the data dir is located
          // for every single installer installation.
--- 38,45 ----
      var $error = '';
      
!     function ZZOSS_InstallerSetup($root)
      {
          // Set default data dir.
!         $this->init_dir = $root.DIRECTORY_SEPARATOR;
          // Define the init file path. This file holds the info, where the data dir is located
          // for every single installer installation.
***************
*** 49,58 ****
          
          // Retrieve init array.
!         $this->inits = ZZOSS_InstallerUtils::unserializeFromFile($this->init_file);
!     }
!     
!     function &reference()
!     {
!         return $GLOBALS['ZI']['setup_obj'];
      }
      
--- 47,53 ----
          
          // Retrieve init array.
!         if(file_exists($this->init_file)){
!             $this->inits = ZZOSS_InstallerUtils::unserializeFromFile($this->init_file);
!         }
      }
      
***************
*** 64,68 ****
      function isInitiated()
      {
!         $this->is_initiated = isset($this->inits[getcwd()]);
          //var_dump($this->is_initiated);
          return $this->is_initiated;
--- 59,63 ----
      function isInitiated()
      {
!         $this->is_initiated = (isset($this->inits[getcwd()]) && is_writeable($this->inits[getcwd()]));
          //var_dump($this->is_initiated);
          return $this->is_initiated;
***************
*** 90,109 ****
              }
          }
!         $this->root = $dir;
          return true;
      }
!     
!     /**
!     * Check if there are already installer configs
!     * and ask if we should resume from them?
!     */
!     function isInstalled($data_dir)
!     {
!         if(file_exists($data_dir.'conf.reg')){
!             return true;
!         }
!         return false;
!     }
!     
      function init()
      {
--- 85,92 ----
              }
          }
!         $this->init_dir = $dir;
          return true;
      }
!       
      function init()
      {
***************
*** 112,132 ****
              // but we want to be sure...
              $id = 1;
!             if(is_dir($this->root)){
!                 System::rm(array('-rf',$this->root));
              }
!             if(!@System::mkdir(array('-p',$this->root))){
!                 $this->error = 'Cannot create directory: '.$this->root;
                  return false;
              }
              
!             $this->inits['_root'] = $this->root;
              
              // Write the .htaccess to the root data dir.
!             $fp = @fopen($this->root.'.htaccess','w');
              fputs($fp, 'deny from all');
              fclose($fp);
          }
          
!         $this->data_dir .= $this->root.$id.DIRECTORY_SEPARATOR;
          
          if(!@System::mkdir(array('-p',$this->data_dir))){
--- 95,119 ----
              // but we want to be sure...
              $id = 1;
!             /*
!             if(is_dir($this->init_dir)){
!                 System::rm(array('-rf',$this->init_dir));
              }
!             */
!             if(!System::mkdir(array('-p',$this->init_dir))){
!                 $this->error = 'Cannot create directory: '.$this->init_dir;
                  return false;
              }
              
!             $this->inits['_root'] = $this->init_dir;
              
              // Write the .htaccess to the root data dir.
!             $fp = @fopen($this->init_dir.'.htaccess','w');
              fputs($fp, 'deny from all');
              fclose($fp);
          }
          
!         if(!strlen($this->data_dir)){
!             $this->data_dir = $this->init_dir.$id.DIRECTORY_SEPARATOR;
!         }
          
          if(!@System::mkdir(array('-p',$this->data_dir))){
***************
*** 199,203 ****
                  $this->data_dir = $this->inits[getcwd()];
              }
-             $this->root = $this->inits['_root'];
          }
          return $this->data_dir;
--- 186,189 ----



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