function form_submiter() { $submitreturn = ""; $packagecodename = $this->instanceVar->varpost("codename"); $this->includer->include_pratikclass("Package"); $instancePackage = new PratikPackage($this->initer); if ($this->instanceVar->varpost("deploysubmit")) { $instancePackage->deploy($packagecodename); $this->instanceMessage->set_message($this->instanceLang->getTranslation("Deploiement effectue")); if ($this->includer->include_pratikclass("Form")) { $instanceForm = new PratikForm($this->initer); $submitreturn .= $instanceForm->redirectAfterSubmiter(); } } else { if ($this->instanceVar->varpost("destroysubmit")) { $instancePackage->destroy($packagecodename); $this->instanceMessage->set_message($this->instanceLang->getTranslation("Destruction effectuee")); if ($this->includer->include_pratikclass("Form")) { $instanceForm = new PratikForm($this->initer); $submitreturn .= $instanceForm->redirectAfterSubmiter(); } } else { if ($this->instanceVar->varpost("updatesubmit")) { $instancePackage->update($packagecodename); $this->instanceMessage->set_message($this->instanceLang->getTranslation("Mise a jour effectuee")); if ($this->includer->include_pratikclass("Form")) { $instanceForm = new PratikForm($this->initer); $submitreturn .= $instanceForm->redirectAfterSubmiter(); } } else { if ($this->instanceVar->varpost("checkupdatesubmit")) { $tabpackages = $this->data_loader(); foreach ($tabpackages as $packagecour) { $packagecodename = $packagecour['nomcodepackage']; $toupdate = 0; if ($instancePackage->checkUpdate($packagecodename)) { $toupdate = 1; } $this->db->query("update `package` set toupdate='" . $toupdate . "' where nomcodepackage='" . $packagecodename . "'"); } $this->instanceMessage->set_message($this->instanceLang->getTranslation("Les dernieres mises a jours disponibles sont visibles")); if ($this->includer->include_pratikclass("Form")) { $instanceForm = new PratikForm($this->initer); $submitreturn .= $instanceForm->redirectAfterSubmiter(); } } } } } return $submitreturn; }
$tabdeployedfiles = array(); //SET INITER $initer = array(); $initer['conf'] = array(); $initer['db'] = null; $initer['log'] = null; //RECONSTRUCT INITER $initer = $instanceDeploy->initerConstruct($initer); //INIT PACKAGER $instancePackage = new PratikPackage($initer); //SET CONFLICT MODE $instancePackage->setConflictResolution($instanceDeploy->conflictresolution); //RELOAD INITER IN INSTANCE PACKAGE $instancePackage->reloadIniter($initer); //DEPLOY PACKAGE $tabdeployedfiles[] = $instancePackage->deploy($packagename); //CHECKLIST RESULT OF DEPLOYMENT OF THE PACKAGE $checklist[] = $packagename; $checklisttexte = "<br />"; $checklisttexte .= "<div>New package deployment :</div>"; $cptchecklist = 0; foreach ($checklist as $checkpackage) { $checklisttexte .= "<div> - " . $checkpackage . "</div>"; if ($tabdeployedfiles[$cptchecklist]) { foreach ($tabdeployedfiles[$cptchecklist] as $deployedfile) { $checklisttexte .= "<div> --- " . $deployedfile . "</div>"; } } $cptchecklist++; } $checklisttexte .= "<br />";