cvs: pear-core / package-PEAR.xml package2.xml /PEAR Config.php Registry.php

From: Date: Wed, 14 May 2008 04:16:08 +0000
Subject: cvs: pear-core / package-PEAR.xml package2.xml /PEAR Config.php Registry.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-7560@lists.php.net to get a copy of this message
cellog Wed May 14 04:16:08 2008 UTC Modified files: /pear-core package-PEAR.xml package2.xml /pear-core/PEAR Config.php Registry.php Log: * Fix Bug #12945 PEAR_Registry::setConfig() does not set install path [cweiske/cellog] http://cvs.php.net/viewvc.cgi/pear-core/package-PEAR.xml?r1=1.534&r2=1.535&diff_format=u Index: pear-core/package-PEAR.xml diff -u pear-core/package-PEAR.xml:1.534 pear-core/package-PEAR.xml:1.535 --- pear-core/package-PEAR.xml:1.534 Tue May 13 23:53:10 2008 +++ pear-core/package-PEAR.xml Wed May 14 04:16:08 2008 @@ -93,6 +93,7 @@ <state>stable</state> <notes> * Implement Request #13375: install-pear.php should have option to set cfg_dir [timj] + * Fix Bug #12945 PEAR_Registry::setConfig() does not set install path [cweiske/cellog] * Fix Bug #12959 PEAR should give warning when doing &quot;special&quot; handling with cfg role [cellog] * Fix Bug #12960 role=cfg should automatically replace file if it has not been modified [cellog] * Fix Bug #13031 PEAR fails to authenticate when doing upgrade-all on non-default channel [timj] http://cvs.php.net/viewvc.cgi/pear-core/package2.xml?r1=1.434&r2=1.435&diff_format=u Index: pear-core/package2.xml diff -u pear-core/package2.xml:1.434 pear-core/package2.xml:1.435 --- pear-core/package2.xml:1.434 Tue May 13 23:53:10 2008 +++ pear-core/package2.xml Wed May 14 04:16:08 2008 @@ -98,6 +98,7 @@ <license uri="http://www.php.net/license">PHP License</license> <notes> * Implement Request #13375: install-pear.php should have option to set cfg_dir [timj] + * Fix Bug #12945 PEAR_Registry::setConfig() does not set install path [cweiske/cellog] * Fix Bug #12959 PEAR should give warning when doing &quot;special&quot; handling with cfg role [cellog] * Fix Bug #12960 role=cfg should automatically replace file if it has not been modified [cellog] * Fix Bug #13031 PEAR fails to authenticate when doing upgrade-all on non-default channel [timj] http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Config.php?r1=1.145&r2=1.146&diff_format=u Index: pear-core/PEAR/Config.php diff -u pear-core/PEAR/Config.php:1.145 pear-core/PEAR/Config.php:1.146 --- pear-core/PEAR/Config.php:1.145 Tue May 13 01:32:17 2008 +++ pear-core/PEAR/Config.php Wed May 14 04:16:08 2008 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2008 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Config.php,v 1.145 2008/05/13 01:32:17 cellog Exp $ + * @version CVS: $Id: Config.php,v 1.146 2008/05/14 04:16:08 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -643,7 +643,7 @@ } $this->_registry['default'] = &new PEAR_Registry($this->configuration['default']['php_dir']); - $this->_registry['default']->setConfig($this); + $this->_registry['default']->setConfig($this, false); $this->_regInitialized['default'] = false; //$GLOBALS['_PEAR_Config_instance'] = &$this; } @@ -759,7 +759,7 @@ $this->_setupChannels(); if (!$this->_noRegistry && ($phpdir = $this->get('php_dir', $layer, 'pear.php.net'))) { $this->_registry[$layer] = &new PEAR_Registry($phpdir); - $this->_registry[$layer]->setConfig($this); + $this->_registry[$layer]->setConfig($this, false); $this->_regInitialized[$layer] = false; } else { unset($this->_registry[$layer]); @@ -917,7 +917,7 @@ $this->_setupChannels(); if (!$this->_noRegistry && ($phpdir = $this->get('php_dir', $layer, 'pear.php.net'))) { $this->_registry[$layer] = &new PEAR_Registry($phpdir); - $this->_registry[$layer]->setConfig($this); + $this->_registry[$layer]->setConfig($this, false); $this->_regInitialized[$layer] = false; } else { unset($this->_registry[$layer]); @@ -1558,7 +1558,7 @@ $value != $this->_registry[$layer]->install_dir) { $this->_registry[$layer] = &new PEAR_Registry($value); $this->_regInitialized[$layer] = false; - $this->_registry[$layer]->setConfig($this); + $this->_registry[$layer]->setConfig($this, false); } } return true; @@ -1584,7 +1584,7 @@ if (!is_object($this->_registry[$layer])) { if ($phpdir = $this->get('php_dir', $layer, 'pear.php.net')) { $this->_registry[$layer] = &new PEAR_Registry($phpdir); - $this->_registry[$layer]->setConfig($this); + $this->_registry[$layer]->setConfig($this, false); $this->_regInitialized[$layer] = false; } else { unset($this->_registry[$layer]); @@ -2068,7 +2068,7 @@ } $this->_registry[$layer] = &$reg; if (is_object($reg)) { - $this->_registry[$layer]->setConfig($this); + $this->_registry[$layer]->setConfig($this, false); } return true; } @@ -2153,7 +2153,7 @@ } $this->_registry[$layer] = &new PEAR_Registry($this->get('php_dir', $layer, 'pear.php.net')); - $this->_registry[$layer]->setConfig($this); + $this->_registry[$layer]->setConfig($this, false); $this->_regInitialized[$layer] = false; } } http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Registry.php?r1=1.170&r2=1.171&diff_format=u Index: pear-core/PEAR/Registry.php diff -u pear-core/PEAR/Registry.php:1.170 pear-core/PEAR/Registry.php:1.171 --- pear-core/PEAR/Registry.php:1.170 Thu Jan 3 20:26:36 2008 +++ pear-core/PEAR/Registry.php Wed May 14 04:16:08 2008 @@ -17,7 +17,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2008 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Registry.php,v 1.170 2008/01/03 20:26:36 cellog Exp $ + * @version CVS: $Id: Registry.php,v 1.171 2008/05/14 04:16:08 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -141,15 +141,20 @@ $pecl_channel = false) { parent::PEAR(); + $this->setInstallDir($pear_install_dir); + $this->_pearChannel = $pear_channel; + $this->_peclChannel = $pecl_channel; + $this->_config = false; + } + + function setInstallDir($pear_install_dir = PEAR_INSTALL_DIR) + { $ds = DIRECTORY_SEPARATOR; $this->install_dir = $pear_install_dir; $this->channelsdir = $pear_install_dir.$ds.'.channels'; $this->statedir = $pear_install_dir.$ds.'.registry'; $this->filemap = $pear_install_dir.$ds.'.filemap'; $this->lockfile = $pear_install_dir.$ds.'.lock'; - $this->_pearChannel = $pear_channel; - $this->_peclChannel = $pecl_channel; - $this->_config = false; } function hasWriteAccess() @@ -175,9 +180,12 @@ return is_writeable($this->install_dir); } - function setConfig(&$config) + function setConfig(&$config, $resetInstallDir = true) { $this->_config = &$config; + if ($resetInstallDir) { + $this->setInstallDir($config->get('php_dir')); + } } function _initializeChannelDirs()

« previous php.pear.core (#7560) next »