]> granicus.if.org Git - php/commitdiff
Make the dependencies check look for the correct registry file
authorTomas V.V.Cox <cox@php.net>
Tue, 9 Apr 2002 14:12:12 +0000 (14:12 +0000)
committerTomas V.V.Cox <cox@php.net>
Tue, 9 Apr 2002 14:12:12 +0000 (14:12 +0000)
pear/PEAR/Dependency.php
pear/PEAR/Installer.php

index c6af633f662b506fa322921e9f03254f707a24a4..76327df0effe3d128a4abad89bcf76b23b63cf78 100644 (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";
         }
index 6f536c31e174475a8378f930631bc14a57e00942..95e679c6891e80ec7fbf5d7f1107391a744336e7 100644 (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) {