Setup updates for PHP 7.2

Dieser Commit ist enthalten in:
Oldperl 2018-07-22 16:59:22 +00:00
Ursprung 30ae1987ed
Commit 2aa2c3c090
7 geänderte Dateien mit 86 neuen und 107 gelöschten Zeilen

Datei anzeigen

@ -66,6 +66,10 @@ class InUseCollection extends ItemCollection
$session = Contenido_Security::escapeDB($session, null);
$user = Contenido_Security::escapeDB($user, null);
if(empty($type)) {
$type = "unknown";
}
$this->select("type = '".$type."' AND objectid = '".$objectid."'");
if (!$this->next()) {

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -31,7 +32,6 @@
* }}
*
*/
if (!defined("CON_FRAMEWORK")) {
define("CON_FRAMEWORK", true);
}
@ -61,8 +61,7 @@ require_once $cfg['path']['contenido'] . $cfg['path']['includes'] . 'functions.i
cInclude("includes", 'cfg_language_de.inc.php');
if ($cfg["use_pseudocron"] == true)
{
if ($cfg["use_pseudocron"] == true) {
/* Include cronjob-Emulator, but only for frame 1 */
if ($frame == 4) {
$sess->freeze();
@ -83,15 +82,13 @@ if ($cfg["use_pseudocron"] == true)
/* Remove all own marks, only for frame 1 and 4 if $_REQUEST['appendparameters'] == 'filebrowser'
filebrowser is used in tiny in this case also do not remove session marks */
if (($frame == 1 || $frame == 4) && isset($_REQUEST['appendparameters']) && $_REQUEST['appendparameters'] != 'filebrowser')
{
if (($frame == 1 || $frame == 4) && isset($_REQUEST['appendparameters']) && $_REQUEST['appendparameters'] != 'filebrowser') {
$col = new InUseCollection;
$col->removeSessionMarks($sess->id);
}
/* If the override flag is set, override a specific InUseItem */
if (isset($overrideid) && isset($overridetype))
{
if (isset($overrideid) && isset($overridetype)) {
$col = new InUseCollection;
$col->removeItemMarks($overridetype, $overrideid);
}
@ -124,22 +121,16 @@ if (isset($changelang) && is_numeric($changelang) ) {
$lang = $changelang;
}
if (!is_numeric($client) ||
(!$perm->have_perm_client("client[".$client."]") &&
!$perm->have_perm_client("admin[".$client."]")))
{
if (!is_numeric($client) || (!$perm->have_perm_client("client[" . $client . "]") && !$perm->have_perm_client("admin[" . $client . "]"))) {
// use first client which is accessible
$sess->register("client");
$sql = "SELECT idclient FROM " . $cfg["tab"]["clients"] . " ORDER BY idclient ASC";
$db->query($sql);
while ($db->next_record())
{
while ($db->next_record()) {
$mclient = $db->f("idclient");
if ($perm->have_perm_client("client[".$mclient."]") ||
$perm->have_perm_client("admin[".$mclient."]") )
{
if ($perm->have_perm_client("client[" . $mclient . "]") || $perm->have_perm_client("admin[" . $mclient . "]")) {
unset($lang);
$client = $mclient;
break;
@ -170,7 +161,6 @@ $xml = new XML_doc;
$tpl = new Template;
$backend = new Contenido_Backend;
//$backend->debug=true;
# Register session variables
$sess->register("sess_area");
@ -192,8 +182,7 @@ if(!isset($cfgClient) || !isset($cfgClient["set"]) || $cfgClient["set"] != "set"
# Load all actions from the DB
# and check if permission is
# granted.
if ($cfg["debug"]["rendering"] == true)
{
if ($cfg["debug"]["rendering"] == true) {
$oldmemusage = memory_get_usage();
}
# Select frameset
@ -210,17 +199,14 @@ $cfg["debug"]["backend_exectime"]["start"] = getmicrotime();
if (is_array($backend->getFile('inc'))) {
foreach ($backend->getFile('inc') as $filename) {
include_once($cfg['path']['contenido'] . $filename);
}
}
# If $action is set -> User klicked some button/link
# get the appopriate code for this action and evaluate it.
if (isset($action) && $action != "")
{
if (!isset($idart))
{
if (isset($action) && $action != "") {
if (!isset($idart)) {
$idart = 0;
}
@ -236,7 +222,6 @@ if (isset($action)) {
echo '</pre>';
}
eval($backend->getCode($action));
} else {
if ($backend->debug == 1) {
echo '<pre style="font-family: verdana; font-size: 10px"><b>Executing:</b>' . "\n";
@ -248,27 +233,19 @@ if (isset($action)) {
# Include the 'main' file for the selected area.
# Usually there is only one main file
if (is_array($backend->getFile('main')))
{
foreach ($backend->getFile('main') as $id => $filename)
{
if (is_array($backend->getFile('main'))) {
foreach ($backend->getFile('main') as $id => $filename) {
include_once($cfg['path']['contenido'] . $filename);
}
}
elseif( $frame == 3 )
{
} elseif ($frame == 3) {
include_once($cfg['path']['contenido'] . $cfg['path']['includes'] . "include.default_subnav.php" );
}
else
{
} else {
include_once($cfg['path']['contenido'] . $cfg['path']['includes'] . "include.blank.php");
}
$cfg["debug"]["backend_exectime"]["end"] = getmicrotime();
if ($cfg["debug"]["rendering"] == true)
{
if ($cfg["debug"]["rendering"] == true) {
echo "Building this page (excluding contenido includes) took: " . ($cfg["debug"]["backend_exectime"]["end"] - $cfg["debug"]["backend_exectime"]["start"]) . " seconds<br>";
echo "Building the complete page took: " . ($cfg["debug"]["backend_exectime"]["end"] - $cfg["debug"]["backend_exectime"]["fullstart"]) . " seconds<br>";
@ -286,8 +263,6 @@ $oActiveUser->startUsersTracking();
*
* End of the User Tracking
*/
$db->disconnect();
page_close();
?>

Datei anzeigen

@ -226,10 +226,10 @@
"groups";"perms";"mediumtext";"YES";"";"";"";""
"groups";"description";"varchar(255)";"YES";"";"";"";""
"inuse";"idinuse";"int(10)";"NO";"PRI";"0";"";"1"
"inuse";"type";"varchar(32)";"NO";"";"";"";""
"inuse";"objectid";"varchar(32)";"NO";"";"";"";""
"inuse";"session";"varchar(32)";"NO";"";"";"";""
"inuse";"userid";"varchar(32)";"NO";"";"";"";""
"inuse";"type";"varchar(32)";"YES";"";"";"";""
"inuse";"objectid";"varchar(32)";"YES";"";"";"";""
"inuse";"session";"varchar(32)";"YES";"";"";"";""
"inuse";"userid";"varchar(32)";"YES";"";"";"";""
"keywords";"idkeyword";"int(10)";"NO";"PRI";"0";"";"1"
"keywords";"keyword";"varchar(50)";"NO";"MUL";"";"";""
"keywords";"exp";"text";"NO";"";"";"";""

Datei anzeigen

@ -52,11 +52,7 @@ if (checkMySQLDatabaseCreation($db, $_SESSION['dbname'])) {
$db = getSetupMySQLDBConnection();
}
$currentstep = $_GET['step'];
if ($currentstep == 0) {
$currentstep = 1;
}
$currentstep = (empty($_GET['step']))?1:filter_input(INPUT_GET, "step", FILTER_SANITIZE_NUMBER_INT);
// Count DB Chunks
$file = fopen('data/tables.txt', 'r');

Datei anzeigen

@ -56,6 +56,6 @@ define('C_SETUP_STEPFILE', 'images/steps/s%d.png');
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', '5.3');
define('C_SETUP_VERSION', '2.0.1');
define('C_SETUP_MIN_PHP_VERSION', '5.6');
define('C_SETUP_VERSION', '2.1.0');
?>

Datei anzeigen

@ -62,7 +62,7 @@ function doMySQLConnect($host, $username, $password) {
//$sFile = '../data/logs/setup_queries.txt';
//file_put_contents($sFile, $db->getServerInfo(), FILE_APPEND);
//chmod($sFile, 0666);
if ($db->connect() == 0) {
if (empty($db->connect())) {
return array($db, false);
} else {
return array($db, true);

Datei anzeigen

@ -36,15 +36,14 @@ ini_set("error_log", "../data/logs/setup_errorlog.txt");
header('Content-Type: text/html; charset=UTF-8');
// Check version in the 'first' line, as class.security.php uses
// PHP5 object syntax not compatible with PHP < 5.2
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
die("You need PHP >= 5.3.0 for ConLite. Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
if (version_compare(PHP_VERSION, '5.6.0', '<')) {
die("You need PHP >= 5.6.0 for ConLite. Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
}
// Check version
//PHP >= 5.0.0 and < 6.0.0
if (version_compare(PHP_VERSION, '7.2.0', '>=')) {
die("You need PHP >= 5.3.0 < 7.2.0 for ConLite. Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
//PHP >= 5.6.0 and < 7.3.0
if (version_compare(PHP_VERSION, '7.3.0', '>=')) {
die("You need PHP >= 5.6.0 < 7.3.0 for ConLite. Sorry, even the setup doesn't work otherwise. Your version: " . PHP_VERSION . "\n");
}
@ -98,6 +97,11 @@ $cfg['path']['frontend'] = CON_FRONTEND_PATH;
$cfg['path']['conlite'] = $cfg['path']['frontend'] . '/conlite/';
$cfg['path']['conlite_config'] = CON_FRONTEND_PATH . '/data/config/' . CL_ENVIRONMENT . '/';
// (bool) Flag to use native i18n.
// Note: Enabling this could create unwanted side effects, because of
// native gettext() behavior.
$cfg['native_i18n'] = false;
session_start();
// includes