Example #1
0
        include $formDir . "/" . $formFile;
        $formName = basename($formFile, ".php");
        $form = new $formName();
        foreach ($form->formList as $keyFormItem => $valueFormItem) {
            $formLabelList[$keyFormItem . "Label"] = "";
        }
        foreach ($form->stepTitle as $keyFormStep => $valueFormStep) {
            $formLabelList[$valueFormStep . "Step"] = $valueFormStep;
        }
    }
    return $formLabelList;
}
/* Merge routing */
foreach ($routingList as $keyRoute => $valRoute) {
    $msgKey = $keyRoute . "Route";
    // si la route n'est pas referencer dans le fichier de msg alors on l'ajoute sinon rien.
    if (!array_key_exists($msgKey, $msgList)) {
        $msgList[$msgKey] = "";
        $new++;
    }
}
/* Merge form */
foreach ($formLabelList as $keyForm => $valForm) {
    // si l'item du form n'est pas referencer dans le fichier de msg alors on l'ajoute sinon rien.
    if (!array_key_exists($keyForm, $msgList)) {
        $msgList[$keyForm] = "";
        $new++;
    }
}
setMsg($app, $msgList);
$r = array('infotype' => "success", 'msg' => "ok", 'data' => $msgList);
Example #2
0
        if (isValidUser()) {
            exec(SCRIPT_PATH_STATUS . ' 2>&1', $execResult);
            if (!empty($execResult)) {
                $execResult = implode("\n", $execResult);
                setMsg('execResult', $execResult);
            }
        }
        header('Location: ' . SELF_URL);
        exit;
        break;
    case 'log':
        if (isValidUser()) {
            exec('echo "$(git log -1 --format=medium)" 2>&1', $execResult);
            if (!empty($execResult)) {
                $execResult = "Latest commit deployed in this server:\n\n" . implode("\n", $execResult);
                setMsg('execResult', $execResult);
            }
        }
        header('Location: ' . SELF_URL);
        exit;
        break;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Deploy to <?php 
echo $_SERVER['SERVER_NAME'];
?>
</title>