Fix php 8 related errors in the install, moving the version-informations into a single file

This commit is contained in:
basteyy 2021-01-17 15:48:43 +01:00
parent 5abddff1aa
commit 0f372f085a
5 changed files with 23 additions and 7 deletions

View file

@ -79,7 +79,7 @@ class dbJSON {
if (file_put_contents($this->file, $data, LOCK_EX)) {
return true;
} else {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.', LOG_TYPE_ERROR);
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.', \LOG_TYPE_ERROR);
return false;
}
}

View file

@ -1,10 +1,5 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// Bludit version
define('BLUDIT_VERSION', '3.13.1');
define('BLUDIT_CODENAME', 'Edi');
define('BLUDIT_RELEASE_DATE', '2020-07-28');
define('BLUDIT_BUILD', '20200728');
// Debug mode
// Change to FALSE, for prevent warning or errors on browser

View file

@ -5,6 +5,9 @@
If you are going to do some changes is recommended do it before the installation
*/
// Including the version informations from version.php
require_once PATH_KERNEL . 'boot' . DS . 'version.php';
// Log
define('LOG_SEP', ' | ');
define('LOG_TYPE_INFO', '[INFO]');

View file

@ -0,0 +1,7 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// Bludit version
define('BLUDIT_VERSION', '3.13.1');
define('BLUDIT_CODENAME', 'Edi');
define('BLUDIT_RELEASE_DATE', '2020-07-28');
define('BLUDIT_BUILD', '20200728');

View file

@ -67,6 +67,17 @@ define('FILENAME', 'index.txt');
// Domain and protocol
define('DOMAIN', $_SERVER['HTTP_HOST']);
// Log Variables
define('LOG_TYPE_INFO', '[INFO]');
define('LOG_TYPE_WARN', '[WARN]');
define('LOG_TYPE_ERROR', '[ERROR]');
define('DEBUG_MODE', TRUE);
define('DEBUG_TYPE', 'INFO'); // INFO, TRACE
// Including the version informations from version.php
require_once PATH_KERNEL . 'boot' . DS . 'version.php';
if (!empty($_SERVER['HTTPS'])) {
define('PROTOCOL', 'https://');
} else {
@ -181,7 +192,7 @@ function getLanguageList() {
$tmp = array();
foreach ($files as $file) {
$t = new dbJSON($file, false);
$native = $t->db['language-data']['native'];
$native = $t->db['language-data']['native'] ?? false;
$locale = basename($file, '.json');
$tmp[$locale] = $native;
}