Example #1
0
                        <p><?php 
            echo $trans->trans('Thelia as been successfully updated to version %version', ['%version' => $update->getCurrentVersion()]);
            ?>
</p>
                    </div>

                    <?php 
            if ($update->hasPostInstructions()) {
                ?>
                    <div class="alert alert-info">
                        <h2><?php 
                echo $trans->trans("Post update instructions");
                ?>
</h2>
                        <?php 
                echo $update->getPostInstructions('html');
                ?>
                    </div>
                    <?php 
            }
            ?>

                    <p class="lead text-center">
                        <a href="<?php 
            echo $website_url;
            ?>
/index.php/admin"
                           id="admin_url"><?php 
            echo $trans->trans('Go to back office');
            ?>
</a>
Example #2
0
            echo sprintf(PHP_EOL . 'Your database has been backed up. The sql file : %s' . PHP_EOL, $update->getBackupFile());
        } catch (\Exception $e) {
            echo PHP_EOL . 'Sorry, your database can\'t be backed up. Reason : ' . $e->getMessage() . PHP_EOL;
            exit(4);
        }
    }
    // update
    $update->process($backup);
} catch (UpdateException $ex) {
    $updateError = $ex;
}
if (null === $updateError) {
    echo sprintf(PHP_EOL . 'Thelia as been successfully updated to version %s' . PHP_EOL, $update->getCurrentVersion());
    if ($update->hasPostInstructions()) {
        echo PHP_EOL . '===================================' . PHP_EOL;
        echo $update->getPostInstructions();
        echo PHP_EOL . '===================================' . PHP_EOL;
    }
} else {
    echo sprintf(PHP_EOL . 'Sorry, an unexpected error has occured : %s' . PHP_EOL, $updateError->getMessage());
    print $updateError->getTraceAsString() . PHP_EOL;
    print "Trace: " . PHP_EOL;
    foreach ($update->getLogs() as $log) {
        echo sprintf('[%s] %s' . PHP_EOL, $log[0], $log[1]);
    }
    if (true === $backup) {
        while (1) {
            echo "Would you like to restore the backup database ? (Y/n)" . PHP_EOL;
            $rep = readStdin(true);
            if ($rep == 'y') {
                echo "Database restore started. Wait, it could take a while..." . PHP_EOL;
Example #3
0
            exit(4);
        }
    }
    // update
    $update->process($backup);
} catch (UpdateException $ex) {
    $updateError = $ex;
}
foreach ($update->getMessages() as $message) {
    cliOutput($message[0], $message[1]);
}
if (null === $updateError) {
    cliOutput(sprintf('Thelia as been successfully updated to version %s', $update->getCurrentVersion()), 'success');
    if ($update->hasPostInstructions()) {
        cliOutput('===================================');
        cliOutput($update->getPostInstructions());
        cliOutput('===================================');
    }
} else {
    cliOutput(sprintf('Sorry, an unexpected error has occured : %s', $updateError->getMessage()), 'error');
    print $updateError->getTraceAsString() . PHP_EOL;
    print "Trace: " . PHP_EOL;
    foreach ($update->getLogs() as $log) {
        cliOutput(sprintf('[%s] %s' . PHP_EOL, $log[0], $log[1]), 'error');
    }
    if (true === $backup) {
        while (1) {
            cliOutput("Would you like to restore the backup database ? (Y/n)");
            $rep = readStdin(true);
            if ($rep == 'y') {
                cliOutput("Database restore started. Wait, it could take a while...");