Exemple #1
0
 ***************************************************/
try {
    $update = new \Thelia\Install\Update(false);
} catch (UpdateException $ex) {
    echo $ex->getMessage() . PHP_EOL;
    exit(2);
}
/***************************************************
 * Check if update is needed
 ***************************************************/
if ($update->isLatestVersion()) {
    echo "You already have the latest version of Thelia : " . $update->getCurrentVersion() . PHP_EOL;
    exit(3);
}
while (1) {
    echo sprintf("You are going to update Thelia from version %s to version %s." . PHP_EOL, $update->getCurrentVersion(), $update->getLatestVersion());
    echo "Continue update process ? (Y/n)" . PHP_EOL;
    $rep = readStdin(true);
    if ($rep == 'y') {
        break;
    } elseif ($rep == 'n') {
        echo "Update aborted" . PHP_EOL;
        exit(0);
    }
}
$backup = false;
while (1) {
    echo sprintf("Would you like to backup the current database before proceeding ? (Y/n)" . PHP_EOL);
    $rep = readStdin(true);
    if ($rep == 'y') {
        $backup = true;
Exemple #2
0
    echo $trans->trans('It seems that Thelia database is already up to date.');
    ?>
</p>
            <p><em><?php 
    echo $trans->trans('For the moment, the wizard allows only an update of the database. To update your php files you must proceed manually.');
    ?>
</em></p>
        </div>

    <?php 
} else {
    ?>

        <div class="alert alert-info">
            <p><?php 
    echo $trans->trans('Would you like to update your installation of Thelia from version <strong>%current</strong> to version <strong>%latest</strong>.', ['%current' => $update->getCurrentVersion(), '%latest' => $update->getLatestVersion()]);
    ?>
</p>
        </div>

        <div class="alert alert-warning">
            <p><?php 
    echo $trans->trans('It\'s strongly recommended to make a backup before proceeding.');
    ?>
</p>
        </div>

    <?php 
}
?>
Exemple #3
0
 ***************************************************/
try {
    $update = new \Thelia\Install\Update(false);
} catch (UpdateException $ex) {
    cliOutput($ex->getMessage(), 'error');
    exit(2);
}
/***************************************************
 * Check if update is needed
 ***************************************************/
if ($update->isLatestVersion()) {
    cliOutput("You already have the latest version of Thelia : " . $update->getCurrentVersion(), 'success');
    exit(3);
}
$current = $update->getCurrentVersion();
$files = $update->getLatestVersion();
$web = $update->getWebVersion();
while (1) {
    if ($web !== null && $files != $web) {
        cliOutput(sprintf("Thelia server is reporting the current stable release version is %s ", $web), 'warning');
    }
    cliOutput(sprintf("You are going to update Thelia from version %s to version %s.", $current, $files), 'info');
    if ($web !== null && $files < $web) {
        cliOutput(sprintf("Your files belongs to version %s, which is not the latest stable release.", $files), 'warning');
        cliOutput(sprintf("It is recommended to upgrade your files first then run this script again." . PHP_EOL . "The latest version is available at http://thelia.net/#download ."), 'warning');
        cliOutput("Continue update process anyway ? (Y/n)");
    } else {
        cliOutput("Continue update process ? (Y/n)");
    }
    $rep = readStdin(true);
    if ($rep == 'y') {