]> git.agnieray.net Git - galette.git/commitdiff
Load deps from installer
authorJohan Cwiklinski <jcwiklinski@teclib.com>
Sat, 21 Jul 2018 13:07:38 +0000 (15:07 +0200)
committerJohan Cwiklinski <jcwiklinski@teclib.com>
Sat, 21 Jul 2018 13:07:38 +0000 (15:07 +0200)
galette/includes/dependencies.php
galette/includes/main.inc.php
galette/webroot/installer.php

index d52c228b7459b46a8dfd07655cb9da279c59b44a..9eb50cf60582f9c81ff94d6cbbaae0dc196fdeb4 100644 (file)
@@ -443,14 +443,18 @@ $container['translator'] = function ($c) {
     }
 
     $translator->setLocale($c->get('i18n')->getLongID());
-    $translator->setCache($c->get('cache'));
+    if (!isset($container['mode']) || $c->get('mode') !== 'INSTALL' && $c->get('mode') !== 'NEED_UPDATE') {
+        $translator->setCache($c->get('cache'));
+    }
     return $translator;
 };
 
 //For bad existing globals can be used...
-$hist = $container['history'];
-$login = $container['login'];
-$zdb = $container['zdb'];
+if (!isset($container['mode']) || $container['mode'] !== 'INSTALL' && $container['mode'] !== 'NEED_UPDATE') {
+    $hist = $container['history'];
+    $login = $container['login'];
+    $zdb = $container['zdb'];
+}
 $i18n = $container['i18n'];
 $translator = $container['translator'];
 
index 81dd6ef7b2ac796cd8f9ef684bda64d3ff89df38..16c54fff63379adde1e4dc3c52506e3585c87e8f 100644 (file)
@@ -70,8 +70,7 @@ if ($needs_update) {
         'themes/default/'
     );
 
-    $i18n = new Galette\Core\I18n();
-    require_once __DIR__ . '/i18n.inc.php';
+    require_once '../includes/dependencies.php';
 
     $app->add(
         new Galette\Core\Middleware(
index 5bb420c52b93d47b567460f5c81e01309db13c10..3c3e142f432bde0e2feb82f06c7e3f0502d396ab 100644 (file)
@@ -53,21 +53,17 @@ session_start();
 $session_name = 'galette_install_' . str_replace('.', '_', GALETTE_VERSION);
 $session = &$_SESSION['galette'][$session_name];
 
-if (isset($session['lang'])) {
-    $i18n = unserialize($session['lang']);
-    if (!$i18n->getId()) {
-        $i18n = new Galette\Core\I18n();
-    }
-} else {
-    $i18n = new Galette\Core\I18n();
-}
+$app = new \Slim\App(
+    array(
+        'templates.path'    => GALETTE_ROOT . 'templates/default/',
+        'mode'              => 'INSTALL'
+    )
+);
+require_once '../includes/dependencies.php';
 
 if (isset($_GET['pref_lang'])) {
     $i18n->changeLanguage($_GET['pref_lang']);
 }
-$session['lang'] = serialize($i18n);
-
-require_once '../includes/i18n.inc.php';
 
 if (isset($_POST['abort_btn'])) {
     if (isset($session[md5(GALETTE_ROOT)])) {