Introduce artificial optional dependency recursion for the installation test and...
authorGunnar Wrobel <p@rdus.de>
Fri, 22 Oct 2010 22:02:33 +0000 (00:02 +0200)
committerGunnar Wrobel <p@rdus.de>
Fri, 22 Oct 2010 22:02:33 +0000 (00:02 +0200)
components/lib/Components/Helper/Tree/Element.php
components/test/Components/fixture/framework/Dependency/package.xml

index 5594f75..4013ad9 100644 (file)
@@ -80,12 +80,17 @@ class Components_Helper_Tree_Element
     /**
      * Install the tree of packages into the environment.
      *
-     * @param Components_Helper_InstallationRun $run The current installation run.
+     * @param Components_Helper_InstallationRun $run     The current installation run.
+     * @param array                             $visited The packages already visited.
      *
      * @return NULL
      */
-    public function installInTree(Components_Helper_InstallationRun $run)
+    public function installInTree(Components_Helper_InstallationRun $run, array $visited = array())
     {
+        if (in_array($this->_package_file, $visited)) {
+            return;
+        }
+        $visited[] = $this->_package_file;
         $run->installChannelsOnce($this->_package->listAllRequiredChannels());
         foreach ($this->_package->listAllExternalDependencies() as $dependency) {
             $run->installExternalPackageOnce(
@@ -97,7 +102,7 @@ class Components_Helper_Tree_Element
                 $this->_package->listAllHordeDependencies()
             ) as $child
         ) {
-            $child->installInTree($run);
+            $child->installInTree($run, $visited);
         }
         $run->installHordePackageOnce($this->_package_file);
     }
index 59c2f77..0cf1e60 100644 (file)
     <channel>pear.php.net</channel>
    </package>
   </required>
+  <optional>
+   <package>
+    <name>Install</name>
+    <channel>pear.horde.org</channel>
+   </package>
+  </optional>
  </dependencies>
  <phprelease>
   <filelist>