fixes php8
Dieser Commit ist enthalten in:
Ursprung
fcda0a460b
Commit
b438f15708
|
@ -22,9 +22,9 @@ if (!defined('CON_FRAMEWORK')) {
|
||||||
define('CON_FRAMEWORK', true);
|
define('CON_FRAMEWORK', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
define('CON_SETUP_PATH', str_replace('\\', '/', realpath(dirname(__FILE__))));
|
define('CON_SETUP_PATH', str_replace('\\', '/', realpath(__DIR__)));
|
||||||
|
|
||||||
define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')));
|
define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(__DIR__ . '/../')));
|
||||||
|
|
||||||
include_once('lib/startup.php');
|
include_once('lib/startup.php');
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ if (cFileHandler::exists('data/tables_pi.txt')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pluginChunks = array();
|
$pluginChunks = [];
|
||||||
|
|
||||||
$baseChunks = txtFileToArray('data/base.txt');
|
$baseChunks = txtFileToArray('data/base.txt');
|
||||||
|
|
||||||
|
@ -128,20 +128,12 @@ $contentChunks = txtFileToArray('data/examples.txt');
|
||||||
$sysadminChunk = txtFileToArray('data/sysadmin.txt');
|
$sysadminChunk = txtFileToArray('data/sysadmin.txt');
|
||||||
|
|
||||||
if ($_SESSION['setuptype'] == 'setup') {
|
if ($_SESSION['setuptype'] == 'setup') {
|
||||||
switch ($_SESSION['clientmode']) {
|
$fullChunks = match ($_SESSION['clientmode']) {
|
||||||
case 'CLIENT':
|
'CLIENT' => array_merge($baseChunks, $sysadminChunk, $clientNoContentChunks),
|
||||||
$fullChunks = array_merge($baseChunks, $sysadminChunk, $clientNoContentChunks);
|
'CLIENTMODULES' => array_merge($baseChunks, $sysadminChunk, $clientNoContentChunks, $moduleChunks),
|
||||||
break;
|
'CLIENTEXAMPLES' => array_merge($baseChunks, $sysadminChunk, $clientChunks, $moduleChunks, $contentChunks),
|
||||||
case 'CLIENTMODULES':
|
default => array_merge($baseChunks, $sysadminChunk),
|
||||||
$fullChunks = array_merge($baseChunks, $sysadminChunk, $clientNoContentChunks, $moduleChunks);
|
};
|
||||||
break;
|
|
||||||
case 'CLIENTEXAMPLES':
|
|
||||||
$fullChunks = array_merge($baseChunks, $sysadminChunk, $clientChunks, $moduleChunks, $contentChunks);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$fullChunks = array_merge($baseChunks, $sysadminChunk);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$fullChunks = $baseChunks;
|
$fullChunks = $baseChunks;
|
||||||
}
|
}
|
||||||
|
@ -149,22 +141,19 @@ if ($_SESSION['setuptype'] == 'setup') {
|
||||||
$fullChunks = array_merge($fullChunks, $pluginChunks);
|
$fullChunks = array_merge($fullChunks, $pluginChunks);
|
||||||
|
|
||||||
|
|
||||||
list($root_path, $root_http_path) = getSystemDirectories();
|
[$root_path, $root_http_path] = getSystemDirectories();
|
||||||
|
|
||||||
$totalsteps = ceil($fullcount / 50) + count($fullChunks) + 1;
|
$totalsteps = ceil($fullcount / 50) + count($fullChunks) + 1;
|
||||||
foreach ($fullChunks as $fullChunk) {
|
foreach ($fullChunks as $fullChunk) {
|
||||||
$step++;
|
$step++;
|
||||||
if ($step == $currentstep) {
|
if ($step == $currentstep) {
|
||||||
$failedChunks = array();
|
$failedChunks = [];
|
||||||
|
|
||||||
$replacements = array(
|
$replacements = ['<!--{conlite_root}-->' => addslashes($root_path), '<!--{conlite_web}-->' => addslashes($root_http_path)];
|
||||||
'<!--{conlite_root}-->' => addslashes($root_path),
|
|
||||||
'<!--{conlite_web}-->' => addslashes($root_http_path)
|
|
||||||
);
|
|
||||||
|
|
||||||
injectSQL($db, $_SESSION['dbprefix'], 'data/' . $fullChunk, $failedChunks, $replacements);
|
injectSQL($db, $_SESSION['dbprefix'], 'data/' . $fullChunk, $failedChunks, $replacements);
|
||||||
|
|
||||||
if (count($failedChunks) > 0) {
|
if ((is_countable($failedChunks) ? count($failedChunks) : 0) > 0) {
|
||||||
$fp = fopen('../data/logs/setuplog.txt', 'w');
|
$fp = fopen('../data/logs/setuplog.txt', 'w');
|
||||||
foreach ($failedChunks as $failedChunk) {
|
foreach ($failedChunks as $failedChunk) {
|
||||||
fwrite($fp, sprintf("Setup was unable to execute SQL. MySQL-Error: %s, MySQL-Message: %s, SQL-Statements:\n%s", $failedChunk['errno'], $failedChunk['error'], $failedChunk['sql']));
|
fwrite($fp, sprintf("Setup was unable to execute SQL. MySQL-Error: %s, MySQL-Message: %s, SQL-Statements:\n%s", $failedChunk['errno'], $failedChunk['error'], $failedChunk['sql']));
|
||||||
|
@ -189,14 +178,14 @@ if ($currentstep < $totalsteps) {
|
||||||
|
|
||||||
// For import mod_history rows to versioning
|
// For import mod_history rows to versioning
|
||||||
if ($_SESSION['setuptype'] == 'migration' || $_SESSION['setuptype'] == 'upgrade') {
|
if ($_SESSION['setuptype'] == 'migration' || $_SESSION['setuptype'] == 'upgrade') {
|
||||||
$cfgClient = array();
|
$cfgClient = [];
|
||||||
rereadClients_Setup();
|
rereadClients_Setup();
|
||||||
|
|
||||||
$oVersion = new VersionImport($cfg, $cfgClient, $db, $client, $area, $frame);
|
$oVersion = new VersionImport($cfg, $cfgClient, $db, $client, $area, $frame);
|
||||||
$oVersion->CreateHistoryVersion();
|
$oVersion->CreateHistoryVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
$tables = array();
|
$tables = [];
|
||||||
|
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
$tables[] = $db->f(0);
|
$tables[] = $db->f(0);
|
||||||
|
@ -240,7 +229,7 @@ if ($currentstep < $totalsteps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update Keys
|
// Update Keys
|
||||||
$aNothing = array();
|
$aNothing = [];
|
||||||
|
|
||||||
injectSQL($db, $_SESSION['dbprefix'], 'data/indexes.sql', $aNothing);
|
injectSQL($db, $_SESSION['dbprefix'], 'data/indexes.sql', $aNothing);
|
||||||
|
|
||||||
|
@ -259,7 +248,7 @@ if ($currentstep < $totalsteps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function txtFileToArray($sFile) {
|
function txtFileToArray($sFile) {
|
||||||
$aFileArray = array();
|
$aFileArray = [];
|
||||||
if (file_exists($sFile) && is_readable($sFile)) {
|
if (file_exists($sFile) && is_readable($sFile)) {
|
||||||
$aFileArray = explode("\n", file_get_contents($sFile));
|
$aFileArray = explode("\n", file_get_contents($sFile));
|
||||||
}
|
}
|
||||||
|
|
123
setup/index.php
123
setup/index.php
|
@ -28,9 +28,9 @@ if (!defined('CON_FRAMEWORK')) {
|
||||||
define('CON_FRAMEWORK', true);
|
define('CON_FRAMEWORK', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
define('CON_SETUP_PATH', str_replace('\\', '/', realpath(dirname(__FILE__))));
|
define('CON_SETUP_PATH', str_replace('\\', '/', realpath(__DIR__)));
|
||||||
|
|
||||||
define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')));
|
define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(__DIR__ . '/../')));
|
||||||
|
|
||||||
include_once('lib/startup.php');
|
include_once('lib/startup.php');
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ if (is_array($_REQUEST)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (getPHPIniSetting('session.use_cookies') == 0) {
|
if (ini_get('session.use_cookies') == 0) {
|
||||||
$sNotInstallableReason = 'session_use_cookies';
|
$sNotInstallableReason = 'session_use_cookies';
|
||||||
checkAndInclude('steps/notinstallable.php');
|
checkAndInclude('steps/notinstallable.php');
|
||||||
}
|
}
|
||||||
|
@ -104,92 +104,35 @@ if (array_key_exists('step', $_REQUEST)) {
|
||||||
$iStep = '';
|
$iStep = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($iStep) {
|
match ($iStep) {
|
||||||
case 'setuptype':
|
'setuptype' => checkAndInclude('steps/setuptype.php'),
|
||||||
checkAndInclude('steps/setuptype.php');
|
'setup1' => checkAndInclude('steps/setup/step1.php'),
|
||||||
break;
|
'setup2' => checkAndInclude('steps/setup/step2.php'),
|
||||||
case 'setup1':
|
'setup3' => checkAndInclude('steps/setup/step3.php'),
|
||||||
checkAndInclude('steps/setup/step1.php');
|
'setup4' => checkAndInclude('steps/setup/step4.php'),
|
||||||
break;
|
'setup5' => checkAndInclude('steps/setup/step5.php'),
|
||||||
case 'setup2':
|
'setup6' => checkAndInclude('steps/setup/step6.php'),
|
||||||
checkAndInclude('steps/setup/step2.php');
|
'setup7' => checkAndInclude('steps/setup/step7.php'),
|
||||||
break;
|
'setup8' => checkAndInclude('steps/setup/step8.php'),
|
||||||
case 'setup3':
|
'migration1' => checkAndInclude('steps/migration/step1.php'),
|
||||||
checkAndInclude('steps/setup/step3.php');
|
'migration2' => checkAndInclude('steps/migration/step2.php'),
|
||||||
break;
|
'migration3' => checkAndInclude('steps/migration/step3.php'),
|
||||||
case 'setup4':
|
'migration4' => checkAndInclude('steps/migration/step4.php'),
|
||||||
checkAndInclude('steps/setup/step4.php');
|
'migration5' => checkAndInclude('steps/migration/step5.php'),
|
||||||
break;
|
'migration6' => checkAndInclude('steps/migration/step6.php'),
|
||||||
case 'setup5':
|
'migration7' => checkAndInclude('steps/migration/step7.php'),
|
||||||
checkAndInclude('steps/setup/step5.php');
|
'migration8' => checkAndInclude('steps/migration/step8.php'),
|
||||||
break;
|
'upgrade1' => checkAndInclude('steps/upgrade/step1.php'),
|
||||||
case 'setup6':
|
'upgrade2' => checkAndInclude('steps/upgrade/step2.php'),
|
||||||
checkAndInclude('steps/setup/step6.php');
|
'upgrade3' => checkAndInclude('steps/upgrade/step3.php'),
|
||||||
break;
|
'upgrade4' => checkAndInclude('steps/upgrade/step4.php'),
|
||||||
case 'setup7':
|
'upgrade5' => checkAndInclude('steps/upgrade/step5.php'),
|
||||||
checkAndInclude('steps/setup/step7.php');
|
'upgrade6' => checkAndInclude('steps/upgrade/step6.php'),
|
||||||
break;
|
'upgrade7' => checkAndInclude('steps/upgrade/step7.php'),
|
||||||
case 'setup8':
|
'domigration' => checkAndInclude('steps/migration/domigration.php'),
|
||||||
checkAndInclude('steps/setup/step8.php');
|
'doupgrade' => checkAndInclude('steps/upgrade/doupgrade.php'),
|
||||||
break;
|
'doinstall' => checkAndInclude('steps/setup/doinstall.php'),
|
||||||
case 'migration1':
|
default => checkAndInclude('steps/languagechooser.php'),
|
||||||
checkAndInclude('steps/migration/step1.php');
|
};
|
||||||
break;
|
|
||||||
case 'migration2':
|
|
||||||
checkAndInclude('steps/migration/step2.php');
|
|
||||||
break;
|
|
||||||
case 'migration3':
|
|
||||||
checkAndInclude('steps/migration/step3.php');
|
|
||||||
break;
|
|
||||||
case 'migration4':
|
|
||||||
checkAndInclude('steps/migration/step4.php');
|
|
||||||
break;
|
|
||||||
case 'migration5':
|
|
||||||
checkAndInclude('steps/migration/step5.php');
|
|
||||||
break;
|
|
||||||
case 'migration6':
|
|
||||||
checkAndInclude('steps/migration/step6.php');
|
|
||||||
break;
|
|
||||||
case 'migration7':
|
|
||||||
checkAndInclude('steps/migration/step7.php');
|
|
||||||
break;
|
|
||||||
case 'migration8':
|
|
||||||
checkAndInclude('steps/migration/step8.php');
|
|
||||||
break;
|
|
||||||
case 'upgrade1':
|
|
||||||
checkAndInclude('steps/upgrade/step1.php');
|
|
||||||
break;
|
|
||||||
case 'upgrade2':
|
|
||||||
checkAndInclude('steps/upgrade/step2.php');
|
|
||||||
break;
|
|
||||||
case 'upgrade3':
|
|
||||||
checkAndInclude('steps/upgrade/step3.php');
|
|
||||||
break;
|
|
||||||
case 'upgrade4':
|
|
||||||
checkAndInclude('steps/upgrade/step4.php');
|
|
||||||
break;
|
|
||||||
case 'upgrade5':
|
|
||||||
checkAndInclude('steps/upgrade/step5.php');
|
|
||||||
break;
|
|
||||||
case 'upgrade6':
|
|
||||||
checkAndInclude('steps/upgrade/step6.php');
|
|
||||||
break;
|
|
||||||
case 'upgrade7':
|
|
||||||
checkAndInclude('steps/upgrade/step7.php');
|
|
||||||
break;
|
|
||||||
case 'domigration':
|
|
||||||
checkAndInclude('steps/migration/domigration.php');
|
|
||||||
break;
|
|
||||||
case 'doupgrade':
|
|
||||||
checkAndInclude('steps/upgrade/doupgrade.php');
|
|
||||||
break;
|
|
||||||
case 'doinstall':
|
|
||||||
checkAndInclude('steps/setup/doinstall.php');
|
|
||||||
break;
|
|
||||||
case 'languagechooser':
|
|
||||||
default:
|
|
||||||
checkAndInclude('steps/languagechooser.php');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -33,12 +33,12 @@
|
||||||
|
|
||||||
|
|
||||||
class cHTMLAlphaImage extends cHTMLImage {
|
class cHTMLAlphaImage extends cHTMLImage {
|
||||||
var $_sClickImage;
|
public $_sClickImage;
|
||||||
var $_sMouseoverClickImage;
|
public $_sMouseoverClickImage;
|
||||||
var $_sMouseoverSrc;
|
public $_sMouseoverSrc;
|
||||||
|
|
||||||
function __construct() {
|
public function __construct()
|
||||||
parent::__construct();
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
function setMouseover ($sMouseoverSrc)
|
function setMouseover ($sMouseoverSrc)
|
||||||
|
@ -78,7 +78,7 @@ class cHTMLAlphaImage extends cHTMLImage {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return parent::toHTML();
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,6 @@ class cHTMLErrorMessageList extends cHTMLDiv {
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->_oTable = new cHTMLTable();
|
$this->_oTable = new cHTMLTable();
|
||||||
$this->_oTable->setWidth("100%");
|
$this->_oTable->setWidth("100%");
|
||||||
parent::__construct();
|
|
||||||
$this->setClass("errorlist");
|
$this->setClass("errorlist");
|
||||||
$this->setStyle("width: 450px; height: 218px; overflow: auto; border: 1px solid black;");
|
$this->setStyle("width: 450px; height: 218px; overflow: auto; border: 1px solid black;");
|
||||||
}
|
}
|
||||||
|
@ -101,7 +100,7 @@ class cHTMLErrorMessageList extends cHTMLDiv {
|
||||||
|
|
||||||
function toHTML() {
|
function toHTML() {
|
||||||
$this->_setContent($this->_oTable->render());
|
$this->_setContent($this->_oTable->render());
|
||||||
return parent::toHTML();
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +142,7 @@ class cHTMLFoldableErrorMessage extends cHTMLTableRow {
|
||||||
|
|
||||||
$this->_oContent->setVerticalAlignment("top");
|
$this->_oContent->setVerticalAlignment("top");
|
||||||
$this->_oContent->setClass("entry");
|
$this->_oContent->setClass("entry");
|
||||||
$this->_oContent->setContent(array($this->_oTitle, $this->_oMessage));
|
$this->_oContent->setContent([$this->_oTitle, $this->_oMessage]);
|
||||||
|
|
||||||
$this->_oIcon->setClass("icon");
|
$this->_oIcon->setClass("icon");
|
||||||
$this->_oIcon->setVerticalAlignment("top");
|
$this->_oIcon->setVerticalAlignment("top");
|
||||||
|
@ -162,13 +161,11 @@ class cHTMLFoldableErrorMessage extends cHTMLTableRow {
|
||||||
} else {
|
} else {
|
||||||
$this->_oIcon->setContent(" ");
|
$this->_oIcon->setContent(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::__construct();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toHTML() {
|
function toHTML() {
|
||||||
$this->setContent(array($this->_oFolding, $this->_oContent, $this->_oIcon));
|
$this->setContent([$this->_oFolding, $this->_oContent, $this->_oIcon]);
|
||||||
return parent::toHTML();
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,13 +187,11 @@ class cHTMLInfoMessage extends cHTMLTableRow {
|
||||||
$this->_oTitle->setVerticalAlignment("top");
|
$this->_oTitle->setVerticalAlignment("top");
|
||||||
$this->_oMessage->setContent($sMessage);
|
$this->_oMessage->setContent($sMessage);
|
||||||
$this->_oMessage->setClass("entry_nowrap");
|
$this->_oMessage->setClass("entry_nowrap");
|
||||||
|
|
||||||
parent::__construct();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toHTML() {
|
function toHTML() {
|
||||||
$this->setContent(array($this->_oTitle, $this->_oMessage));
|
$this->setContent([$this->_oTitle, $this->_oMessage]);
|
||||||
return parent::toHTML();
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,8 +204,6 @@ class cHTMLLanguageLink extends cHTMLDiv {
|
||||||
* @param int $stepnumber
|
* @param int $stepnumber
|
||||||
*/
|
*/
|
||||||
function __construct($langcode, $langname, $stepnumber) {
|
function __construct($langcode, $langname, $stepnumber) {
|
||||||
parent::__construct();
|
|
||||||
|
|
||||||
$linkImage = new cHTMLAlphaImage();
|
$linkImage = new cHTMLAlphaImage();
|
||||||
$linkImage->setAlt("");
|
$linkImage->setAlt("");
|
||||||
$linkImage->setSrc("../conlite/images/submit.gif");
|
$linkImage->setSrc("../conlite/images/submit.gif");
|
||||||
|
@ -249,8 +242,6 @@ class cHTMLButtonLink extends cHTMLDiv {
|
||||||
* @param string $title
|
* @param string $title
|
||||||
*/
|
*/
|
||||||
function __construct($href, $title) {
|
function __construct($href, $title) {
|
||||||
parent::__construct();
|
|
||||||
|
|
||||||
$linkImage = new cHTMLAlphaImage();
|
$linkImage = new cHTMLAlphaImage();
|
||||||
$linkImage->setSrc("../conlite/images/submit.gif");
|
$linkImage->setSrc("../conlite/images/submit.gif");
|
||||||
$linkImage->setMouseover("../conlite/images/submit_hover.gif");
|
$linkImage->setMouseover("../conlite/images/submit_hover.gif");
|
||||||
|
|
|
@ -35,18 +35,6 @@ class cSetupMask {
|
||||||
*/
|
*/
|
||||||
protected $_oStepTemplate;
|
protected $_oStepTemplate;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $_sStepTemplate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
protected $_iStep;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
|
@ -59,12 +47,13 @@ class cSetupMask {
|
||||||
*/
|
*/
|
||||||
protected $_sHeader;
|
protected $_sHeader;
|
||||||
|
|
||||||
public function __construct($sStepTemplate, $iStep = false) {
|
/**
|
||||||
|
* @param string $sStepTemplate
|
||||||
|
* @param int $iStep
|
||||||
|
*/
|
||||||
|
public function __construct(protected $_sStepTemplate, protected $_iStep = false) {
|
||||||
$this->_oTpl = new Template();
|
$this->_oTpl = new Template();
|
||||||
$this->_oStepTemplate = new Template();
|
$this->_oStepTemplate = new Template();
|
||||||
|
|
||||||
$this->_sStepTemplate = $sStepTemplate;
|
|
||||||
$this->_iStep = $iStep;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNavigation($sBackstep, $sNextstep) {
|
public function setNavigation($sBackstep, $sNextstep) {
|
||||||
|
@ -80,20 +69,12 @@ class cSetupMask {
|
||||||
$sSetupType = "";
|
$sSetupType = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($sSetupType) {
|
$this->_sHeader = match ($sSetupType) {
|
||||||
case "setup":
|
"setup" => "Setup - " . $sHeader,
|
||||||
$this->_sHeader = "Setup - " . $sHeader;
|
"upgrade" => "Upgrade - " . $sHeader,
|
||||||
break;
|
"migration" => "Migration - " . $sHeader,
|
||||||
case "upgrade":
|
default => $sHeader,
|
||||||
$this->_sHeader = "Upgrade - " . $sHeader;
|
};
|
||||||
break;
|
|
||||||
case "migration":
|
|
||||||
$this->_sHeader = "Migration - " . $sHeader;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$this->_sHeader = $sHeader;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _createNavigation() {
|
public function _createNavigation() {
|
||||||
|
|
|
@ -29,55 +29,55 @@ class Template {
|
||||||
* Needles (static)
|
* Needles (static)
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $needles = array();
|
public $needles = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replacements (static)
|
* Replacements (static)
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $replacements = array();
|
public $replacements = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dyn_Needles (dynamic)
|
* Dyn_Needles (dynamic)
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $Dyn_needles = array();
|
public $Dyn_needles = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dyn_Replacements (dynamic)
|
* Dyn_Replacements (dynamic)
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $Dyn_replacements = array();
|
public $Dyn_replacements = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database instance
|
* Database instance
|
||||||
* @var object
|
* @var object
|
||||||
*/
|
*/
|
||||||
var $db;
|
public $db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Template cache
|
* Template cache
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $tplcache;
|
public $tplcache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Template name cache
|
* Template name cache
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $tplnamecache;
|
public $tplnamecache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dynamic counter
|
* Dynamic counter
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
var $dyn_cnt = 0;
|
public $dyn_cnt = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tags array (for dynamic blocks);
|
* Tags array (for dynamic blocks);
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $tags = array('static' => '{%s}', 'start' => '<!-- BEGIN:BLOCK -->', 'end' => '<!-- END:BLOCK -->');
|
public $tags = ['static' => '{%s}', 'start' => '<!-- BEGIN:BLOCK -->', 'end' => '<!-- END:BLOCK -->'];
|
||||||
|
|
||||||
protected $_sDomain;
|
protected $_sDomain;
|
||||||
protected $_encoding;
|
protected $_encoding;
|
||||||
|
@ -87,8 +87,8 @@ class Template {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct($tags = false) {
|
public function __construct($tags = false) {
|
||||||
$this->tplcache = Array();
|
$this->tplcache = [];
|
||||||
$this->tplnamecache = Array();
|
$this->tplnamecache = [];
|
||||||
|
|
||||||
if (is_array($tags)) {
|
if (is_array($tags)) {
|
||||||
$this->tags = $tags;
|
$this->tags = $tags;
|
||||||
|
@ -160,10 +160,10 @@ class Template {
|
||||||
*/
|
*/
|
||||||
public function reset() {
|
public function reset() {
|
||||||
$this->dyn_cnt = 0;
|
$this->dyn_cnt = 0;
|
||||||
$this->needles = array();
|
$this->needles = [];
|
||||||
$this->replacements = array();
|
$this->replacements = [];
|
||||||
$this->Dyn_needles = array();
|
$this->Dyn_needles = [];
|
||||||
$this->Dyn_replacements = array();
|
$this->Dyn_replacements = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -187,7 +187,7 @@ class Template {
|
||||||
|
|
||||||
$content = (($note) ? "<!-- Generated by ConLite " . $cfg['version'] . "-->\n" : "") . $content;
|
$content = (($note) ? "<!-- Generated by ConLite " . $cfg['version'] . "-->\n" : "") . $content;
|
||||||
|
|
||||||
$pieces = array();
|
$pieces = [];
|
||||||
|
|
||||||
//if content has dynamic blocks
|
//if content has dynamic blocks
|
||||||
if (preg_match("/^.*" . preg_quote($this->tags['start'], "/") . ".*?" . preg_quote($this->tags['end'], "/") . ".*$/s", $content)) {
|
if (preg_match("/^.*" . preg_quote($this->tags['start'], "/") . ".*?" . preg_quote($this->tags['end'], "/") . ".*$/s", $content)) {
|
||||||
|
@ -246,7 +246,7 @@ class Template {
|
||||||
* @param $functionName string Name of the translation function (e.g. i18n)
|
* @param $functionName string Name of the translation function (e.g. i18n)
|
||||||
*/
|
*/
|
||||||
public function replacei18n(& $template, $functionName) {
|
public function replacei18n(& $template, $functionName) {
|
||||||
$matches = array();
|
$matches = [];
|
||||||
|
|
||||||
//if template contains functionName + parameter store all matches
|
//if template contains functionName + parameter store all matches
|
||||||
preg_match_all("/" . preg_quote($functionName, "/") . "\\(([\\\"\\'])(.*?)\\1\\)/s", $template, $matches);
|
preg_match_all("/" . preg_quote($functionName, "/") . "\\(([\\\"\\'])(.*?)\\1\\)/s", $template, $matches);
|
||||||
|
|
|
@ -41,7 +41,7 @@ define('C_SETUP_MIN_PHP_VERSION', '7.4.0');
|
||||||
define('C_SETUP_MAX_PHP_VERSION', '8.3.0');
|
define('C_SETUP_MAX_PHP_VERSION', '8.3.0');
|
||||||
define('C_SETUP_VERSION', '3.0.0');
|
define('C_SETUP_VERSION', '3.0.0');
|
||||||
|
|
||||||
$sDefLocalPath = dirname(__FILE__).DIRECTORY_SEPARATOR.'defines.local.php';
|
$sDefLocalPath = __DIR__.DIRECTORY_SEPARATOR.'defines.local.php';
|
||||||
if(file_exists($sDefLocalPath)) {
|
if(file_exists($sDefLocalPath)) {
|
||||||
include_once $sDefLocalPath;
|
include_once $sDefLocalPath;
|
||||||
}
|
}
|
|
@ -48,7 +48,7 @@ function getServerUID ()
|
||||||
return posix_getuid();
|
return posix_getuid();
|
||||||
}
|
}
|
||||||
|
|
||||||
$sFilename = md5(mt_rand()) . ".txt";
|
$sFilename = md5(random_int(0, mt_getrandmax())) . ".txt";
|
||||||
|
|
||||||
if (isWriteable("."))
|
if (isWriteable("."))
|
||||||
{
|
{
|
||||||
|
@ -81,7 +81,7 @@ function getServerGID ()
|
||||||
return posix_getgid();
|
return posix_getgid();
|
||||||
}
|
}
|
||||||
|
|
||||||
$sFilename = md5(mt_rand()) . ".txt";
|
$sFilename = md5(random_int(0, mt_getrandmax())) . ".txt";
|
||||||
|
|
||||||
if (isWriteable("."))
|
if (isWriteable("."))
|
||||||
{
|
{
|
||||||
|
@ -131,7 +131,7 @@ function cInitializeArrayKey (&$aArray, $sKey, $mDefault = "")
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$aArray = array();
|
$aArray = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!array_key_exists($sKey, $aArray))
|
if (!array_key_exists($sKey, $aArray))
|
||||||
|
|
|
@ -101,7 +101,7 @@ function canWriteFile($sFilename) {
|
||||||
|
|
||||||
#try to find a random filename for write test, which does not exist
|
#try to find a random filename for write test, which does not exist
|
||||||
while (file_exists($sRandFilenamePath) && $i < 100) {
|
while (file_exists($sRandFilenamePath) && $i < 100) {
|
||||||
$sRandFilename = 'con_test' . rand(0, 1000000000) . 'con_test';
|
$sRandFilename = 'con_test' . random_int(0, 1_000_000_000) . 'con_test';
|
||||||
$sRandFilenamePath = '';
|
$sRandFilenamePath = '';
|
||||||
|
|
||||||
if ($sFilename[strlen($sFilename) - 1] == '/') {
|
if ($sFilename[strlen($sFilename) - 1] == '/') {
|
||||||
|
@ -225,7 +225,7 @@ function getFileInfo($sFilename) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$aFileinfo = array();
|
$aFileinfo = [];
|
||||||
$aFileinfo["info"] = $info;
|
$aFileinfo["info"] = $info;
|
||||||
$aFileinfo["type"] = $type;
|
$aFileinfo["type"] = $type;
|
||||||
$aFileinfo["owner"]["read"] = ($oiFilePermissions & 0x0100) ? true : false;
|
$aFileinfo["owner"]["read"] = ($oiFilePermissions & 0x0100) ? true : false;
|
||||||
|
@ -240,7 +240,7 @@ function getFileInfo($sFilename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkOpenBasedirCompatibility() {
|
function checkOpenBasedirCompatibility() {
|
||||||
$value = getPHPIniSetting("open_basedir");
|
$value = ini_get("open_basedir");
|
||||||
|
|
||||||
if (isWindows()) {
|
if (isWindows()) {
|
||||||
$aBasedirEntries = explode(";", $value);
|
$aBasedirEntries = explode(";", $value);
|
||||||
|
|
|
@ -80,7 +80,7 @@ function isImageMagickAvailable ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = array();
|
$output = [];
|
||||||
|
|
||||||
$retval = "";
|
$retval = "";
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ function isImageMagickAvailable ()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($output[0],"ImageMagick") !== false)
|
if (str_contains($output[0],"ImageMagick"))
|
||||||
{
|
{
|
||||||
$_imagemagickAvailable = true;
|
$_imagemagickAvailable = true;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -51,46 +51,25 @@ function hasMySQLiExtension() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function doMySQLConnect($host, $username, $password) {
|
function doMySQLConnect($host, $username, $password) {
|
||||||
$aOptions = array(
|
$aOptions = ['connection' => ['host' => $host, 'user' => $username, 'password' => $password]];
|
||||||
'connection' => array(
|
|
||||||
'host' => $host,
|
|
||||||
'user' => $username,
|
|
||||||
'password' => $password,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
$db = new DB_Contenido($aOptions);
|
$db = new DB_Contenido($aOptions);
|
||||||
//$sFile = '../data/logs/setup_queries.txt';
|
//$sFile = '../data/logs/setup_queries.txt';
|
||||||
//file_put_contents($sFile, $db->getServerInfo(), FILE_APPEND);
|
//file_put_contents($sFile, $db->getServerInfo(), FILE_APPEND);
|
||||||
//chmod($sFile, 0666);
|
//chmod($sFile, 0666);
|
||||||
if (empty($db->connect())) {
|
if (empty($db->connect())) {
|
||||||
return array($db, false);
|
return [$db, false];
|
||||||
} else {
|
} else {
|
||||||
return array($db, true);
|
return [$db, true];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSetupMySQLDBConnection($full = true) {
|
function getSetupMySQLDBConnection($full = true) {
|
||||||
if ($full === false) {
|
if ($full === false) {
|
||||||
// host, user and password
|
// host, user and password
|
||||||
$aOptions = array(
|
$aOptions = ['connection' => ['host' => $_SESSION["dbhost"], 'user' => $_SESSION["dbuser"], 'password' => $_SESSION["dbpass"]], 'sequenceTable' => $_SESSION['dbprefix'] . '_sequence'];
|
||||||
'connection' => array(
|
|
||||||
'host' => $_SESSION["dbhost"],
|
|
||||||
'user' => $_SESSION["dbuser"],
|
|
||||||
'password' => $_SESSION["dbpass"]
|
|
||||||
),
|
|
||||||
'sequenceTable' => $_SESSION['dbprefix'] . '_sequence'
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
// host, database, user and password
|
// host, database, user and password
|
||||||
$aOptions = array(
|
$aOptions = ['connection' => ['host' => $_SESSION["dbhost"], 'database' => $_SESSION["dbname"], 'user' => $_SESSION["dbuser"], 'password' => $_SESSION["dbpass"]], 'sequenceTable' => $_SESSION['dbprefix'] . '_sequence'];
|
||||||
'connection' => array(
|
|
||||||
'host' => $_SESSION["dbhost"],
|
|
||||||
'database' => $_SESSION["dbname"],
|
|
||||||
'user' => $_SESSION["dbuser"],
|
|
||||||
'password' => $_SESSION["dbpass"]
|
|
||||||
),
|
|
||||||
'sequenceTable' => $_SESSION['dbprefix'] . '_sequence'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//$aOptions['enableProfiling'] = TRUE;
|
//$aOptions['enableProfiling'] = TRUE;
|
||||||
|
@ -253,7 +232,7 @@ function checkMySQLDropDatabase($db, $database) {
|
||||||
function fetchMySQLStorageEngines($db) {
|
function fetchMySQLStorageEngines($db) {
|
||||||
$db->query("SHOW ENGINES");
|
$db->query("SHOW ENGINES");
|
||||||
|
|
||||||
$engines = array();
|
$engines = [];
|
||||||
|
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
$engines[] = $db->f(0);
|
$engines[] = $db->f(0);
|
||||||
|
|
|
@ -37,118 +37,72 @@ define("E_EXTENSION_AVAILABLE", 1);
|
||||||
define("E_EXTENSION_UNAVAILABLE", 2);
|
define("E_EXTENSION_UNAVAILABLE", 2);
|
||||||
define("E_EXTENSION_CANTCHECK", 3);
|
define("E_EXTENSION_CANTCHECK", 3);
|
||||||
|
|
||||||
/**
|
|
||||||
* getPHPIniSetting ($setting)
|
|
||||||
*
|
|
||||||
* Retrieves the setting $setting from the PHP setup.
|
|
||||||
* Wrapper to avoid warnings if ini_get is in the
|
|
||||||
* disable_functions directive.
|
|
||||||
*/
|
|
||||||
function getPHPIniSetting($setting) {
|
|
||||||
/* Avoid errors if ini_get is in the disable_functions directive */
|
|
||||||
$value = @ini_get($setting);
|
|
||||||
|
|
||||||
return $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* canPHPurlfopen: Checks if PHP is able to use
|
* canPHPurlfopen: Checks if PHP is able to use
|
||||||
* allow_url_fopen.
|
* allow_url_fopen.
|
||||||
*/
|
*/
|
||||||
function canPHPurlfopen() {
|
function canPHPurlfopen(): bool|string
|
||||||
return getPHPIniSetting("allow_url_fopen");
|
{
|
||||||
|
return ini_get("allow_url_fopen");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function getPHPDisplayErrorSetting(): bool|string
|
||||||
* checkPHPiniget: Checks if the ini_get function
|
{
|
||||||
* is available and not disabled. Returns true if the
|
return ini_get("display_errors");
|
||||||
* function is available.
|
|
||||||
*
|
|
||||||
* Uses the PHP configuration value y2k_compilance which
|
|
||||||
* is available in all PHP4 versions.
|
|
||||||
*/
|
|
||||||
function checkPHPiniget() {
|
|
||||||
$value = @ini_get("y2k_compliance");
|
|
||||||
|
|
||||||
if ($value === NULL) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPHPDisplayErrorSetting() {
|
function getPHPFileUploadSetting(): bool|string
|
||||||
return getPHPIniSetting("display_errors");
|
{
|
||||||
|
return ini_get("file_uploads");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPHPFileUploadSetting() {
|
function getPHPGPCOrder(): bool|string
|
||||||
return getPHPIniSetting("file_uploads");
|
{
|
||||||
|
return ini_get("gpc_order");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPHPGPCOrder() {
|
function getPHPMagicQuotesRuntime(): bool|string
|
||||||
return getPHPIniSetting("gpc_order");
|
{
|
||||||
|
return ini_get("magic_quotes_runtime");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPHPMagicQuotesGPC() {
|
function getPHPMagicQuotesSybase(): bool|string
|
||||||
return getPHPIniSetting("magic_quotes_gpc");
|
{
|
||||||
|
return ini_get("magic_quotes_sybase");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPHPMagicQuotesRuntime() {
|
function getPHPMaxExecutionTime(): bool|string
|
||||||
return getPHPIniSetting("magic_quotes_runtime");
|
{
|
||||||
|
return ini_get("max_execution_time");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPHPMagicQuotesSybase() {
|
function getPHPOpenBasedirSetting(): bool|string
|
||||||
return getPHPIniSetting("magic_quotes_sybase");
|
{
|
||||||
|
return ini_get("open_basedir");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPHPMaxExecutionTime() {
|
function checkPHPSQLSafeMode(): bool|string
|
||||||
return getPHPIniSetting("max_execution_time");
|
{
|
||||||
|
return ini_get("sql.safe_mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPHPOpenBasedirSetting() {
|
function return_bytes($val): float|int|string
|
||||||
return getPHPIniSetting("open_basedir");
|
{
|
||||||
}
|
|
||||||
|
|
||||||
function getPHPMaxPostSize() {
|
|
||||||
return getPHPIniSetting("post_max_size");
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkPHPSQLSafeMode() {
|
|
||||||
return getPHPIniSetting("sql.safe_mode");
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkPHPUploadMaxFilesize() {
|
|
||||||
return getPHPIniSetting("upload_max_filesize");
|
|
||||||
}
|
|
||||||
|
|
||||||
function return_bytes($val) {
|
|
||||||
if (strlen($val) == 0) {
|
if (strlen($val) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$val = trim($val);
|
$val = trim($val);
|
||||||
$last = $val[strlen($val) - 1];
|
$last = $val[strlen($val) - 1];
|
||||||
switch ($last) {
|
return match ($last) {
|
||||||
case 'k':
|
'k', 'K' => (int) $val * 1024,
|
||||||
case 'K':
|
'm', 'M' => (int) $val * 1_048_576,
|
||||||
return (int) $val * 1024;
|
default => $val,
|
||||||
break;
|
};
|
||||||
case 'm':
|
|
||||||
case 'M':
|
|
||||||
return (int) $val * 1048576;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return $val;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function isPHPExtensionLoaded($extension) {
|
function isPHPExtensionLoaded($extension) {
|
||||||
$value = extension_loaded($extension);
|
$value = extension_loaded($extension);
|
||||||
|
|
||||||
|
|
||||||
if ($value === NULL) {
|
|
||||||
return E_EXTENSION_CANTCHECK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($value === true) {
|
if ($value === true) {
|
||||||
return E_EXTENSION_AVAILABLE;
|
return E_EXTENSION_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
@ -156,16 +110,10 @@ function isPHPExtensionLoaded($extension) {
|
||||||
if ($value === false) {
|
if ($value === false) {
|
||||||
return E_EXTENSION_UNAVAILABLE;
|
return E_EXTENSION_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function isRegisterLongArraysActive() {
|
if ($value === NULL) {
|
||||||
if (version_compare(phpversion(), "5.0.0", ">=") == true) {
|
return E_EXTENSION_CANTCHECK;
|
||||||
if (getPHPIniSetting("register_long_arrays") == false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -174,12 +122,7 @@ function isRegisterLongArraysActive() {
|
||||||
* @param string $sVersion phpversion to test
|
* @param string $sVersion phpversion to test
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function isPHPCompatible($sVersion = "5.2.0") {
|
function isPHPCompatible($sVersion = "8.0.0"): bool
|
||||||
if (version_compare(phpversion(), $sVersion, ">=") == true) {
|
{
|
||||||
return true;
|
return version_compare(phpversion(), $sVersion, ">=");
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
function getSafeModeStatus ()
|
function getSafeModeStatus ()
|
||||||
{
|
{
|
||||||
if (getPHPIniSetting("safe_mode") == "1")
|
if (ini_get("safe_mode") == "1")
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -44,7 +44,7 @@ function getSafeModeStatus ()
|
||||||
|
|
||||||
function getSafeModeGidStatus ()
|
function getSafeModeGidStatus ()
|
||||||
{
|
{
|
||||||
if (getPHPIniSetting("safe_mode_gid") == "1")
|
if (ini_get("safe_mode_gid") == "1")
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -54,16 +54,16 @@ function getSafeModeGidStatus ()
|
||||||
|
|
||||||
function getSafeModeIncludeDir ()
|
function getSafeModeIncludeDir ()
|
||||||
{
|
{
|
||||||
return getPHPIniSetting("safe_mode_include_dir");
|
return ini_get("safe_mode_include_dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOpenBasedir ()
|
function getOpenBasedir ()
|
||||||
{
|
{
|
||||||
return getPHPIniSetting("open_basedir");
|
return ini_get("open_basedir");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDisabledFunctions ()
|
function getDisabledFunctions ()
|
||||||
{
|
{
|
||||||
return getPHPIniSetting("disable_functions");
|
return ini_get("disable_functions");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -32,7 +32,7 @@ if (!defined('CON_FRAMEWORK')) {
|
||||||
die('Illegal call');
|
die('Illegal call');
|
||||||
}
|
}
|
||||||
|
|
||||||
function injectSQL(&$db, $prefix, $file, &$failedChunks, $replacements = array()) {
|
function injectSQL(&$db, $prefix, $file, &$failedChunks, $replacements = []) {
|
||||||
$file = trim($file);
|
$file = trim($file);
|
||||||
|
|
||||||
if (!isReadable($file)) {
|
if (!isReadable($file)) {
|
||||||
|
@ -56,7 +56,7 @@ function injectSQL(&$db, $prefix, $file, &$failedChunks, $replacements = array()
|
||||||
$db->query($sqlChunk);
|
$db->query($sqlChunk);
|
||||||
|
|
||||||
if ($db->Errno != 0) {
|
if ($db->Errno != 0) {
|
||||||
$failedChunks[] = array("sql" => $sqlChunk, "errno" => $db->Errno, "error" => $db->Error);
|
$failedChunks[] = ["sql" => $sqlChunk, "errno" => $db->Errno, "error" => $db->Error];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,10 +130,10 @@ function split_sql_file($sql, $delimiter) {
|
||||||
|
|
||||||
// try to save mem.
|
// try to save mem.
|
||||||
$sql = "";
|
$sql = "";
|
||||||
$output = array();
|
$output = [];
|
||||||
|
|
||||||
// we don't actually care about the matches preg gives us.
|
// we don't actually care about the matches preg gives us.
|
||||||
$matches = array();
|
$matches = [];
|
||||||
|
|
||||||
// this is faster than calling count($oktens) every time thru the loop.
|
// this is faster than calling count($oktens) every time thru the loop.
|
||||||
$token_count = count($tokens);
|
$token_count = count($tokens);
|
||||||
|
|
|
@ -48,27 +48,13 @@ function checkExistingPlugin($db, $sPluginname) {
|
||||||
$sTable = $_SESSION["dbprefix"] . "_nav_sub";
|
$sTable = $_SESSION["dbprefix"] . "_nav_sub";
|
||||||
$sSql = "";
|
$sSql = "";
|
||||||
|
|
||||||
switch ($sPluginname) {
|
$sSql = match ($sPluginname) {
|
||||||
case 'plugin_conman':
|
'plugin_conman' => "SELECT * FROM %s WHERE idnavs='900'",
|
||||||
$sSql = "SELECT * FROM %s WHERE idnavs='900'";
|
'plugin_content_allocation' => "SELECT * FROM %s WHERE idnavs='800'",
|
||||||
break;
|
'plugin_newsletter' => "SELECT * FROM %s WHERE idnavs='610'",
|
||||||
|
'mod_rewrite' => "SELECT * FROM %s WHERE idnavs='700' OR location='mod_rewrite/xml/;navigation/content/mod_rewrite'",
|
||||||
case 'plugin_content_allocation':
|
default => "",
|
||||||
$sSql = "SELECT * FROM %s WHERE idnavs='800'";
|
};
|
||||||
break;
|
|
||||||
|
|
||||||
case 'plugin_newsletter':
|
|
||||||
$sSql = "SELECT * FROM %s WHERE idnavs='610'";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'mod_rewrite':
|
|
||||||
$sSql = "SELECT * FROM %s WHERE idnavs='700' OR location='mod_rewrite/xml/;navigation/content/mod_rewrite'";
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
$sSql = "";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($sSql) {
|
if ($sSql) {
|
||||||
$db->query(sprintf($sSql, $sTable));
|
$db->query(sprintf($sSql, $sTable));
|
||||||
|
@ -86,21 +72,7 @@ function checkExistingPlugin($db, $sPluginname) {
|
||||||
* @param string $table db-table name
|
* @param string $table db-table name
|
||||||
*/
|
*/
|
||||||
function updateSystemProperties($db, $table) {
|
function updateSystemProperties($db, $table) {
|
||||||
$aStandardvalues = array(array('type' => 'pw_request', 'name' => 'enable', 'value' => 'true'),
|
$aStandardvalues = [['type' => 'pw_request', 'name' => 'enable', 'value' => 'true'], ['type' => 'system', 'name' => 'mail_sender_name', 'value' => 'noreply%40conlite.org'], ['type' => 'system', 'name' => 'mail_sender', 'value' => 'ConLite+Backend'], ['type' => 'system', 'name' => 'mail_host', 'value' => 'localhost'], ['type' => 'maintenance', 'name' => 'mode', 'value' => 'disabled'], ['type' => 'edit_area', 'name' => 'activated', 'value' => 'true'], ['type' => 'update', 'name' => 'check', 'value' => 'false'], ['type' => 'update', 'name' => 'news_feed', 'value' => 'false'], ['type' => 'update', 'name' => 'check_period', 'value' => '60'], ['type' => 'system', 'name' => 'clickmenu', 'value' => 'false'], ['type' => 'versioning', 'name' => 'activated', 'value' => 'true'], ['type' => 'versioning', 'name' => 'prune_limit', 'value' => '0'], ['type' => 'versioning', 'name' => 'path', 'value' => ''], ['type' => 'system', 'name' => 'insight_editing_activated', 'value' => 'true']];
|
||||||
array('type' => 'system', 'name' => 'mail_sender_name', 'value' => 'noreply%40conlite.org'),
|
|
||||||
array('type' => 'system', 'name' => 'mail_sender', 'value' => 'ConLite+Backend'),
|
|
||||||
array('type' => 'system', 'name' => 'mail_host', 'value' => 'localhost'),
|
|
||||||
array('type' => 'maintenance', 'name' => 'mode', 'value' => 'disabled'),
|
|
||||||
array('type' => 'edit_area', 'name' => 'activated', 'value' => 'true'),
|
|
||||||
array('type' => 'update', 'name' => 'check', 'value' => 'false'),
|
|
||||||
array('type' => 'update', 'name' => 'news_feed', 'value' => 'false'),
|
|
||||||
array('type' => 'update', 'name' => 'check_period', 'value' => '60'),
|
|
||||||
array('type' => 'system', 'name' => 'clickmenu', 'value' => 'false'),
|
|
||||||
array('type' => 'versioning', 'name' => 'activated', 'value' => 'true'),
|
|
||||||
array('type' => 'versioning', 'name' => 'prune_limit', 'value' => '0'),
|
|
||||||
array('type' => 'versioning', 'name' => 'path', 'value' => ''),
|
|
||||||
array('type' => 'system', 'name' => 'insight_editing_activated', 'value' => 'true')
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ($aStandardvalues as $aData) {
|
foreach ($aStandardvalues as $aData) {
|
||||||
$sql = "SELECT value FROM %s WHERE type='" . $aData['type'] . "' AND name='" . $aData['name'] . "'";
|
$sql = "SELECT value FROM %s WHERE type='" . $aData['type'] . "' AND name='" . $aData['name'] . "'";
|
||||||
|
@ -163,10 +135,10 @@ function listClients($db, $table) {
|
||||||
|
|
||||||
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
|
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
|
||||||
|
|
||||||
$clients = array();
|
$clients = [];
|
||||||
|
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
$clients[$db->f("idclient")] = array("name" => $db->f("name"), "frontendpath" => $db->f("frontendpath"), "htmlpath" => $db->f("htmlpath"));
|
$clients[$db->f("idclient")] = ["name" => $db->f("name"), "frontendpath" => $db->f("frontendpath"), "htmlpath" => $db->f("htmlpath")];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $clients;
|
return $clients;
|
||||||
|
@ -192,8 +164,8 @@ function getSystemDirectories($bOriginalPath = false) {
|
||||||
|
|
||||||
$root_path = str_replace("\\", "/", $root_path);
|
$root_path = str_replace("\\", "/", $root_path);
|
||||||
|
|
||||||
$root_path = dirname(dirname(dirname($root_path)));
|
$root_path = dirname($root_path, 3);
|
||||||
$root_http_path = dirname(dirname($_SERVER["PHP_SELF"]));
|
$root_http_path = dirname($_SERVER["PHP_SELF"], 2);
|
||||||
|
|
||||||
$root_path = str_replace("\\", "/", $root_path);
|
$root_path = str_replace("\\", "/", $root_path);
|
||||||
$root_http_path = str_replace("\\", "/", $root_http_path);
|
$root_http_path = str_replace("\\", "/", $root_http_path);
|
||||||
|
@ -216,7 +188,7 @@ function getSystemDirectories($bOriginalPath = false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($bOriginalPath == true) {
|
if ($bOriginalPath == true) {
|
||||||
return array($root_path, $root_http_path);
|
return [$root_path, $root_http_path];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_SESSION["override_root_path"])) {
|
if (isset($_SESSION["override_root_path"])) {
|
||||||
|
@ -230,7 +202,7 @@ function getSystemDirectories($bOriginalPath = false) {
|
||||||
$root_path = stripLastSlash($root_path);
|
$root_path = stripLastSlash($root_path);
|
||||||
$root_http_path = stripLastSlash($root_http_path);
|
$root_http_path = stripLastSlash($root_http_path);
|
||||||
|
|
||||||
return array($root_path, $root_http_path);
|
return [$root_path, $root_http_path];
|
||||||
}
|
}
|
||||||
|
|
||||||
function findSimilarText($string1, $string2) {
|
function findSimilarText($string1, $string2) {
|
||||||
|
|
|
@ -33,13 +33,13 @@ if (!defined('CON_FRAMEWORK')) {
|
||||||
define('CON_FRAMEWORK', true);
|
define('CON_FRAMEWORK', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
define('CON_SETUP_PATH', str_replace('\\', '/', realpath(dirname(__FILE__))));
|
define('CON_SETUP_PATH', str_replace('\\', '/', realpath(__DIR__)));
|
||||||
|
|
||||||
define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(dirname(__FILE__) . '/../')));
|
define('CON_FRONTEND_PATH', str_replace('\\', '/', realpath(__DIR__ . '/../')));
|
||||||
|
|
||||||
include_once('lib/startup.php');
|
include_once('lib/startup.php');
|
||||||
|
|
||||||
list($root_path, $root_http_path) = getSystemDirectories();
|
[$root_path, $root_http_path] = getSystemDirectories();
|
||||||
|
|
||||||
$tpl = new Template();
|
$tpl = new Template();
|
||||||
$tpl->set('s', 'CONTENIDO_ROOT', $root_path);
|
$tpl->set('s', 'CONTENIDO_ROOT', $root_path);
|
||||||
|
@ -94,7 +94,7 @@ if ($_SESSION['configmode'] == 'save') {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
header('Content-Type: application/octet-stream');
|
header('Content-Type: application/octet-stream');
|
||||||
header('Etag: ' . md5(mt_rand()));
|
header('Etag: ' . md5(random_int(0, mt_getrandmax())));
|
||||||
header('Content-Disposition: attachment;filename=config.php');
|
header('Content-Disposition: attachment;filename=config.php');
|
||||||
$tpl->generate('templates/config.php.tpl', false, false);
|
$tpl->generate('templates/config.php.tpl', false, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ class cSetupAdditionalPlugins extends cSetupMask {
|
||||||
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please select Plugins to be installed"));
|
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please select Plugins to be installed"));
|
||||||
|
|
||||||
// add new plugins to this array and you're done.
|
// add new plugins to this array and you're done.
|
||||||
$aPlugins = array();
|
$aPlugins = [];
|
||||||
//$aPlugins['plugin_newsletter'] = array('label' => i18n_setup('Newsletter'), 'desc' => i18n_setup('Newsletterfunctionality for dispatching text newsletters and HTML-Newsletters, extensible with professional newsletter extensions. Definition of newsletter recipients and groups of recipients. Layout design of the HTML-Newsletters by ConLite articles.'));
|
//$aPlugins['plugin_newsletter'] = array('label' => i18n_setup('Newsletter'), 'desc' => i18n_setup('Newsletterfunctionality for dispatching text newsletters and HTML-Newsletters, extensible with professional newsletter extensions. Definition of newsletter recipients and groups of recipients. Layout design of the HTML-Newsletters by ConLite articles.'));
|
||||||
//$aPlugins['plugin_content_allocation'] = array('label' => i18n_setup('Content Allocation'), 'desc' => i18n_setup('For the representation and administration of content, 4fb developed the Content Allocation and content include technology. This technology dynamically allows on basis of a Template, to put the content in different places and in different formats according to several criteria.'));
|
//$aPlugins['plugin_content_allocation'] = array('label' => i18n_setup('Content Allocation'), 'desc' => i18n_setup('For the representation and administration of content, 4fb developed the Content Allocation and content include technology. This technology dynamically allows on basis of a Template, to put the content in different places and in different formats according to several criteria.'));
|
||||||
//$aPlugins['plugin_mod_rewrite'] = array('label' => i18n_setup('Mod Rewrite'), 'desc' => i18n_setup('Creates so called Clean URLs for a ConLite installation'));
|
//$aPlugins['plugin_mod_rewrite'] = array('label' => i18n_setup('Mod Rewrite'), 'desc' => i18n_setup('Creates so called Clean URLs for a ConLite installation'));
|
||||||
|
|
|
@ -50,11 +50,11 @@ class cSetupClientAdjust extends cSetupMask {
|
||||||
|
|
||||||
$cHTMLErrorMessageList = new cHTMLErrorMessageList;
|
$cHTMLErrorMessageList = new cHTMLErrorMessageList;
|
||||||
$cHTMLErrorMessageList->setStyle("width: 580px; height: 200px; overflow: auto; border: 1px solid black;");
|
$cHTMLErrorMessageList->setStyle("width: 580px; height: 200px; overflow: auto; border: 1px solid black;");
|
||||||
$cHTMLFoldableErrorMessages = array();
|
$cHTMLFoldableErrorMessages = [];
|
||||||
|
|
||||||
$aPathList = array();
|
$aPathList = [];
|
||||||
|
|
||||||
list($a_root_path, $a_root_http_path) = getSystemDirectories();
|
[$a_root_path, $a_root_http_path] = getSystemDirectories();
|
||||||
|
|
||||||
@include($a_root_path . "data/config/" . CL_ENVIRONMENT . "/config.php");
|
@include($a_root_path . "data/config/" . CL_ENVIRONMENT . "/config.php");
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class cSetupClientAdjust extends cSetupMask {
|
||||||
$oSystemPathBox = new cHTMLTextbox("frontendpath[$iIdClient]", $_SESSION["frontendpath"][$iIdClient]);
|
$oSystemPathBox = new cHTMLTextbox("frontendpath[$iIdClient]", $_SESSION["frontendpath"][$iIdClient]);
|
||||||
$oSystemPathBox->setWidth(100);
|
$oSystemPathBox->setWidth(100);
|
||||||
$oSystemPathBox->setClass("small");
|
$oSystemPathBox->setClass("small");
|
||||||
$oClientSystemPath = new cHTMLInfoMessage(array($sName, $oSystemPathBox), " ");
|
$oClientSystemPath = new cHTMLInfoMessage([$sName, $oSystemPathBox], " ");
|
||||||
$oClientSystemPath->_oTitle->setStyle("padding-left: 8px; padding-bottom: 8px");
|
$oClientSystemPath->_oTitle->setStyle("padding-left: 8px; padding-bottom: 8px");
|
||||||
|
|
||||||
$aPathList[] = $oClientSystemPath;
|
$aPathList[] = $oClientSystemPath;
|
||||||
|
@ -103,7 +103,7 @@ class cSetupClientAdjust extends cSetupMask {
|
||||||
$oSystemPathBox = new cHTMLTextbox("htmlpath[$iIdClient]", $_SESSION["htmlpath"][$iIdClient]);
|
$oSystemPathBox = new cHTMLTextbox("htmlpath[$iIdClient]", $_SESSION["htmlpath"][$iIdClient]);
|
||||||
$oSystemPathBox->setWidth(100);
|
$oSystemPathBox->setWidth(100);
|
||||||
$oSystemPathBox->setClass("small");
|
$oSystemPathBox->setClass("small");
|
||||||
$oClientSystemPath = new cHTMLInfoMessage(array($sName, $oSystemPathBox), " ");
|
$oClientSystemPath = new cHTMLInfoMessage([$sName, $oSystemPathBox], " ");
|
||||||
$oClientSystemPath->_oTitle->setStyle("padding-left: 8px; padding-bottom: 8px");
|
$oClientSystemPath->_oTitle->setStyle("padding-left: 8px; padding-bottom: 8px");
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ class cSetupClientMode extends cSetupMask {
|
||||||
|
|
||||||
cInitializeArrayKey($_SESSION, "clientmode", "");
|
cInitializeArrayKey($_SESSION, "clientmode", "");
|
||||||
|
|
||||||
$aChoices = array();
|
$aChoices = [];
|
||||||
|
|
||||||
$aChoices["CLIENTEXAMPLES"] = "none"; //i18n_setup("Client with example modules and example content");
|
$aChoices["CLIENTEXAMPLES"] = "none"; //i18n_setup("Client with example modules and example content");
|
||||||
$aChoices["CLIENTMODULES"] = "none"; //i18n_setup("Client with example modules, but without example content");
|
$aChoices["CLIENTMODULES"] = "none"; //i18n_setup("Client with example modules, but without example content");
|
||||||
|
|
|
@ -39,13 +39,13 @@ class cSetupPath extends cSetupMask {
|
||||||
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("System Directories"));
|
$this->_oStepTemplate->set("s", "TITLE", i18n_setup("System Directories"));
|
||||||
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please check the directories identified by the system. If you need to change a path, click on the name and enter the new path in the available input box."));
|
$this->_oStepTemplate->set("s", "DESCRIPTION", i18n_setup("Please check the directories identified by the system. If you need to change a path, click on the name and enter the new path in the available input box."));
|
||||||
|
|
||||||
list($root_path, $root_http_path) = getSystemDirectories(true);
|
[$root_path, $root_http_path] = getSystemDirectories(true);
|
||||||
|
|
||||||
$cHTMLErrorMessageList = new cHTMLErrorMessageList;
|
$cHTMLErrorMessageList = new cHTMLErrorMessageList;
|
||||||
$cHTMLErrorMessageList->setStyle("width: 580px; height: 200px; overflow: auto; border: 1px solid black;");
|
$cHTMLErrorMessageList->setStyle("width: 580px; height: 200px; overflow: auto; border: 1px solid black;");
|
||||||
$cHTMLFoldableErrorMessages = array();
|
$cHTMLFoldableErrorMessages = [];
|
||||||
|
|
||||||
list($a_root_path, $a_root_http_path) = getSystemDirectories();
|
[$a_root_path, $a_root_http_path] = getSystemDirectories();
|
||||||
$oRootPath = new cHTMLTextbox("override_root_path", $a_root_path);
|
$oRootPath = new cHTMLTextbox("override_root_path", $a_root_path);
|
||||||
$oRootPath->setWidth(100);
|
$oRootPath->setWidth(100);
|
||||||
$oRootPath->setClass("small");
|
$oRootPath->setClass("small");
|
||||||
|
|
|
@ -37,7 +37,7 @@ class cSetupResults extends cSetupMask {
|
||||||
$this->_oStepTemplate->set("s", "FINISHTEXT", i18n_setup("You can now start using ConLite. Please delete the folder named 'setup'!"));
|
$this->_oStepTemplate->set("s", "FINISHTEXT", i18n_setup("You can now start using ConLite. Please delete the folder named 'setup'!"));
|
||||||
|
|
||||||
|
|
||||||
list($root_path, $root_http_path) = getSystemDirectories();
|
[$root_path, $root_http_path] = getSystemDirectories();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ class cSetupResults extends cSetupMask {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
list($sRootPath, $rootWebPath) = getSystemDirectories();
|
[$sRootPath, $rootWebPath] = getSystemDirectories();
|
||||||
|
|
||||||
if (file_exists($sRootPath . "/data/logs/setuplog.txt")) {
|
if (file_exists($sRootPath . "/data/logs/setuplog.txt")) {
|
||||||
$sErrorLink = '<a target="_blank" href="../data/logs/setuplog.txt">setuplog.txt</a>';
|
$sErrorLink = '<a target="_blank" href="../data/logs/setuplog.txt">setuplog.txt</a>';
|
||||||
|
|
|
@ -64,27 +64,21 @@ class cSetupSetupSummary extends cSetupMask {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$messages = array(
|
$messages = [i18n_setup("Installation type") . ":" => $sType, i18n_setup("Database parameters") . ":" => i18n_setup("Database host") . ": " . $_SESSION["dbhost"] . "<br>" . i18n_setup("Database name") . ": " . $_SESSION["dbname"] . "<br>" . i18n_setup("Database username") . ": " . $_SESSION["dbuser"] . "<br>" . i18n_setup("Database prefix") . ": " . $_SESSION["dbprefix"]];
|
||||||
i18n_setup("Installation type") . ":" => $sType,
|
|
||||||
i18n_setup("Database parameters") . ":" => i18n_setup("Database host") . ": " . $_SESSION["dbhost"] . "<br>" . i18n_setup("Database name") . ": " . $_SESSION["dbname"] . "<br>" . i18n_setup("Database username") . ": " . $_SESSION["dbuser"] . "<br>" . i18n_setup("Database prefix") . ": " . $_SESSION["dbprefix"],
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($_SESSION["setuptype"] == "setup") {
|
if ($_SESSION["setuptype"] == "setup") {
|
||||||
$aChoices = array("CLIENTEXAMPLES" => i18n_setup("Client with example modules and example content"),
|
$aChoices = ["CLIENTEXAMPLES" => i18n_setup("Client with example modules and example content"), "CLIENTMODULES" => i18n_setup("Client with example modules but without example content"), "CLIENT" => i18n_setup("Client without examples"), "NOCLIENT" => i18n_setup("Don't create a client")];
|
||||||
"CLIENTMODULES" => i18n_setup("Client with example modules but without example content"),
|
|
||||||
"CLIENT" => i18n_setup("Client without examples"),
|
|
||||||
"NOCLIENT" => i18n_setup("Don't create a client"));
|
|
||||||
$messages[i18n_setup("Client installation") . ":"] = $aChoices[$_SESSION["clientmode"]];
|
$messages[i18n_setup("Client installation") . ":"] = $aChoices[$_SESSION["clientmode"]];
|
||||||
}
|
}
|
||||||
|
|
||||||
// additional plugins
|
// additional plugins
|
||||||
$aPlugins = $this->_getSelectedAdditionalPlugins();
|
$aPlugins = $this->_getSelectedAdditionalPlugins();
|
||||||
if (count($aPlugins) > 0) {
|
if ((is_countable($aPlugins) ? count($aPlugins) : 0) > 0) {
|
||||||
$messages[i18n_setup("Additional Plugins") . ":"] = implode('<br>', $aPlugins);
|
$messages[i18n_setup("Additional Plugins") . ":"] = implode('<br>', $aPlugins);
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cHTMLFoldableErrorMessages = array();
|
$cHTMLFoldableErrorMessages = [];
|
||||||
|
|
||||||
foreach ($messages as $key => $message) {
|
foreach ($messages as $key => $message) {
|
||||||
$cHTMLFoldableErrorMessages[] = new cHTMLInfoMessage($key, $message);
|
$cHTMLFoldableErrorMessages[] = new cHTMLInfoMessage($key, $message);
|
||||||
|
@ -98,7 +92,7 @@ class cSetupSetupSummary extends cSetupMask {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _getSelectedAdditionalPlugins() {
|
public function _getSelectedAdditionalPlugins() {
|
||||||
$aPlugins = array();
|
$aPlugins = [];
|
||||||
if (isset($_SESSION['plugin_newsletter']) && $_SESSION['plugin_newsletter'] == 'true') {
|
if (isset($_SESSION['plugin_newsletter']) && $_SESSION['plugin_newsletter'] == 'true') {
|
||||||
$aPlugins[] = i18n_setup('Newsletter');
|
$aPlugins[] = i18n_setup('Newsletter');
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ class cSetupSystemData extends cSetupMask {
|
||||||
public function __construct($step, $previous, $next) {
|
public function __construct($step, $previous, $next) {
|
||||||
parent::__construct("templates/setup/forms/systemdata.tpl", $step);
|
parent::__construct("templates/setup/forms/systemdata.tpl", $step);
|
||||||
|
|
||||||
list($a_root_path, $a_root_http_path) = getSystemDirectories();
|
[$a_root_path, $a_root_http_path] = getSystemDirectories();
|
||||||
|
|
||||||
cInitializeArrayKey($_SESSION, "dbprefix", "");
|
cInitializeArrayKey($_SESSION, "dbprefix", "");
|
||||||
cInitializeArrayKey($_SESSION, "dbhost", "");
|
cInitializeArrayKey($_SESSION, "dbhost", "");
|
||||||
|
@ -58,11 +58,7 @@ class cSetupSystemData extends cSetupMask {
|
||||||
@include($a_root_path . "/data/config/" . CL_ENVIRONMENT . "/config.php");
|
@include($a_root_path . "/data/config/" . CL_ENVIRONMENT . "/config.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
$aVars = array("dbhost" => $contenido_host,
|
$aVars = ["dbhost" => $contenido_host, "dbuser" => $contenido_user, "dbname" => $contenido_database, "dbpass" => $contenido_password, "dbprefix" => $cfg["sql"]["sqlprefix"]];
|
||||||
"dbuser" => $contenido_user,
|
|
||||||
"dbname" => $contenido_database,
|
|
||||||
"dbpass" => $contenido_password,
|
|
||||||
"dbprefix" => $cfg["sql"]["sqlprefix"]);
|
|
||||||
|
|
||||||
foreach ($aVars as $aVar => $sValue) {
|
foreach ($aVars as $aVar => $sValue) {
|
||||||
if ($_SESSION[$aVar] == "") {
|
if ($_SESSION[$aVar] == "") {
|
||||||
|
|
|
@ -34,7 +34,7 @@ class cSetupSystemtest extends cSetupMask {
|
||||||
|
|
||||||
$cHTMLErrorMessageList = new cHTMLErrorMessageList;
|
$cHTMLErrorMessageList = new cHTMLErrorMessageList;
|
||||||
|
|
||||||
$this->_aMessages = array();
|
$this->_aMessages = [];
|
||||||
|
|
||||||
/* Run PHP tests */
|
/* Run PHP tests */
|
||||||
$this->doPHPTests();
|
$this->doPHPTests();
|
||||||
|
@ -58,7 +58,7 @@ class cSetupSystemtest extends cSetupMask {
|
||||||
$this->doExistingOldPluginTests();
|
$this->doExistingOldPluginTests();
|
||||||
}
|
}
|
||||||
|
|
||||||
$cHTMLFoldableErrorMessages = array();
|
$cHTMLFoldableErrorMessages = [];
|
||||||
|
|
||||||
foreach ($this->_aMessages as $iSeverity => $aMessageEntry) {
|
foreach ($this->_aMessages as $iSeverity => $aMessageEntry) {
|
||||||
switch ($iSeverity) {
|
switch ($iSeverity) {
|
||||||
|
@ -99,7 +99,7 @@ class cSetupSystemtest extends cSetupMask {
|
||||||
$sMessage = '';
|
$sMessage = '';
|
||||||
|
|
||||||
//get all tables in database and list it into array
|
//get all tables in database and list it into array
|
||||||
$aAvariableTableNames = array();
|
$aAvariableTableNames = [];
|
||||||
$aTableNames = $db->table_names();
|
$aTableNames = $db->table_names();
|
||||||
|
|
||||||
//print_r($db);
|
//print_r($db);
|
||||||
|
@ -112,10 +112,7 @@ class cSetupSystemtest extends cSetupMask {
|
||||||
}
|
}
|
||||||
|
|
||||||
//list of plugin tables to copy into new plugin tables
|
//list of plugin tables to copy into new plugin tables
|
||||||
$aOldPluginTables = array('Workflow' => array('piwf_actions', 'piwf_allocation', 'piwf_art_allocation',
|
$aOldPluginTables = ['Workflow' => ['piwf_actions', 'piwf_allocation', 'piwf_art_allocation', 'piwf_items', 'piwf_user_sequences', 'piwf_workflow'], 'Content Allocation' => ['pica_alloc', 'pica_alloc_con', 'pica_lang'], 'Linkchecker' => ['pi_externlinks', 'pi_linkwhitelist']];
|
||||||
'piwf_items', 'piwf_user_sequences', 'piwf_workflow'),
|
|
||||||
'Content Allocation' => array('pica_alloc', 'pica_alloc_con', 'pica_lang'),
|
|
||||||
'Linkchecker' => array('pi_externlinks', 'pi_linkwhitelist'));
|
|
||||||
|
|
||||||
foreach ($aOldPluginTables as $sPlugin => $aTables) {
|
foreach ($aOldPluginTables as $sPlugin => $aTables) {
|
||||||
$bPluginExists = false;
|
$bPluginExists = false;
|
||||||
|
@ -162,7 +159,7 @@ class cSetupSystemtest extends cSetupMask {
|
||||||
* @todo: Store results into an external file
|
* @todo: Store results into an external file
|
||||||
*/
|
*/
|
||||||
if ($mResult == false && $iSeverity != C_SEVERITY_NONE) {
|
if ($mResult == false && $iSeverity != C_SEVERITY_NONE) {
|
||||||
$this->_aMessages[$iSeverity][] = array($sHeadline, $sErrorMessage);
|
$this->_aMessages[$iSeverity][] = [$sHeadline, $sErrorMessage];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +207,7 @@ class cSetupSystemtest extends cSetupMask {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$iMemoryLimit = return_bytes(getPHPIniSetting("memory_limit"));
|
$iMemoryLimit = return_bytes(ini_get("memory_limit"));
|
||||||
|
|
||||||
if ($iMemoryLimit > 0) {
|
if ($iMemoryLimit > 0) {
|
||||||
$this->runTest(($iMemoryLimit > 1024 * 1024 * 32), C_SEVERITY_WARNING, i18n_setup("PHP memory_limit directive too small"), i18n_setup("The memory_limit directive is set to 32 MB or lower. This might be not enough for ConLite to operate correctly. We recommend to disable this setting completely, as this can cause problems with large ConLite projects."));
|
$this->runTest(($iMemoryLimit > 1024 * 1024 * 32), C_SEVERITY_WARNING, i18n_setup("PHP memory_limit directive too small"), i18n_setup("The memory_limit directive is set to 32 MB or lower. This might be not enough for ConLite to operate correctly. We recommend to disable this setting completely, as this can cause problems with large ConLite projects."));
|
||||||
|
@ -261,7 +258,7 @@ class cSetupSystemtest extends cSetupMask {
|
||||||
|
|
||||||
public function doMySQLTests() {
|
public function doMySQLTests() {
|
||||||
|
|
||||||
list($handle, $status) = doMySQLConnect($_SESSION["dbhost"], $_SESSION["dbuser"], $_SESSION["dbpass"]);
|
[$handle, $status] = doMySQLConnect($_SESSION["dbhost"], $_SESSION["dbuser"], $_SESSION["dbpass"]);
|
||||||
|
|
||||||
if (hasMySQLiExtension() && !hasMySQLExtension()) {
|
if (hasMySQLiExtension() && !hasMySQLExtension()) {
|
||||||
$sErrorMessage = mysqli_error($handle->Link_ID);
|
$sErrorMessage = mysqli_error($handle->Link_ID);
|
||||||
|
@ -507,6 +504,7 @@ class cSetupSystemtest extends cSetupMask {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logFilePrediction($sFile, $iSeverity = C_SEVERITY_WARNING) {
|
public function logFilePrediction($sFile, $iSeverity = C_SEVERITY_WARNING) {
|
||||||
|
$sPredictMessage = null;
|
||||||
$status = canWriteFile("../" . $sFile);
|
$status = canWriteFile("../" . $sFile);
|
||||||
$sTitle = sprintf(i18n_setup("Can't write %s"), $sFile);
|
$sTitle = sprintf(i18n_setup("Can't write %s"), $sFile);
|
||||||
$sMessage = sprintf(i18n_setup("Setup or ConLite can't write to the file %s. Please change the file permissions to correct this problem."), $sFile);
|
$sMessage = sprintf(i18n_setup("Setup or ConLite can't write to the file %s. Please change the file permissions to correct this problem."), $sFile);
|
||||||
|
|
|
@ -45,7 +45,7 @@ class cSetupLanguageChooser extends cSetupMask {
|
||||||
$this->_oStepTemplate->set("s", "DE_HINT_LANG", "Wählen Sie bitte die gewünschte Sprache für das Setup aus.");
|
$this->_oStepTemplate->set("s", "DE_HINT_LANG", "Wählen Sie bitte die gewünschte Sprache für das Setup aus.");
|
||||||
$this->_oStepTemplate->set("s", "EN_HINT_LANG", "Please choose your language to continue.");
|
$this->_oStepTemplate->set("s", "EN_HINT_LANG", "Please choose your language to continue.");
|
||||||
|
|
||||||
$langs = array("de_DE" => "Deutsch", "C" => "English");
|
$langs = ["de_DE" => "Deutsch", "C" => "English"];
|
||||||
|
|
||||||
$m = "";
|
$m = "";
|
||||||
|
|
||||||
|
|
Laden…
In neuem Issue referenzieren