PEAR_Downloader::_detectDepCycle PHP Method

_detectDepCycle() public method

Detect recursive links between dependencies and break the cycles
public _detectDepCycle ( &$deplinks )
    function _detectDepCycle(&$deplinks)
    {
        do {
            $keepgoing = false;
            foreach ($deplinks as $dep => $parents) {
                foreach ($parents as $parent => $unused) {
                    // reset the parent cycle detector
                    $this->_testCycle(null, null, null);
                    if ($this->_testCycle($dep, $deplinks, $parent)) {
                        $keepgoing = true;
                        unset($deplinks[$dep][$parent]);
                        if (count($deplinks[$dep]) == 0) {
                            unset($deplinks[$dep]);
                        }
                        continue 3;
                    }
                }
            }
        } while ($keepgoing);
    }