/** * Check if all the dependent patches have been installed. * @access private * @return true if all the dependent patches have been installed * false if any dependent patch has not been installed. * @author Cindy Qi Li */ function checkDependentPatches() { global $msg; $dependent_patches_installed = true; // if no dependent patch defined, return true if (!is_array($this->patch_summary_array["dependent_patches"])) { return true; } foreach ($this->patch_summary_array["dependent_patches"] as $num => $dependent_patch) { if (!is_patch_installed($dependent_patch)) { $dependent_patches_installed = false; $dependent_patches .= $dependent_patch . ", "; } } if (!$dependent_patches_installed) { $errors = array('UPDATE_DEPENDENCY', substr($dependent_patches, 0, -2)); $msg->addError($errors); return false; } return true; }
require_once 'classes/PatchParser.class.php'; require_once 'classes/Patch.class.php'; $patchParser = new PatchParser(); $patchParser->parse($patch_xml); $patch_array = $patchParser->getParsedArray(); if ($_POST["ignore_version"]) { $patch_array["applied_version"] = VERSION; } if ($_POST["install_upload"]) { $current_patch_list = array('system_patch_id' => $patch_array['system_patch_id'], 'applied_version' => $patch_array['applied_version'], 'patch_folder' => $patchURL, 'available_to' => 'private', 'author' => $patch_array['author'], 'sql' => $patch_array['sql'], 'description' => $patch_array['description'], 'dependent_patches' => $patch_array['dependent_patches']); } if ($_POST["install"]) { $current_patch_list = $patch_list_array[$id]; $current_patch_list["sql"] = $patch_array["sql"]; } if ($_POST["install_upload"] && is_patch_installed($patch_array["system_patch_id"])) { $msg->addError('UPDATE_ALREADY_INSTALLED'); } else { $patch = new Patch($patch_array, $current_patch_list, $skipFilesModified, $patchURL); if ($patch->applyPatch()) { $patch_id = $patch->getPatchID(); } } } } } // end of patch installation // display permission and backup files message if (isset($_REQUEST['patch_id'])) { $patch_id = $_REQUEST['patch_id']; } elseif ($_POST['patch_id']) {
if (is_array($this->patches_in_db)) { foreach ($this->patches_in_db as $row) { print_patch_row($row, $row['patches_id'], false); } } $array_id = 0; // display un-installed patches if (is_array($this->patch_list_array)) { foreach ($this->patch_list_array as $row_num => $new_patch) { if (!is_patch_installed($new_patch['system_patch_id'])) { $dependent_patches_installed = true; $dependent_patches = ""; // check if the dependent patches are installed if (is_array($new_patch["dependent_patches"])) { foreach ($new_patch["dependent_patches"] as $num => $dependent_patch) { if (!is_patch_installed($dependent_patch)) { $dependent_patches_installed = false; $dependent_patches .= $dependent_patch . ", "; } } // remove the last comma in the string if ($dependent_patches != "") { $dependent_patches = substr($dependent_patches, 0, -2); } } // display patch row if ($dependent_patches_installed) { print_patch_row($new_patch, $array_id++, true); } else { print_patch_row($new_patch, $array_id++, false); $dependent_patches_installed = true;
require_once AC_INCLUDE_PATH . 'classes/Updater/PatchParser.class.php'; require_once AC_INCLUDE_PATH . 'classes/Updater/Patch.class.php'; $patchParser = new PatchParser(); $patchParser->parse($patch_xml); $patch_array = $patchParser->getParsedArray(); if ($_POST["ignore_version"]) { $patch_array["applied_version"] = VERSION; } if ($_POST["install_upload"]) { $current_patch_list = array('achecker_patch_id' => $patch_array['achecker_patch_id'], 'applied_version' => $patch_array['applied_version'], 'patch_folder' => $patchURL, 'available_to' => 'private', 'author' => $patch_array['author'], 'sql' => $patch_array['sql'], 'description' => $patch_array['description'], 'dependent_patches' => $patch_array['dependent_patches']); } if ($_POST["install"]) { $current_patch_list = $patch_list_array[$id]; $current_patch_list["sql"] = $patch_array["sql"]; } if ($_POST["install_upload"] && is_patch_installed($patch_array["achecker_patch_id"])) { $msg->addError('UPDATE_ALREADY_INSTALLED'); } else { $patch = new Patch($patch_array, $current_patch_list, $skipFilesModified, $patchURL); if ($patch->applyPatch()) { $patch_id = $patch->getPatchID(); } } } } } // end of patch installation // display permission and backup files message if (isset($_REQUEST['patch_id'])) { $patch_id = $_REQUEST['patch_id']; } elseif ($_POST['patch_id']) {