fix php8.0 errors and issue #10

Dieser Commit ist enthalten in:
o.pinke 2021-01-11 19:41:20 +01:00
Ursprung 850925905d
Commit b3f4d9ee27
6 geänderte Dateien mit 28 neuen und 25 gelöschten Zeilen

Datei anzeigen

@ -159,7 +159,7 @@ foreach ($fullChunks as $fullChunk) {
'<!--{conlite_web}-->' => addslashes($root_http_path)
);
injectSQL($db, $_SESSION['dbprefix'], 'data/' . $fullChunk, $replacements, $failedChunks);
injectSQL($db, $_SESSION['dbprefix'], 'data/' . $fullChunk, $failedChunks, $replacements);
if (count($failedChunks) > 0) {
$fp = fopen('../data/logs/setuplog.txt', 'w');
@ -239,7 +239,7 @@ if ($currentstep < $totalsteps) {
// Update Keys
$aNothing = array();
injectSQL($db, $_SESSION['dbprefix'], 'data/indexes.sql', array(), $aNothing);
injectSQL($db, $_SESSION['dbprefix'], 'data/indexes.sql', $aNothing);
// logging query stuff
$aSqlArray = $db->getProfileData();

Datei anzeigen

@ -121,7 +121,8 @@ class Template {
*
* @return void
*/
public function set($which = 's', $needle, $replacement) {
public function set($which, $needle, $replacement) {
$which = empty($which)?'s':$which;
if ($which == 's') { // static
$this->needles[] = sprintf($this->tags['static'], $needle);
$this->replacements[] = $replacement;

Datei anzeigen

@ -5,8 +5,14 @@
*
* @package ConLite
* @subpackage Setup
* @license https://www.gnu.de/documents/gpl-3.0.de.html GNU General Public License (GPL)
* @version 1.0.0
* @author Ortwin Pinke <oldperl@ortwinpinke.de>
* @author Murat Purc <murat@purc.de>
* @copyright (c) 2020, ConLite.org
* @license https://www.gnu.org/licenses/gpl-3.0.de.html GNU General Public License 3
* @link https://conlite.org ConLite Portal
* @since file available since contenido release <= 4.8.15
*
*/
if (!defined('CON_FRAMEWORK')) {
@ -32,5 +38,5 @@ define('C_SETUP_STEPFILE_ACTIVE', 'images/steps/s%da.png');
define('C_SETUP_STEPWIDTH', 28);
define('C_SETUP_STEPHEIGHT', 28);
define('C_SETUP_MIN_PHP_VERSION', '7.2');
define('C_SETUP_MAX_PHP_VERSION', '7.4');
define('C_SETUP_VERSION', '2.2.0');
define('C_SETUP_MAX_PHP_VERSION', '8.1');
define('C_SETUP_VERSION', '2.2.0');

Datei anzeigen

@ -139,7 +139,7 @@ function checkMySQLDatabaseExists($db, $database) {
$db->connect();
if (hasMySQLiExtension() && !hasMySQLExtension()) {
if (@mysqli_select_db($database, $db->Link_ID)) {
if (mysqli_select_db($db->Link_ID,$database)) {
return true;
} else {
$db->query("SHOW DATABASES LIKE '$database'");

Datei anzeigen

@ -32,7 +32,7 @@ if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
function injectSQL(&$db, $prefix, $file, $replacements = array(), &$failedChunks) {
function injectSQL(&$db, $prefix, $file, &$failedChunks, $replacements = array()) {
$file = trim($file);
if (!isReadable($file)) {

Datei anzeigen

@ -1,24 +1,28 @@
<?php
/**
* startup.php
*
* startup file for conlite setup
*
* ConLite setup bootstrap file
*
* @package ConLite
* @subpackage Setup
* @license https://www.gnu.de/documents/gpl-3.0.de.html GNU General Public License (GPL)
* @version 1.0.0
* @author Ortwin Pinke <oldperl@ortwinpinke.de>
* @author Murat Purc <murat@purc.de>
* @copyright (c) 2020, ConLite.org
* @license https://www.gnu.org/licenses/gpl-3.0.de.html GNU General Public License 3
* @link https://conlite.org ConLite Portal
* @since file available since contenido release <= 4.8.15
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
define('CON_BE_PATH', '../conlite/');
require_once 'defines.php';
require_once dirname(__FILE__).'/defines.php';
session_start();
require_once 'lib/defines.php';
// uncomment this lines during development if needed
error_reporting(E_ALL ^ E_NOTICE);
@ -29,16 +33,11 @@ ini_set("error_log", "../data/logs/setup_errorlog.txt");
header('Content-Type: text/html; charset=UTF-8');
// Check php version
if (version_compare(PHP_VERSION, C_SETUP_MIN_PHP_VERSION, '<')) {
if (version_compare(PHP_VERSION, C_SETUP_MIN_PHP_VERSION, '<')
|| version_compare(PHP_VERSION, C_SETUP_MAX_PHP_VERSION, '>')) {
die("You need PHP >= " . C_SETUP_MIN_PHP_VERSION . " to install ConLite " . C_SETUP_VERSION . ". Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
}
$iVersionMax = substr(C_SETUP_MAX_PHP_VERSION, 0, strrpos(C_SETUP_MAX_PHP_VERSION, ".") + 1) . (1 + substr(C_SETUP_MAX_PHP_VERSION, strrpos(C_SETUP_MAX_PHP_VERSION, ".") + 1));
if (!(version_compare($iVersionMax, PHP_VERSION, ">") && version_compare(C_SETUP_MAX_PHP_VERSION, PHP_VERSION, "<="))) {
die("You need PHP >= " . C_SETUP_MIN_PHP_VERSION . " and <= " . C_SETUP_MAX_PHP_VERSION . " to install ConLite " . C_SETUP_VERSION . ". Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
}
/*
* Do not edit this value!
@ -99,10 +98,7 @@ if(!is_dir($cfg['path']['conlite_config'])) {
// native gettext() behavior.
$cfg['native_i18n'] = false;
session_start();
// includes
checkAndInclude('lib/defines.php');
checkAndInclude($cfg['path']['frontend'] . '/pear/HTML/Common2.php');
checkAndInclude($cfg['path']['conlite'] . 'classes/cHTML5/class.chtml.php');
checkAndInclude($cfg['path']['conlite'] . 'classes/class.htmlelements.php');