break; } } if ($req_ok) { // see if we're not blocked by some module for ($k = 0; isset($p->install[$install_index]['blockedby'][$k]); ++$k) { $blockedby = $p->install[$install_index]['blockedby'][$k]; if (isset($mcodes[$blockedby['id']]) && (!isset($blockedby['version']) && !isset($blockedby['min-version']) && !isset($blockedby['max-version']) || isset($blockedby['version']) && (double) $mcodes[$blockedby['id']] == (double) $blockedby['version'] || isset($blockedby['min-version']) && (double) $mcodes[$blockedby['id']] > $blockedby['min-version'] || isset($blockedby['max-version']) && (double) $mcodes[$blockedby['id']] < $blockedby['max-version'])) { $req_ok = false; break; } } } if ($req_ok) { // if all requirements of this install are satisfied.... if (($changes = $p->dry_run($install_index)) !== false) { // ...test to see if we can install the package // $changes holds most of the files that will be changed // "most" because can't read the changes made by 'php' or 'extract' commands // in future it would be nice to list the files before install if (isset($_GET['show_changes'])) { function slash_count($a, $b) { $ca = substr_count($a, '/'); $cb = substr_count($b, '/'); if ($ca == $cb) { return strcmp($a, $b); } return $ca < $cb ? -1 : 1; } usort($changes, 'slash_count');