Revision 04000d32
Added by Colin Smith about 20 years ago
usr/local/www/pkg_mgr_install.php | ||
---|---|---|
139 | 139 |
* Loop through installed packages and if name matches |
140 | 140 |
* push the package id onto array to reinstall |
141 | 141 |
*/ |
142 |
$instpkgs = array(); |
|
142 | 143 |
$output_static = ""; |
143 | 144 |
$counter = 0; |
144 | 145 |
if(is_array($pkg_config['packages']['package'])) |
145 |
foreach($pkg_config['packages']['package'] as $available_package) { |
|
146 |
if(is_array($config['installedpackages']['package'])) |
|
147 |
foreach($config['installedpackages']['package'] as $package) { |
|
148 |
if($package['name'] == $available_package['name']) { |
|
149 |
array_push($packages_to_install, $counter); |
|
150 |
$output_static .= "Adding " . $package['name'] . " to installation array.\n"; |
|
151 |
update_output_window($output_static); |
|
152 |
fwrite($fd_log, "Adding (" . $counter . ") " . $package['name'] . " to package installation array.\n" . $status); |
|
153 |
} |
|
154 |
} |
|
155 |
$counter++; |
|
146 |
if(!is_string($instpkgs[0])) foreach($config['installedpackages']['package'] as $index => $instpkg) $instpkgs[] = $instpkg['name']; |
|
147 |
foreach($pkg_config['packages']['package'] as $index => $available_package) { |
|
148 |
if(in_array($available_package['name'], $instpkgs)) { |
|
149 |
$packages_to_install[] = $index; |
|
150 |
$output_static .= "Adding " . $package['name'] . " to installation array.\n"; |
|
151 |
update_output_window($output_static); |
|
152 |
fwrite($fd_log, "Adding (" . $counter . ") " . $package['name'] . " to package installation array.\n" . $status); |
|
153 |
} |
|
156 | 154 |
} |
157 | 155 |
} else { |
158 | 156 |
/* |
159 | 157 |
* Push the desired package id onto the install packages array |
160 | 158 |
*/ |
161 | 159 |
fwrite($fd_log, "Single package installation started.\n"); |
162 |
array_push($packages_to_install, $_GET['id']);
|
|
160 |
$packages_to_install[] = $_GET['id'];
|
|
163 | 161 |
} |
164 | 162 |
|
165 | 163 |
/* |
Also available in: Unified diff
Clean up full reinstall code.