]> git.agnieray.net Git - galette.git/blobdiff - galette/includes/galette.inc.php
Bump version
[galette.git] / galette / includes / galette.inc.php
index a31bf6b2467456373374af2b90411363e4cc7f8d..68f681170f01332d47f5084eaef7023af3894c54 100644 (file)
@@ -7,7 +7,7 @@
  *
  * PHP version 5
  *
- * Copyright © 2009-2021 The Galette Team
+ * Copyright © 2009-2023 The Galette Team
  *
  * This file is part of Galette (http://galette.tuxfamily.org).
  *
@@ -28,7 +28,7 @@
  * @package   Galette
  *
  * @author    Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2007-2021 The Galette Team
+ * @copyright 2007-2023 The Galette Team
  * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
  * @link      http://galette.tuxfamily.org
  * @since     Available since 0.7-dev - 2007-10-07
@@ -68,17 +68,20 @@ $installed = file_exists(GALETTE_CONFIG_PATH . 'config.inc.php');
 if (!$installed && !$installer) {
     header('location: ./installer.php');
     die();
-} else if ($installed) {
-    include_once GALETTE_CONFIG_PATH . 'config.inc.php';
 }
 
 if (
     file_exists(GALETTE_CONFIG_PATH . 'behavior.inc.php')
-    && !defined('GALETTE_TESTS') && !$cron
+    && !defined('GALETTE_TESTS')
 ) {
     include_once GALETTE_CONFIG_PATH . 'behavior.inc.php';
 }
 
+if (isset($installer) && $installer !== true) {
+    //If we're not working from installer
+    include_once GALETTE_CONFIG_PATH . 'config.inc.php';
+}
+
 use Analog\Analog;
 use Analog\Handler;
 use Analog\Handler\LevelName;
@@ -97,15 +100,15 @@ if (
 }
 
 define('GALETTE_NIGHTLY', false);
-define('GALETTE_VERSION', 'v0.9.5.2');
+define('GALETTE_VERSION', 'v1.0.0');
 
 //Version to display
 if (!defined('GALETTE_HIDE_VERSION')) {
     define('GALETTE_DISPLAY_VERSION', \Galette\Core\Galette::gitVersion(false));
 }
 
-define('GALETTE_COMPAT_VERSION', '0.9.5');
-define('GALETTE_DB_VERSION', '0.950');
+define('GALETTE_COMPAT_VERSION', '1.0.0');
+define('GALETTE_DB_VERSION', '0.960');
 if (!defined('GALETTE_MODE')) {
     define('GALETTE_MODE', \Galette\Core\Galette::MODE_PROD);
 }
@@ -121,13 +124,6 @@ if (!isset($_COOKIE['show_galette_dashboard'])) {
     );
 }
 
-if (!defined('GALETTE_DISPLAY_ERRORS')) {
-    if (GALETTE_MODE === \Galette\Core\Galette::MODE_DEV) {
-        define('GALETTE_DISPLAY_ERRORS', 1);
-    } else {
-        define('GALETTE_DISPLAY_ERRORS', 0);
-    }
-}
 ini_set('display_errors', (defined('GALETTE_TESTS') ? '1' : '0'));
 
 /*------------------------------------------------------------------------------
@@ -146,7 +142,7 @@ Analog::$format = "%s - %s - %s - %s\n";
 $galette_run_log = null;
 
 if (!defined('GALETTE_LOG_LVL')) {
-    if (GALETTE_MODE === 'DEV') {
+    if (\Galette\Core\Galette::isDebugEnabled()) {
         define('GALETTE_LOG_LVL', Analog::DEBUG);
     } elseif (defined('GALETTE_TESTS')) {
         define('GALETTE_LOG_LVL', Analog::NOTICE);
@@ -181,8 +177,9 @@ Analog::handler($galette_run_log);
 
 require_once GALETTE_ROOT . 'includes/functions.inc.php';
 
-//If we're not working from tests
-if ($installed && !defined('GALETTE_TESTS')) {
+if (!$installer and !defined('GALETTE_TESTS')) {
+    //If we're not working from installer nor from tests
+    include_once GALETTE_CONFIG_PATH . 'config.inc.php';
 
     /**
      * Database instantiation
@@ -204,13 +201,6 @@ if ($installed && !defined('GALETTE_TESTS')) {
             GALETTE_THEMES_PATH . $preferences->pref_theme . '/'
         );
 
-        if (!defined('GALETTE_TPL_SUBDIR')) {
-            define(
-                'GALETTE_TPL_SUBDIR',
-                'templates/' . $preferences->pref_theme . '/'
-            );
-        }
-
         if (!defined('GALETTE_THEME')) {
             define(
                 'GALETTE_THEME',