fixes PHP 7.3; setup updates for PHP >= 7,0

Dieser Commit ist enthalten in:
Oldperl 2019-07-23 11:00:58 +00:00
Ursprung b72e0d30f5
Commit 450ad630b5
2 geänderte Dateien mit 802 neuen und 807 gelöschten Zeilen

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -25,272 +26,271 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) { die('Illegal call');
die('Illegal call');
} }
class VersionImport extends Version { class VersionImport extends Version {
/** /**
* The name of modul * The name of modul
* @access private * @access private
*/ */
private $sName; private $sName;
/** /**
* Error Output * Error Output
* @access private * @access private
*/ */
private $sError; private $sError;
/** /**
* Description of modul * Description of modul
* @access private * @access private
*/ */
private $sDescripion; private $sDescripion;
/** /**
* Information of deletable * Information of deletable
* @access private * @access private
*/ */
private $bDeletabel; private $bDeletabel;
/** /**
* Code Input * Code Input
* @access private * @access private
*/ */
private $sCodeInput; private $sCodeInput;
/** /**
* Code Output * Code Output
* @access private * @access private
*/ */
private $sCodeOutput; private $sCodeOutput;
/** /**
* Template name of modul * Template name of modul
* @access public * @access public
*/ */
public $sTemplate; public $sTemplate;
/** /**
* static * static
* @access private * @access private
*/ */
private $sStatic; private $sStatic;
/** /**
* Information about package guid * Information about package guid
* @access private * @access private
*/ */
private $sPackageGuid; private $sPackageGuid;
/** /**
* Information of package data * Information of package data
* @access private * @access private
*/ */
private $sPackageData; private $sPackageData;
/** /**
* Type of modul * Type of modul
* @access public * @access public
*/ */
public $sModType; public $sModType;
/** /**
* Array contents all version information * Array contents all version information
* @access public * @access public
*/ */
private $aCreateVersion; private $aCreateVersion;
/** /**
* Check variable for look version number * Check variable for look version number
* @access public * @access public
*/ */
private $iWert; private $iWert;
/** /**
* Table name of mod_history * Table name of mod_history
* @access public * @access public
*/ */
private $sTableName; private $sTableName;
/** /**
* The class versionImport object constructor, initializes class variables * The class versionImport object constructor, initializes class variables
* *
* @param string $iIdMod The name of style file * @param string $iIdMod The name of style file
* @param array $aCfg * @param array $aCfg
* @param array $aCfgClient * @param array $aCfgClient
* @param object $oDB * @param object $oDB
* @param integer $iClient * @param integer $iClient
* @param object $sArea * @param object $sArea
* @param object $iFrame * @param object $iFrame
* *
* @return void its only initialize class members * @return void its only initialize class members
*/ */
public function __construct($aCfg, $aCfgClient, $oDB, $iClient, $sArea, $iFrame) { public function __construct($aCfg, $aCfgClient, $oDB, $iClient, $sArea, $iFrame) {
// Set globals in main class // Set globals in main class
$this->aCfgClient = $aCfgClient; $this->aCfgClient = $aCfgClient;
$this->oDB = $oDB; $this->oDB = $oDB;
if(!is_object($this->oDB))
$this->oDB = new DB_ConLite;
// folder layout
$this->sType = "module";
if(isset($_SESSION["dbprefix"])){
$this->sTableName = $_SESSION["dbprefix"]."_mod_history";
} else {
$this->sTableName = $this->aCfg['sql']['sqlprefix']."_mod_history";
}
// init class member
$this->aCreateVesion = array();
// Init class members with table con_history
$this->getModuleHistoryTable();
} // end of constructor
/**
* Creats xml files from table mod_history if exists any rows. After create a version it will be delete the current row.
* If no rows any available, it will be drop the table mod_history.
*
* @return void
*/
public function CreateHistoryVersion() {
if($this->getRows() > 0) {
// Sort the version files true
ksort($this->aCreateVersion);
// All array read
foreach( $this->aCreateVersion as $sKey=>$sLevelOne) {
foreach($sLevelOne as $sKey2=>$sLevelTwo) {
if (is_array($this->aCfgClient[$sKey])) {
parent::__construct($aCfg, $this->aCfgClient, $this->oDB, $sKey, $sArea, $iFrame);
foreach($sLevelTwo as $sKey3=>$sLevelThree) { if (!is_object($this->oDB))
$this->iIdentity = $sKey2; $this->oDB = new DB_ConLite;
$this->sName = Contenido_Security::unFilter($sLevelThree["name"]);
$this->sModType = Contenido_Security::unFilter($sLevelThree["type"]); // folder layout
$this->sError = Contenido_Security::unFilter($sLevelThree["error"]); $this->sType = "module";
$this->sDescripion = Contenido_Security::unFilter($sLevelThree["description"]);
$this->sDeletabel = Contenido_Security::unFilter($sLevelThree ["deletable"]);
$this->sCodeInput = Contenido_Security::unFilter($sLevelThree ["input"]); if (isset($_SESSION["dbprefix"])) {
$this->sCodeOutput = Contenido_Security::unFilter($sLevelThree ["output"]); $this->sTableName = $_SESSION["dbprefix"] . "_mod_history";
$this->sTemplate = Contenido_Security::unFilter($sLevelThree["template"]); } else {
$this->sStatic = Contenido_Security::unFilter($sLevelThree["static"]); $this->sTableName = $this->aCfg['sql']['sqlprefix'] . "_mod_history";
$this->sPackageGuid = Contenido_Security::unFilter($sLevelThree["package_guid"]); }
$this->sPackageData = Contenido_Security::unFilter($sLevelThree["package_data"]); // init class member
$this->sAuthor = Contenido_Security::unFilter($sLevelThree["changedby"]); $this->aCreateVesion = array();
$this->dCreated = Contenido_Security::unFilter($sLevelThree["created"]);
$this->dLastModified = Contenido_Security::unFilter($sLevelThree["changed"]); // Init class members with table con_history
$this->dActualTimestamp = Contenido_Security::unFilter($sLevelThree["changed"]); $this->getModuleHistoryTable();
}
$this->initRevisions();
// end of constructor
$this->createBodyXML();
/**
if($this->createNewVersion()) { * Creats xml files from table mod_history if exists any rows. After create a version it will be delete the current row.
$this->deleteRows($sLevelThree["idmodhistory"]); * If no rows any available, it will be drop the table mod_history.
} *
} * @return void
*/
public function CreateHistoryVersion() {
if ($this->getRows() > 0) {
// Sort the version files true
ksort($this->aCreateVersion);
// All array read
foreach ($this->aCreateVersion as $sKey => $sLevelOne) {
foreach ($sLevelOne as $sKey2 => $sLevelTwo) {
if (is_array($this->aCfgClient[$sKey])) {
parent::__construct($aCfg, $this->aCfgClient, $this->oDB, $sKey, $sArea, $iFrame);
foreach ($sLevelTwo as $sKey3 => $sLevelThree) {
$this->iIdentity = $sKey2;
$this->sName = Contenido_Security::unFilter($sLevelThree["name"]);
$this->sModType = Contenido_Security::unFilter($sLevelThree["type"]);
$this->sError = Contenido_Security::unFilter($sLevelThree["error"]);
$this->sDescripion = Contenido_Security::unFilter($sLevelThree["description"]);
$this->sDeletabel = Contenido_Security::unFilter($sLevelThree ["deletable"]);
$this->sCodeInput = Contenido_Security::unFilter($sLevelThree ["input"]);
$this->sCodeOutput = Contenido_Security::unFilter($sLevelThree ["output"]);
$this->sTemplate = Contenido_Security::unFilter($sLevelThree["template"]);
$this->sStatic = Contenido_Security::unFilter($sLevelThree["static"]);
$this->sPackageGuid = Contenido_Security::unFilter($sLevelThree["package_guid"]);
$this->sPackageData = Contenido_Security::unFilter($sLevelThree["package_data"]);
$this->sAuthor = Contenido_Security::unFilter($sLevelThree["changedby"]);
$this->dCreated = Contenido_Security::unFilter($sLevelThree["created"]);
$this->dLastModified = Contenido_Security::unFilter($sLevelThree["changed"]);
$this->dActualTimestamp = Contenido_Security::unFilter($sLevelThree["changed"]);
$this->initRevisions();
$this->createBodyXML();
if ($this->createNewVersion()) {
$this->deleteRows($sLevelThree["idmodhistory"]);
}
}
} }
} }
}// end of foreach }// end of foreach
} }
if($this->getRows() == 0) { if ($this->getRows() == 0) {
$this->dropTable(); $this->dropTable();
} }
} }
/**
/** * Function reads rows variables from table con_mod and init with the class members.
* Function reads rows variables from table con_mod and init with the class members. *
* * @return void
* @return void */
*/ private function getModuleHistoryTable() {
private function getModuleHistoryTable() { $sSql = "";
$sSql = ""; $sSql = "SELECT *
$sSql = "SELECT * FROM " . $this->sTableName;
FROM ". $this->sTableName; $this->oDB->query($sSql);
$this->oDB->query($sSql);
// save mod_history in three dimension array // save mod_history in three dimension array
while($this->oDB->next_record()) { while ($this->oDB->next_record()) {
$this->aCreateVersion[$this->oDB->f("idclient")][$this->oDB->f("idmod")][$this->oDB->f("idmodhistory")] = $this->aCreateVersion[$this->oDB->f("idclient")][$this->oDB->f("idmod")][$this->oDB->f("idmodhistory")] = array("idmodhistory" => $this->oDB->f("idmodhistory"), "idmod" => $this->oDB->f("idmod"),
array("idmodhistory"=>$this->oDB->f("idmodhistory"), "idmod"=>$this->oDB->f("idmod"), "idclient" => $this->oDB->f("idclient"), "name" => $this->oDB->f("name"),
"idclient"=>$this->oDB->f("idclient"), "name"=>$this->oDB->f("name"), "type" => $this->oDB->f("type"), "description" => $this->oDB->f("description"),
"type"=>$this->oDB->f("type"), "description"=>$this->oDB->f("description"), "input" => $this->oDB->f("input"), "output" => $this->oDB->f("output"),
"input"=>$this->oDB->f("input"), "output"=>$this->oDB->f("output"), "template" => $this->oDB->f("template"), "changedby" => $this->oDB->f("changedby"),
"template"=>$this->oDB->f("template"), "changedby"=>$this->oDB->f("changedby"), "changed" => $this->oDB->f("changed"));
"changed"=>$this->oDB->f("changed")); }
} }
} // end of function
// end of function
/**
* Set with the body nodes of xml file /**
* * Set with the body nodes of xml file
* @return void *
*/ * @return void
private function createBodyXML() { */
private function createBodyXML() {
// Create Body Node of Xml File // Create Body Node of Xml File
$this->setData("Name", $this->sName); $this->setData("Name", $this->sName);
$this->setData("Modul_Type", $this->sModType); $this->setData("Modul_Type", $this->sModType);
$this->setData("Error", $this->sError); $this->setData("Error", $this->sError);
$this->setData("Description", $this->sDescripion); $this->setData("Description", $this->sDescripion);
$this->setData("Deletable", $this->bDeletabel); $this->setData("Deletable", $this->bDeletabel);
$this->setData("CodeInput", $this->sCodeInput); $this->setData("CodeInput", $this->sCodeInput);
$this->setData("CodeOutput", $this->sCodeOutput); $this->setData("CodeOutput", $this->sCodeOutput);
$this->setData("Template", $this->sTemplate); $this->setData("Template", $this->sTemplate);
$this->setData("Static", $this->sStatic); $this->setData("Static", $this->sStatic);
$this->setData("PackageGuid", $this->sPackageGuid); $this->setData("PackageGuid", $this->sPackageGuid);
$this->setData("PackageData", $this->sPackageData); $this->setData("PackageData", $this->sPackageData);
}
}
/**
/** * Get all rows in tabel mod_con_history
* Get all rows in tabel mod_con_history *
* * @return integer count of rows
* @return integer count of rows */
*/ private function getRows() {
private function getRows() { $sSqlCount = "";
$sSqlCount = ""; $iAnz = 0;
$iAnz = 0; $sSqlCount = "SELECT * FROM " . $this->sTableName;
$sSqlCount = "SELECT * FROM ". $this->sTableName;
$this->oDB->query($sSqlCount); $this->oDB->query($sSqlCount);
$iAnz = $this->oDB->num_rows(); $iAnz = $this->oDB->num_rows();
return $iAnz;
}
/**
* Drops table if table exists
*
* @return void
*/
public function dropTable() {
$sSqlDropTable = "";
$sSqlDropTable = "DROP TABLE IF EXISTS ". $this->sTableName;
$this->oDB->query($sSqlDropTable);
}
/**
* Deletes the row wich id of mod_history
*
* @return void
*/
public function deleteRows($iModHistory) {
$iModHistory = Contenido_Security::unFilter($iModHistory);
$sSql2 = "DELETE FROM ". $this->sTableName .
" WHERE idmodhistory = ". $iModHistory;
$this->oDB->query($sSql2);
}
} return $iAnz;
}
/**
* Drops table if table exists
*
* @return void
*/
public function dropTable() {
$sSqlDropTable = "";
$sSqlDropTable = "DROP TABLE IF EXISTS " . $this->sTableName;
$this->oDB->query($sSqlDropTable);
}
/**
* Deletes the row wich id of mod_history
*
* @return void
*/
public function deleteRows($iModHistory) {
$iModHistory = Contenido_Security::unFilter($iModHistory);
$sSql2 = "DELETE FROM " . $this->sTableName .
" WHERE idmodhistory = " . $iModHistory;
$this->oDB->query($sSql2);
}
}
?> ?>