diff --git a/pear/PEAR/Dependency.php b/pear/PEAR/Dependency.php index c6af633f662..76327df0eff 100644 --- a/pear/PEAR/Dependency.php +++ b/pear/PEAR/Dependency.php @@ -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"; } diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index 6f536c31e17..95e679c6891 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -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) {