Example #1
0
    $_SESSION['install']['lang'] = "en_US";
}
$trans = new Translator($_SESSION['install']['lang']);
$trans->addLoader("php", new Symfony\Component\Translation\Loader\PhpFileLoader());
$trans->addResource('php', __DIR__ . '/I18n/' . $_SESSION['install']['lang'] . '.php', $_SESSION['install']['lang']);
if (!isset($context)) {
    $context = 'install';
}
// Check if we store is already configured and if we have to switch on an update process
if ($context == "install" && $step == 1) {
    try {
        $checkPermission = new \Thelia\Install\CheckPermission(true, $trans);
        $isValid = $checkPermission->exec();
        $validationMessage = $checkPermission->getValidationMessages();
    } catch (\Thelia\Install\Exception\AlreadyInstallException $ex) {
        $update = new \Thelia\Install\Update(false);
        if (!$update->isLatestVersion()) {
            $updateLocation = str_replace('/index.php', '', $_SERVER["REQUEST_URI"]) . '/update.php';
            header("Location: " . $updateLocation);
            die;
        }
    }
}
?>
<!DOCTYPE html>
<html lang="">
<head>
    <title><?php 
if ($context == "install") {
    echo $trans->trans('Installation');
} else {
Example #2
0
        </a>
        <span>&nbsp;<strong>|</strong>&nbsp;</span>
        <a href="?lang=de_DE">
            Deutsch
        </a>
    </div>
    <br />

    <p class="lead text-center">
        <?php 
echo $trans->trans('Welcome in the Thelia updater wizard.');
?>
    </p>

    <?php 
$update = new \Thelia\Install\Update(false);
if ($update->isLatestVersion()) {
    ?>

        <div class="alert alert-warning">
            <p><?php 
    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 
Example #3
0
// Retrieve the website url
$url = $_SERVER['PHP_SELF'];
$website_url = preg_replace("#/install/[a-z](.*)#", '', $url);
$backup = isset($_GET['backup']) && $_GET['backup'] == 1;
$updateError = null;
?>
    <div class="well">

        <p class="lead text-center">
            <?php 
echo $trans->trans('Updating Thelia.');
?>
        </p>

        <?php 
$update = new \Thelia\Install\Update(false);
if ($update->isLatestVersion()) {
    ?>

            <div class="alert alert-warning">
                <p><?php 
    echo $trans->trans('It seems that Thelia database is already up to date.');
    ?>
</p>
            </div>

        <?php 
} else {
    $continue = true;
    // Backup
    if ($backup) {
Example #4
0
        echo "No autoload file found. Please use the -b argument to include yours";
        exit(1);
    }
}
if (php_sapi_name() != 'cli') {
    echo 'this script can only be launched with cli sapi' . PHP_EOL;
    exit(1);
}
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
use Thelia\Install\Exception\UpdateException;
/***************************************************
 * Load Update class
 ***************************************************/
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);
Example #5
0
        cliOutput('No autoload file found. Please use the -b argument to include yours', 'error');
        exit(1);
    }
}
if (php_sapi_name() != 'cli') {
    cliOutput('this script can only be launched with cli sapi', 'error');
    exit(1);
}
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
use Thelia\Install\Exception\UpdateException;
/***************************************************
 * Load Update class
 ***************************************************/
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) {