From 70b845ca5898b1ee577123853a83fda57b321f31 Mon Sep 17 00:00:00 2001 From: Ortwin Pinke Date: Tue, 30 May 2023 10:51:44 +0200 Subject: [PATCH] fixes setup php 8.2 'new installation' --- .idea/phpunit.xml | 1 + conlite/classes/class.genericdb.php | 14 ++++++++----- conlite/classes/con2con/class.registry.php | 2 +- setup/lib/startup.php | 23 ++++++++++++++++------ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml index 6f5a4c4..d1055f5 100644 --- a/.idea/phpunit.xml +++ b/.idea/phpunit.xml @@ -6,6 +6,7 @@ diff --git a/conlite/classes/class.genericdb.php b/conlite/classes/class.genericdb.php index a3a070e..b206623 100644 --- a/conlite/classes/class.genericdb.php +++ b/conlite/classes/class.genericdb.php @@ -18,16 +18,20 @@ if (!defined('CON_FRAMEWORK')) { global $cfg; // Try to load GenericDB database driver -$driver_filename = $cfg['path']['contenido'] . $cfg['path']['classes'] . 'drivers/' . $cfg['sql']['gdb_driver'] . '/class.gdb.' . $cfg['sql']['gdb_driver'] . '.php'; +$driver_filename = cRegistry::getBackendPath() + . cRegistry::getConfigValue('path', 'classes') + . 'drivers' + . DIRECTORY_SEPARATOR + . cRegistry::getConfigValue('sql', 'gdb_driver') + . DIRECTORY_SEPARATOR + . 'class.gdb.' + . cRegistry::getConfigValue('sql', 'gdb_driver') + . '.php'; if (file_exists($driver_filename)) { include_once($driver_filename); } -// load all genericdb classes -cInclude("classes", "genericdb/class.item.base.abstract.php"); -cInclude("classes", "genericdb/class.item.cache.php"); - /** * Class Contenido_ItemException. * @author Murat Purc diff --git a/conlite/classes/con2con/class.registry.php b/conlite/classes/con2con/class.registry.php index 4125956..5badca4 100644 --- a/conlite/classes/con2con/class.registry.php +++ b/conlite/classes/con2con/class.registry.php @@ -32,7 +32,7 @@ class cRegistry { */ public static function getBackendPath() { $cfg = self::getConfig(); - return $cfg['path']['contenido']; + return $cfg['path']['conlite']; } /** diff --git a/setup/lib/startup.php b/setup/lib/startup.php index 7fa2495..c740891 100644 --- a/setup/lib/startup.php +++ b/setup/lib/startup.php @@ -23,6 +23,14 @@ define('CON_BE_PATH', '../conlite/'); session_start(); require_once 'lib/defines.php'; +/* + * SetEnv CL_VERSION + */ +if (!defined('CL_VERSION')) { + + define('CL_VERSION', C_SETUP_VERSION); + +} // uncomment this lines during development if needed error_reporting(E_ALL ^ E_NOTICE); @@ -94,19 +102,22 @@ if(!is_dir($cfg['path']['conlite_config'])) { die("Setup cannot find the config folder \"".$cfg['path']['conlite_config']."\"! Make shure folder exists and is readable."); } -// (bool) Flag to use native i18n. -// Note: Enabling this could create unwanted side effects, because of -// native gettext() behavior. -$cfg['native_i18n'] = false; +checkAndInclude($cfg['path']['conlite_config'] . 'config.misc.php'); +checkAndInclude($cfg['path']['conlite_config'] . 'cfg_sql.inc.php'); // includes -checkAndInclude($cfg['path']['conlite'] . 'classes/con2con/class.registry.php'); +/** @todo use conlite autoload to load needed classes */ checkAndInclude($cfg['path']['frontend'] . '/pear/HTML/Common2.php'); +checkAndInclude($cfg['path']['conlite'] . 'classes/con2con/class.registry.php'); +// load all genericdb classes +checkAndInclude($cfg['path']['conlite'] . 'classes/genericdb/class.item.base.abstract.php'); +checkAndInclude($cfg['path']['conlite'] . 'classes/genericdb/class.item.cache.php'); +checkAndInclude($cfg['path']['conlite'] . 'classes/class.genericdb.php'); checkAndInclude($cfg['path']['conlite'] . 'classes/cHTML5/class.chtml5.common.php'); checkAndInclude($cfg['path']['conlite'] . 'classes/cHTML5/class.chtml.php'); checkAndInclude($cfg['path']['conlite'] . 'classes/class.htmlelements.php'); checkAndInclude($cfg['path']['conlite'] . 'classes/con2con/class.filehandler.php'); -checkAndInclude($cfg['path']['conlite'] . 'includes/functions.php54.php'); +checkAndInclude($cfg['path']['conlite'] . 'classes/contenido/class.language.php'); checkAndInclude($cfg['path']['conlite'] . 'classes/class.i18n.php'); checkAndInclude($cfg['path']['conlite'] . 'includes/functions.i18n.php'); checkAndInclude('lib/class.setupcontrols.php');