fixes for release

Dieser Commit ist enthalten in:
Oldperl 2017-09-04 11:21:17 +00:00
Ursprung 102b122972
Commit e019a10640
6 geänderte Dateien mit 182 neuen und 572 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,6 @@
DELETE FROM !PREFIX!_nav_main WHERE idnavm < 10000;
INSERT INTO !PREFIX!_nav_main VALUES('5', 'administration', 'navigation/administration/main');
INSERT INTO !PREFIX!_nav_main VALUES('4', 'statistic', 'navigation/statistic/main');
INSERT INTO !PREFIX!_nav_main VALUES('2', 'style', 'navigation/style/main');
INSERT INTO !PREFIX!_nav_main VALUES('1', 'content', 'navigation/content/main');
INSERT INTO !PREFIX!_nav_main VALUES('3', 'extra', 'navigation/extra/main');
INSERT INTO !PREFIX!_nav_main VALUES('5', 'navigation/administration/main', 'administration');
INSERT INTO !PREFIX!_nav_main VALUES('4', 'navigation/statistic/main', 'statistic');
INSERT INTO !PREFIX!_nav_main VALUES('2', 'navigation/style/main', 'style');
INSERT INTO !PREFIX!_nav_main VALUES('1', 'navigation/content/main', 'content');
INSERT INTO !PREFIX!_nav_main VALUES('3', 'navigation/extra/main', 'extra');

Dateidiff unterdrückt, weil mindestens eine Zeile zu lang ist

Datei anzeigen

@ -291,8 +291,8 @@
"mod_translations";"original";"text";"NO";"";"";"";""
"mod_translations";"translation";"text";"NO";"";"";"";""
"nav_main";"idnavm";"int(10)";"NO";"PRI";"0";"";"1"
"nav_main";"name";"varchar(255)";"NO";"";"";"";""
"nav_main";"location";"varchar(255)";"NO";"";"";"";""
"nav_main";"name";"varchar(255)";"NO";"";"";"";""
"nav_sub";"idnavs";"int(10)";"NO";"PRI";"0";"";"1"
"nav_sub";"idnavm";"int(10)";"NO";"";"0";"";""
"nav_sub";"idarea";"int(10)";"NO";"";"0";"";""

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -29,55 +30,53 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
//Fuction checks if a plugin is already installed
function checkExistingPlugin($db, $sPluginname) {
#new install: all plugins are checked
if ($_SESSION["setuptype"] == "setup") {
return true;
}
$sPluginname = (string)$sPluginname;
$sTable = $_SESSION["dbprefix"]."_nav_sub";
$sPluginname = (string) $sPluginname;
$sTable = $_SESSION["dbprefix"] . "_nav_sub";
$sSql = "";
switch ($sPluginname) {
case 'plugin_conman':
$sSql = "SELECT * FROM %s WHERE idnavs='900'";
break;
case 'plugin_content_allocation':
$sSql = "SELECT * FROM %s WHERE idnavs='800'";
break;
break;
case 'plugin_newsletter':
$sSql = "SELECT * FROM %s WHERE idnavs='610'";
break;
$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;
$sSql = "SELECT * FROM %s WHERE idnavs='700' OR location='mod_rewrite/xml/;navigation/content/mod_rewrite'";
break;
default:
$sSql = "";
break;
}
if ($sSql) {
$db->query(sprintf($sSql, $sTable));
if ($db->next_record()) {
return true;
}
}
return false;
}
@ -87,237 +86,211 @@ function checkExistingPlugin($db, $sPluginname) {
* @param string $table db-table name
*/
function updateSystemProperties($db, $table) {
$aStandardvalues = array ( array('type' => 'pw_request', 'name' => 'enable', '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')
);
$aStandardvalues = array(array('type' => 'pw_request', 'name' => 'enable', '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) {
$sql = "SELECT value FROM %s WHERE type='".$aData['type']."' AND name='".$aData['name']."'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
$sql = "SELECT value FROM %s WHERE type='" . $aData['type'] . "' AND name='" . $aData['name'] . "'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
if ($db->next_record()) {
$sValue = $db->f('value');
if ($sValue == '') {
$sql = "UPDATE %s SET value = '%s' WHERE type='%s' AND name='%s'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), $aData['value'], $aData['type'], $aData['name']));
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), $aData['value'], $aData['type'], $aData['name']));
}
} else {
$id = $db->nextid($table);
$sql = "INSERT INTO %s SET idsystemprop = '%s', type='%s', name='%s', value='%s'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), $id, $aData['type'], $aData['name'], $aData['value']));
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), $id, $aData['type'], $aData['name'], $aData['value']));
}
}
}
function updateContenidoVersion ($db, $table, $version)
{
$sql = "SELECT idsystemprop FROM %s WHERE type='system' AND name='version'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
if ($db->next_record())
{
$sql = "UPDATE %s SET value = '%s' WHERE type='system' AND name='version'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), Contenido_Security::escapeDB($version, $db)));
} else {
$id = $db->nextid($table);
$sql = "INSERT INTO %s SET idsystemprop = '%s', type='system', name='version', value='%s'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), $id, Contenido_Security::escapeDB($version, $db)));
}
function updateContenidoVersion($db, $table, $version) {
$sql = "SELECT idsystemprop FROM %s WHERE type='system' AND name='version'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
if ($db->next_record()) {
$sql = "UPDATE %s SET value = '%s' WHERE type='system' AND name='version'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), Contenido_Security::escapeDB($version, $db)));
} else {
$id = $db->nextid($table);
$sql = "INSERT INTO %s SET idsystemprop = '%s', type='system', name='version', value='%s'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), $id, Contenido_Security::escapeDB($version, $db)));
}
}
function getContenidoVersion ($db, $table)
{
$sql = "SELECT value FROM %s WHERE type='system' AND name='version'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
if ($db->next_record())
{
return $db->f("value");
} else {
return false;
}
function getContenidoVersion($db, $table) {
$sql = "SELECT value FROM %s WHERE type='system' AND name='version'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
if ($db->next_record()) {
return $db->f("value");
} else {
return false;
}
}
function updateSysadminPassword ($db, $table, $password)
{
$sql = "SELECT password FROM %s WHERE username='sysadmin'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
function updateSysadminPassword($db, $table, $password) {
$sql = "SELECT password FROM %s WHERE username='sysadmin'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
if ($db->next_record())
{
$sql = "UPDATE %s SET password='%s' WHERE username='sysadmin'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), md5($password)));
return true;
} else {
return false;
}
if ($db->next_record()) {
$sql = "UPDATE %s SET password='%s' WHERE username='sysadmin'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), md5($password)));
return true;
} else {
return false;
}
}
function listClients ($db, $table)
{
$sql = "SELECT idclient, name, frontendpath, htmlpath FROM %s";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
$clients = array();
while ($db->next_record())
{
$clients[$db->f("idclient")] = array("name" => $db->f("name"), "frontendpath" => $db->f("frontendpath"), "htmlpath" => $db->f("htmlpath"));
}
return $clients;
function listClients($db, $table) {
$sql = "SELECT idclient, name, frontendpath, htmlpath FROM %s";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
$clients = array();
while ($db->next_record()) {
$clients[$db->f("idclient")] = array("name" => $db->f("name"), "frontendpath" => $db->f("frontendpath"), "htmlpath" => $db->f("htmlpath"));
}
return $clients;
}
function updateClientPath ($db, $table, $idclient, $frontendpath, $htmlpath)
{
$sql = "UPDATE %s SET frontendpath='%s', htmlpath='%s' WHERE idclient='%s'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), Contenido_Security::escapeDB($frontendpath, $db), Contenido_Security::escapeDB($htmlpath, $db), Contenido_Security::escapeDB($idclient, $db)));
function updateClientPath($db, $table, $idclient, $frontendpath, $htmlpath) {
$sql = "UPDATE %s SET frontendpath='%s', htmlpath='%s' WHERE idclient='%s'";
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), Contenido_Security::escapeDB($frontendpath, $db), Contenido_Security::escapeDB($htmlpath, $db), Contenido_Security::escapeDB($idclient, $db)));
}
function stripLastSlash ($sInput)
{
if (substr($sInput, strlen($sInput)-1,1) == "/")
{
$sInput = substr($sInput, 0, strlen($sInput)-1);
}
return $sInput;
function stripLastSlash($sInput) {
if (substr($sInput, strlen($sInput) - 1, 1) == "/") {
$sInput = substr($sInput, 0, strlen($sInput) - 1);
}
return $sInput;
}
function getSystemDirectories ($bOriginalPath = false)
{
$root_path = __FILE__;
function getSystemDirectories($bOriginalPath = false) {
$root_path = str_replace("\\", "/", $root_path);
$root_path = dirname(dirname(dirname($root_path)));
$root_http_path = dirname(dirname($_SERVER["PHP_SELF"]));
$root_path = str_replace("\\", "/", $root_path);
$root_http_path = str_replace("\\", "/", $root_http_path);
$port = "";
$protocol = "http://";
if ($_SERVER["SERVER_PORT"] != 80)
{
if ($_SERVER["SERVER_PORT"] == 443)
{
$protocol = "https://";
} else {
$port = ":".$_SERVER["SERVER_PORT"];
}
}
$root_http_path = $protocol . $_SERVER["SERVER_NAME"].$port . $root_http_path;
if (substr($root_http_path, strlen($root_http_path)-1,1) == "/")
{
$root_http_path = substr($root_http_path, 0, strlen($root_http_path)-1);
$root_path = __FILE__;
$root_path = str_replace("\\", "/", $root_path);
$root_path = dirname(dirname(dirname($root_path)));
$root_http_path = dirname(dirname($_SERVER["PHP_SELF"]));
$root_path = str_replace("\\", "/", $root_path);
$root_http_path = str_replace("\\", "/", $root_http_path);
$port = "";
$protocol = "http://";
if ($_SERVER["SERVER_PORT"] != 80) {
if ($_SERVER["SERVER_PORT"] == 443) {
$protocol = "https://";
} else {
$port = ":" . $_SERVER["SERVER_PORT"];
}
if ($bOriginalPath == true)
{
return array($root_path, $root_http_path);
}
if (isset($_SESSION["override_root_path"]))
{
$root_path = $_SESSION["override_root_path"];
}
if (isset($_SESSION["override_root_http_path"]))
{
$root_http_path = $_SESSION["override_root_http_path"];
}
$root_path = stripLastSlash($root_path);
$root_http_path = stripLastSlash($root_http_path);
}
$root_http_path = $protocol . $_SERVER["SERVER_NAME"] . $port . $root_http_path;
if (substr($root_http_path, strlen($root_http_path) - 1, 1) == "/") {
$root_http_path = substr($root_http_path, 0, strlen($root_http_path) - 1);
}
if ($bOriginalPath == true) {
return array($root_path, $root_http_path);
}
if (isset($_SESSION["override_root_path"])) {
$root_path = $_SESSION["override_root_path"];
}
if (isset($_SESSION["override_root_http_path"])) {
$root_http_path = $_SESSION["override_root_http_path"];
}
$root_path = stripLastSlash($root_path);
$root_http_path = stripLastSlash($root_http_path);
return array($root_path, $root_http_path);
}
function findSimilarText ($string1, $string2)
{
for ($i=0;$i<strlen($string1);$i++)
{
if (substr($string1, 0, $i) != substr($string2, 0, $i))
{
return $i - 1;
}
}
return $i - 1;
function findSimilarText($string1, $string2) {
for ($i = 0; $i < strlen($string1); $i++) {
if (substr($string1, 0, $i) != substr($string2, 0, $i)) {
return $i - 1;
}
}
return $i - 1;
}
function htmldecode($string)
{
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
$ret = strtr($string, $trans_tbl);
function htmldecode($string) {
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
$ret = strtr($string, $trans_tbl);
return $ret;
return $ret;
}
function rereadClients_Setup() {
global $cfgClient;
global $errsite_idcat;
global $errsite_idart;
global $db;
global $cfg;
function rereadClients_Setup()
{
global $cfgClient;
global $errsite_idcat;
global $errsite_idart;
global $db;
global $cfg;
if (!is_object($db)) {
$db = new DB_Contenido;
}
if (!is_object($db))
{
$db = new DB_Contenido;
}
$sql = "SELECT
$sql = "SELECT
idclient,
frontendpath,
htmlpath,
errsite_cat,
errsite_art
FROM
".$_SESSION["dbprefix"].'_clients';
" . $_SESSION["dbprefix"] . '_clients';
$db->query($sql);
$db->query($sql);
while ($db->next_record())
{
$cfgClient["set"] = "set";
$cfgClient[$db->f("idclient")]["path"]["frontend"] = $db->f("frontendpath");
$cfgClient[$db->f("idclient")]["path"]["htmlpath"] = $db->f("htmlpath");
$errsite_idcat[$db->f("idclient")] = $db->f("errsite_cat");
$errsite_idart[$db->f("idclient")] = $db->f("errsite_art");
while ($db->next_record()) {
$cfgClient["set"] = "set";
$cfgClient[$db->f("idclient")]["path"]["frontend"] = $db->f("frontendpath");
$cfgClient[$db->f("idclient")]["path"]["htmlpath"] = $db->f("htmlpath");
$errsite_idcat[$db->f("idclient")] = $db->f("errsite_cat");
$errsite_idart[$db->f("idclient")] = $db->f("errsite_art");
$cfgClient[$db->f("idclient")]["images"] = $db->f("htmlpath")."images/";
$cfgClient[$db->f("idclient")]["upload"] = "upload/";
$cfgClient[$db->f("idclient")]["images"] = $db->f("htmlpath") . "images/";
$cfgClient[$db->f("idclient")]["upload"] = "upload/";
$cfgClient[$db->f("idclient")]["htmlpath"]["frontend"] = $cfgClient[$db->f("idclient")]["path"]["htmlpath"];
$cfgClient[$db->f("idclient")]["upl"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"]."upload/";
$cfgClient[$db->f("idclient")]["upl"]["htmlpath"] = $cfgClient[$db->f("idclient")]["htmlpath"]["frontend"]."upload/";
$cfgClient[$db->f("idclient")]["upl"]["frontendpath"] = "upload/";
$cfgClient[$db->f("idclient")]["css"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"]."css/";
$cfgClient[$db->f("idclient")]["js"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"]."js/";
$cfgClient[$db->f("idclient")]["tpl"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"]."templates/";
}
$cfgClient[$db->f("idclient")]["htmlpath"]["frontend"] = $cfgClient[$db->f("idclient")]["path"]["htmlpath"];
$cfgClient[$db->f("idclient")]["upl"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"] . "upload/";
$cfgClient[$db->f("idclient")]["upl"]["htmlpath"] = $cfgClient[$db->f("idclient")]["htmlpath"]["frontend"] . "upload/";
$cfgClient[$db->f("idclient")]["upl"]["frontendpath"] = "upload/";
$cfgClient[$db->f("idclient")]["css"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"] . "css/";
$cfgClient[$db->f("idclient")]["js"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"] . "js/";
$cfgClient[$db->f("idclient")]["tpl"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"] . "templates/";
}
}
?>

Datei anzeigen

@ -1,258 +0,0 @@
<?php
/**
* Project:
* Contenido Content Management System
*
* Description:
* Release toolkit
*
* Requirements:
* @con_php_req 5
*
* @package ContenidoBackendArea
* @version 0.2.1
* @author unknown
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
*
*
* {@internal
* created 2005-10-06
* modified 2008-07-07, bilal arslan, added security fix
* modified 2010-05-20, Murat Purc, standardized Contenido startup and security check invocations, see [#CON-307]
*
* $Id: release.php 279 2013-11-21 14:34:53Z oldperl $:
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
// Contenido startup process
include_once ('../../conlite/includes/startup.php');
cInclude("includes", "functions.database.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Contenido - Release Toolkit</title>
<style type="text/css">
body,tr,td {
background-color: #ffffff;
scrollbar-face-color:#C6C6D5;
scrollbar-highlight-color:#FFFFFF;
scrollbar-3dlight-color:#747488;
scrollbar-darkshadow-color:#000000;
scrollbar-shadow-color:#334F77;
scrollbar-arrow-color:#334F77;
scrollbar-track-color:#C7C7D6;
font-family: Verdana, Arial, Helvetica, Sans-Serif;
font-size: 11px;
color: #000000;
}
a {
color: #000099;
}
h1 {
font-family: Verdana, Arial, Helvetica, Sans-Serif;
font-size: 20px;
color: #000000;
margin-top: 0px;
}
h2 {
font-family: Verdana, Arial, Helvetica, Sans-Serif;
font-size: 15px;
color: #000000;
}
table {
border: none;
padding: 0;
margin: 0;
text-align: left;
width: 100%;
}
td {
vertical-align: top;
}
img {
border: 0;
}
pre {
padding: 0;
margin: 0;
}
</style>
</head>
<body>
<table>
<tbody>
<tr>
<td>
<img src="../images/logo.gif" alt="Contenido" width="200" height="30" style="padding-right: 20px;">
<h1>Contenido - Release Toolkit</h1>
</td>
</tr>
</tbody>
</table>
<br>
<?php
$cApiXml2Array = new cApiXml2Array();
$cApiXml2Array->loadData("release.xml");
$aReleaseInfo = $cApiXml2Array->getResult();
/* Extract version information */
$sTargetVersion = $aReleaseInfo["release"]["version"][0]["content"];
$sSourcePrefix = $aReleaseInfo["release"]["sqlfiles"][0]["@sourceprefix"];
$sTargetPrefix = $aReleaseInfo["release"]["sqlfiles"][0]["@targetprefix"];
$sLinesPerFile = $aReleaseInfo["release"]["sqlfiles"][0]["@linesperfile"];
$db = new DB_Contenido;
echo "<h2>Execute scripts and prepare file contents</h2>\n";
foreach ($aReleaseInfo["release"]["sqlfiles"][0]["rules"] as $rules)
{
$group = $rules["@group"];
$groupfiles[$group] = array();
echo "<br /><strong>Parsing group $group</strong><br />\n";
foreach ($rules["rule"] as $rule)
{
$mcount = 1;
$file = $rule["@file"];
echo " Preparing file $file<br />\n";
$prerun = "";
if (is_array($rule["prerun"]))
{
foreach ($rule["prerun"] as $preruns)
{
$sqlchunks[$group."/".$file.$mcount.".sql"][] = $preruns["content"];
$groupfiles[$group][] = $group."/".$file.$mcount.".sql";
}
}
$source = "";
if (is_array($rule["source"]))
{
foreach ($rule["source"] as $sources)
{
$source = $sources["content"];
$source = str_replace($sTargetPrefix, $sSourcePrefix, $source);
$db->query($source);
echo " Executing <pre>$source</pre><br />\n";
$sqlcount = 0;
while ($db->next_record())
{
/* Extract the table name */
$sTableName = mysql_field_table($db->Query_ID, '0');
$sTableName = str_replace($sSourcePrefix."_", $sTargetPrefix."_", $sTableName);
$targetSQL = "INSERT INTO %s VALUES(%s);";
$aInsert = array();
for ($i=0;$i<$db->num_fields();$i++)
{
$data = $db->f($i);
$rootpath = str_replace("/conlite/", "/", $cfg['path']['contenido']);
$webpath = str_replace("/conlite/", "/", $cfg['path']['contenido_fullhtml']);
$data = str_replace($rootpath, '<!--{contenido_root}-->/', $data);
$data = str_replace($webpath, '<!--{contenido_web}-->/', $data);
$data = str_replace("\\", "\\\\", $data);
$data = str_replace("\n", "\\n", $data);
$data = str_replace("\r", "\\r", $data);
$data = str_replace("'", "''", $data);
$aInsert[] = "'".$data."'";
}
$sqlchunks[$group."/".$file.$mcount.".sql"][] = sprintf($targetSQL, $sTableName, implode(", ", $aInsert));
$groupfiles[$group][] = $group."/".$file.$mcount.".sql";
$sqlcount++;
if ($sqlcount > $sLinesPerFile)
{
$sqlcount = 0;
$mcount++;
}
}
}
}
}
}
echo "<h2>Writing data files</h2>\n";
foreach ($sqlchunks as $file => $sqlchunk)
{
echo "Writing ".$cfg["path"]["contenido"]."../setup/data/".$file."<br />\n";
@mkdir(dirname($cfg["path"]["contenido"]."../setup/data/".$file));
file_put_contents($cfg["path"]["contenido"]."../setup/data/".$file, implode(PHP_EOL, $sqlchunk));
}
echo "<h2>Writing setup variants files</h2>\n";
foreach ($groupfiles as $group => $files)
{
$filename = $group.".txt";
$filecontents = implode(PHP_EOL, array_unique($files));
file_put_contents($cfg["path"]["contenido"]."../setup/data/".$filename, $filecontents);
echo "Writing ".$cfg["path"]["contenido"]."../setup/data/".$filename."<br \>\n";
}
echo "<h2>Exporting table structures</h2>\n";
$dbexport = new DB_Contenido;
$rawtext = true;
foreach ($cfg["tab"] as $key => $value)
{
echo "Exporting table $value<br />\n";
$tArray[$value] = dbDumpStructure($dbexport, $value, $rawtext);
}
$csv = new CSV;
$row = 1;
ksort($tArray);
foreach ($tArray as $table)
{
foreach ($table as $field)
{
$row++;
$cell = 1;
foreach ($field as $entry)
{
$cell++;
$csv->setCell($row, $cell, $entry);
}
}
}
file_put_contents($cfg["path"]["contenido"]."../setup/data/tables.txt", $csv->make());
?>
<h2>Finished</h2>
</body>
</html>

Datei anzeigen

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<release>
<version>2.0 Beta</version>
<sqlfiles sourceprefix="con" targetprefix="!PREFIX!" linesperfile="200">
<rules group="sysadmin">
<rule file="sysadmin">
<source>UPDATE !PREFIX!_phplib_auth_user_md5 SET password=md5('sysadmin') WHERE username="sysadmin";</source>
<source>SELECT * FROM !PREFIX!_phplib_auth_user_md5 WHERE username="sysadmin";</source>
</rule>
</rules>
<rules group="base">
<rule file="base_actions">
<prerun><![CDATA[DELETE FROM !PREFIX!_actions WHERE idaction < 10000;]]></prerun>
<source>SELECT * FROM !PREFIX!_actions</source>
</rule>
<rule file="base_area">
<prerun><![CDATA[DELETE FROM !PREFIX!_area WHERE idarea < 10000;]]></prerun>
<source>SELECT * FROM !PREFIX!_area</source>
</rule>
<rule file="base_chartable">
<prerun><![CDATA[DELETE FROM !PREFIX!_chartable;]]></prerun>
<source>SELECT * FROM !PREFIX!_chartable</source>
</rule>
<rule file="base_files">
<prerun><![CDATA[DELETE FROM !PREFIX!_files WHERE idfile < 10000;]]></prerun>
<source>SELECT * FROM !PREFIX!_files</source>
</rule>
<rule file="base_framefiles">
<prerun><![CDATA[DELETE FROM !PREFIX!_frame_files WHERE idframefile < 10000;]]></prerun>
<source>SELECT * FROM !PREFIX!_frame_files</source>
</rule>
<rule file="base_meta_type">
<prerun><![CDATA[DELETE FROM !PREFIX!_meta_type WHERE idmetatype < 10000;]]></prerun>
<source>SELECT * FROM !PREFIX!_meta_type</source>
</rule>
<rule file="base_nav_main">
<prerun><![CDATA[DELETE FROM !PREFIX!_nav_main WHERE idnavm < 10000;]]></prerun>
<source>SELECT * FROM !PREFIX!_nav_main</source>
</rule>
<rule file="base_nav_sub">
<prerun><![CDATA[DELETE FROM !PREFIX!_nav_sub WHERE idnavs < 10000;]]></prerun>
<source>SELECT * FROM !PREFIX!_nav_sub</source>
</rule>
<rule file="base_type">
<prerun><![CDATA[DELETE FROM !PREFIX!_type WHERE idtype < 10000;]]></prerun>
<source>SELECT * FROM !PREFIX!_type</source>
</rule>
<rule file="base_misc">
<prerun><![CDATA[UPDATE !PREFIX!_art_lang SET published=lastmodified, publishedby=modifiedby WHERE online=1 and published="0000-00-00 00:00:00";]]></prerun>
</rule>
</rules>
<rules group="client">
<rule file="client">
<source>SELECT * FROM !PREFIX!_clients;</source>
<source>SELECT * FROM !PREFIX!_clients_lang;</source>
<source>SELECT * FROM !PREFIX!_lang;</source>
<source>SELECT * FROM !PREFIX!_phplib_auth_user_md5 WHERE username="admin";</source>
</rule>
</rules>
<rules group="examples">
<rule file="examples_articles">
<source>SELECT * FROM !PREFIX!_art;</source>
<source>SELECT * FROM !PREFIX!_art_lang;</source>
</rule>
<rule file="examples_categories">
<source>UPDATE !PREFIX!_cat_art SET createcode='1';</source>
<source>SELECT * FROM !PREFIX!_cat;</source>
<source>SELECT * FROM !PREFIX!_cat_art;</source>
<source>SELECT * FROM !PREFIX!_cat_lang;</source>
<source>SELECT * FROM !PREFIX!_cat_tree;</source>
</rule>
<rule file="examples_container">
<source>SELECT * FROM !PREFIX!_container;</source>
<source>SELECT * FROM !PREFIX!_container_conf;</source>
</rule>
<rule file="examples_content">
<source>SELECT * FROM !PREFIX!_content;</source>
</rule>
<rule file="examples_misc">
<source>SELECT * FROM !PREFIX!_lay;</source>
<source>SELECT * FROM !PREFIX!_template;</source>
<source>SELECT * FROM !PREFIX!_template_conf;</source>
<source>SELECT * FROM !PREFIX!_upl;</source>
<source>SELECT * FROM !PREFIX!_keywords;</source>
<source>SELECT * FROM !PREFIX!_properties;</source>
<source>SELECT * FROM !PREFIX!_frontendusers;</source>
<source>SELECT * FROM !PREFIX!_frontendpermissions;</source>
<source>SELECT * FROM !PREFIX!_frontendgroups;</source>
<source>SELECT * FROM !PREFIX!_frontendgroupmembers;</source>
</rule>
</rules>
<rules group="standard">
<rule file="standard_modules">
<source>SELECT * FROM !PREFIX!_mod;</source>
</rule>
<rule file="standard_modules_translations">
<source>SELECT * FROM !PREFIX!_mod_translations;</source>
</rule>
</rules>
</sqlfiles>
</release>