Make the dependencies check look for the correct registry file

This commit is contained in:
Tomas V.V.Cox 2002-04-09 14:12:12 +00:00
parent eb85e073e5
commit 4c125afc74
2 changed files with 6 additions and 6 deletions

View file

@ -29,7 +29,10 @@ require_once "PEAR.php";
class PEAR_Dependency
{
function PEAR_Dependency(&$registry)
{
$this->registry = &$registry;
}
/**
* This method maps the xml dependency definition to the
* PEAR_dependecy one
@ -87,9 +90,6 @@ class PEAR_Dependency
*/
function checkPackage($name, $req = null, $relation = 'has')
{
if (empty($this->registry)) {
$this->registry = new PEAR_Registry;
}
if (!$this->registry->packageExists($name)) {
return "'$name' PEAR package is not installed";
}

View file

@ -238,7 +238,7 @@ class PEAR_Installer extends PEAR_Common
// - soft : fail silently
//
if (empty($this->registry)) {
$this->registry = new PEAR_Registry($this->config->get('php_dir'));
$this->registry = &new PEAR_Registry($this->config->get('php_dir'));
}
$oldcwd = getcwd();
$need_download = false;
@ -453,7 +453,7 @@ class PEAR_Installer extends PEAR_Common
function checkDeps(&$pkginfo)
{
$deps = new PEAR_Dependency;
$deps = &new PEAR_Dependency($this->registry);
$errors = null;
if (is_array($pkginfo['release_deps'])) {
foreach($pkginfo['release_deps'] as $dep) {