[zi-cvs] packages/com.zzoss.installer.lib Registry.php,1.8,1.9 Setup.php,1.3,1.4
[email protected] Thu, 29 Jan 2004 06:09:18 -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.sourceforge.net:/tmp/cvs-serv16467/com.zzoss.installer.lib
Modified Files:
Registry.php Setup.php
Log Message:
E_ALL support
Index: Registry.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/Registry.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Registry.php 28 Jan 2004 11:41:35 -0000 1.8
--- Registry.php 29 Jan 2004 14:09:16 -0000 1.9
***************
*** 45,49 ****
var $distributions_resolve = array();
var $no_distribution = true;
!
var $applications = array();
var $applications_resolve = array();
--- 45,49 ----
var $distributions_resolve = array();
var $no_distribution = true;
! var $application;
var $applications = array();
var $applications_resolve = array();
***************
*** 142,185 ****
return $this->application_path_rel;
}
! /*
! function registerDistribution($name)
! {
! if(ZZOSS_INSTALLER_REGISTRY_DEBUG){
! ZZOSS_Debug::log('ZZOSS_Registry', 'Starting to register distributions.', __FILE__, __LINE__, __FUNCTION__, __CLASS__);
! }
! $this->refreshDistributions();
!
! //$distributions_resolve = $this->getDistributionsResolve();
!
! if(!$distribution = $this->getDistribution($name)){
! return false;
! }
!
! $this->saveDistributionCurrent($name);
!
! $this->distribution = $distribution;
!
! $distribution_path =& $this->distribution["install"]["path"];
! // do we have an distribution ?
! if(is_dir($distribution_path)) {
! $this->distribution_path = $distribution_path;
!
! // compose array with available applications
! //$this->registerApplication();
!
! $this->no_distribution = false;
! return true;
! } else {
! $this->no_distribution = true;
! return false;
! }
! }
! */
! /*
! function noDistribution()
! {
! return $this->no_distribution;
! }
! */
// following function refreshes distributions array and
// updates serialized disk dump
--- 142,146 ----
return $this->application_path_rel;
}
!
// following function refreshes distributions array and
// updates serialized disk dump
***************
*** 291,311 ****
return false;
}
! /*
! function getDistributionsResolve()
! {
! if(count($this->distributions_resolve)){
! return $this->distributions_resolve;
! }
! return $this->distributions_resolve = ZZOSS_InstallerUtils::unserializeFromFile($this->reg_distributions_resolve);
! }
! */
!
! /*
! function saveDistributionCurrent($distribution)
! {
! $this->distribution = $distribution;
! ZZOSS_InstallerUtils::serializeToFile($this->reg_current_distribution, $distribution );
! }
! */
function getDistribution($distribution = NULL)
{
--- 252,256 ----
return false;
}
!
function getDistribution($distribution = NULL)
{
***************
*** 364,374 ****
return true;
}
- /*
- function getDistributionName()
- {
- $distribution = $this->getDistribution();
- return $distribution['name'];
- }
- */
function removeDistribution($distribution = NULL)
--- 309,312 ----
***************
*** 378,455 ****
}
! if(System::rm(array('-rf', $this->distribution_path))){
// set rebuild applications flag
return $this->lockDistributions();
}
}
! /*
! function isRegisteredDistribution($distribution)
! {
! $dir = $this->distribution_path = $this->dir_distributions.$distribution.DIRECTORY_SEPARATOR;
! return is_dir($dir);
! }
! */
! /**
! * TODO
! */
! /*
! function unsetApplications()
! {
! @unlink($this->distribution_path.'installer'.DIRECTORY_SEPARATOR.'applications.reg');
! @unlink($this->distribution_path.'installer'.DIRECTORY_SEPARATOR.'applications_resolve.reg');
! }
! */
! /*
! function hasApplications()
! {
! return (
! file_exists($this->distribution_path.'installer'.DIRECTORY_SEPARATOR.'applications.reg') &&
! file_exists($this->distribution_path.'installer'.DIRECTORY_SEPARATOR.'applications_resolve.reg')
! );
! }
! */
! /*
! function registerApplication($name)
! {
! if(ZZOSS_INSTALLER_REGISTRY_DEBUG){
! ZZOSS_Debug::log('ZZOSS_Registry', 'Starting to register applications.', __FILE__, __LINE__, __FUNCTION__, __CLASS__);
! }
!
! $this->refreshApplications();
!
! //$distributions_resolve = $this->getDistributionsResolve();
!
! if(!$application = $this->getApplication($name)){
! return false;
! }
!
! $this->application = $application;
!
! $path =& $this->application["install"]["path"];
!
! // do we have a distribution ?
! if(is_dir($path)) {
! if(ZZOSS_INSTALLER_REGISTRY_DEBUG){
! ZZOSS_Debug::log('ZZOSS_Registry', 'Application exists at '.$path, __FILE__, __LINE__, __FUNCTION__, __CLASS__);
! }
! $this->application_path = $path;
!
! // check for settings
! $this->getApplicationSettings();
!
! // compose array with available packages
! $this->registerPackages();
!
! $this->no_application = false;
! return true;
! } else {
! if(ZZOSS_INSTALLER_REGISTRY_DEBUG){
! ZZOSS_Debug::log('ZZOSS_Registry', 'No application at '.$path, __FILE__, __LINE__, __FUNCTION__, __CLASS__);
! }
! $this->no_application = true;
! return false;
! }
! }
! */
function noApplication()
{
--- 316,325 ----
}
! if(is_dir($this->distribution_path) && System::rm(array('-rf', $this->distribution_path))){
// set rebuild applications flag
return $this->lockDistributions();
}
}
!
function noApplication()
{
***************
*** 556,593 ****
return $applications[$this->application];
//}
- /*
- if($application = ZZOSS_InstallerUtils::unserializeFromFile($this->reg_current_application)) {
- //$this->saveApplicationCurrent($application);
- if(ZZOSS_INSTALLER_REGISTRY_DEBUG){
- ZZOSS_Debug::log('ZZOSS_Registry', 'Returning '.var_export($applications[$this->application], true), __FILE__, __LINE__, __FUNCTION__, __CLASS__);
- }
- return $applications[$this->application];
- }
-
- if(is_array($applications)) {
- $first = false;
- reset($applications);
- while(!$first && (list($key,$record) = each($applications))) {
- $first = $record;
- }
- if(is_array($first)) {
- if(ZZOSS_INSTALLER_REGISTRY_DEBUG){
- ZZOSS_Debug::log('ZZOSS_Registry', 'Returning '.var_export($first, true), __FILE__, __LINE__, __FUNCTION__, __CLASS__);
- }
- return $first;
- }
- }
- */
return false;
}
! /*
! function saveApplicationCurrent($application)
! {
! $this->application = $application;
! ZZOSS_InstallerUtils::serializeToFile($this->reg_current_application, $application );
! }
! */
! /** following function refreshes packages array and
* updates serialized disk dump
*
--- 426,434 ----
return $applications[$this->application];
//}
return false;
}
! /**
! * following function refreshes packages array and
* updates serialized disk dump
*
***************
*** 640,644 ****
// is this application installed ?
if($config_installed = $this->isInstalledApplication($entry)){
-
$xml["installed"] = $config_installed["release"]["version"];
}
--- 481,484 ----
***************
*** 1008,1012 ****
}
! @unlink($this->distribution_path.'installer'.DIRECTORY_SEPARATOR.'applications.lock');
}
--- 848,854 ----
}
! if(is_file($this->distribution_path.'installer'.DIRECTORY_SEPARATOR.'applications.lock')){
! @unlink($this->distribution_path.'installer'.DIRECTORY_SEPARATOR.'applications.lock');
! }
}
***************
*** 1020,1024 ****
}
! if(System::rm(array('-rf', $this->application_path))){
// set rebuild applications flag
return $this->lockApplications();
--- 862,866 ----
}
! if(is_dir($this->application_path) && System::rm(array('-rf', $this->application_path))){
// set rebuild applications flag
return $this->lockApplications();
Index: Setup.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/Setup.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Setup.php 14 Jan 2004 15:40:55 -0000 1.3
--- Setup.php 29 Jan 2004 14:09:16 -0000 1.4
***************
*** 112,117 ****
// but we want to be sure...
$id = 1;
!
! System::rm(array('-rf',$this->root));
if(!@System::mkdir(array('-p',$this->root))){
$this->error = 'Cannot create directory: '.$this->root;
--- 112,118 ----
// 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;
***************
*** 144,148 ****
function rmDataDir()
{
! System::rm(array('-rf', $this->data_dir));
unset($this->inits[getcwd()]);
ZZOSS_InstallerUtils::serializeToFile($this->init_file, $this->inits);
--- 145,151 ----
function rmDataDir()
{
! if(is_dir($this->data_dir)){
! System::rm(array('-rf', $this->data_dir));
! }
unset($this->inits[getcwd()]);
ZZOSS_InstallerUtils::serializeToFile($this->init_file, $this->inits);
***************
*** 157,163 ****
{
// Clean previous installations
! System::rm(array('-rf', $this->data_dir.'installer'));
! System::rm(array('-rf', $this->data_dir.'distributions'));
! System::rm(array('-rf', $this->data_dir.'dev'));
if(!mkdir($this->data_dir.'installer')){
--- 160,172 ----
{
// Clean previous installations
! if(is_dir($this->data_dir.'installer')){
! System::rm(array('-rf', $this->data_dir.'installer'));
! }
! if(is_dir($this->data_dir.'distributions')){
! System::rm(array('-rf', $this->data_dir.'distributions'));
! }
! if(is_dir($this->data_dir.'dev')){
! System::rm(array('-rf', $this->data_dir.'dev'));
! }
if(!mkdir($this->data_dir.'installer')){
-------------------------------------------------------
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