fixes for release
Dieser Commit ist enthalten in:
Ursprung
0083950cef
Commit
601f02bcc8
|
@ -1,6 +1,6 @@
|
||||||
DELETE FROM !PREFIX!_nav_main WHERE idnavm < 10000;
|
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('5', 'navigation/administration/main', 'administration');
|
||||||
INSERT INTO !PREFIX!_nav_main VALUES('4', 'statistic', 'navigation/statistic/main');
|
INSERT INTO !PREFIX!_nav_main VALUES('4', 'navigation/statistic/main', 'statistic');
|
||||||
INSERT INTO !PREFIX!_nav_main VALUES('2', 'style', 'navigation/style/main');
|
INSERT INTO !PREFIX!_nav_main VALUES('2', 'navigation/style/main', 'style');
|
||||||
INSERT INTO !PREFIX!_nav_main VALUES('1', 'content', 'navigation/content/main');
|
INSERT INTO !PREFIX!_nav_main VALUES('1', 'navigation/content/main', 'content');
|
||||||
INSERT INTO !PREFIX!_nav_main VALUES('3', 'extra', 'navigation/extra/main');
|
INSERT INTO !PREFIX!_nav_main VALUES('3', 'navigation/extra/main', 'extra');
|
Dateidiff unterdrückt, weil mindestens eine Zeile zu lang ist
|
@ -291,8 +291,8 @@
|
||||||
"mod_translations";"original";"text";"NO";"";"";"";""
|
"mod_translations";"original";"text";"NO";"";"";"";""
|
||||||
"mod_translations";"translation";"text";"NO";"";"";"";""
|
"mod_translations";"translation";"text";"NO";"";"";"";""
|
||||||
"nav_main";"idnavm";"int(10)";"NO";"PRI";"0";"";"1"
|
"nav_main";"idnavm";"int(10)";"NO";"PRI";"0";"";"1"
|
||||||
"nav_main";"name";"varchar(255)";"NO";"";"";"";""
|
|
||||||
"nav_main";"location";"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";"idnavs";"int(10)";"NO";"PRI";"0";"";"1"
|
||||||
"nav_sub";"idnavm";"int(10)";"NO";"";"0";"";""
|
"nav_sub";"idnavm";"int(10)";"NO";"";"0";"";""
|
||||||
"nav_sub";"idarea";"int(10)";"NO";"";"0";"";""
|
"nav_sub";"idarea";"int(10)";"NO";"";"0";"";""
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project:
|
* Project:
|
||||||
* Contenido Content Management System
|
* Contenido Content Management System
|
||||||
|
@ -33,8 +34,6 @@
|
||||||
die('Illegal call');
|
die('Illegal call');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Fuction checks if a plugin is already installed
|
//Fuction checks if a plugin is already installed
|
||||||
function checkExistingPlugin($db, $sPluginname) {
|
function checkExistingPlugin($db, $sPluginname) {
|
||||||
#new install: all plugins are checked
|
#new install: all plugins are checked
|
||||||
|
@ -120,13 +119,11 @@ function updateSystemProperties($db, $table) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateContenidoVersion ($db, $table, $version)
|
function updateContenidoVersion($db, $table, $version) {
|
||||||
{
|
|
||||||
$sql = "SELECT idsystemprop FROM %s WHERE type='system' AND name='version'";
|
$sql = "SELECT idsystemprop FROM %s WHERE type='system' AND name='version'";
|
||||||
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
|
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
|
||||||
|
|
||||||
if ($db->next_record())
|
if ($db->next_record()) {
|
||||||
{
|
|
||||||
$sql = "UPDATE %s SET value = '%s' WHERE type='system' AND name='version'";
|
$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)));
|
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), Contenido_Security::escapeDB($version, $db)));
|
||||||
} else {
|
} else {
|
||||||
|
@ -136,26 +133,22 @@ function updateContenidoVersion ($db, $table, $version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContenidoVersion ($db, $table)
|
function getContenidoVersion($db, $table) {
|
||||||
{
|
|
||||||
$sql = "SELECT value FROM %s WHERE type='system' AND name='version'";
|
$sql = "SELECT value FROM %s WHERE type='system' AND name='version'";
|
||||||
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
|
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
|
||||||
|
|
||||||
if ($db->next_record())
|
if ($db->next_record()) {
|
||||||
{
|
|
||||||
return $db->f("value");
|
return $db->f("value");
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSysadminPassword ($db, $table, $password)
|
function updateSysadminPassword($db, $table, $password) {
|
||||||
{
|
|
||||||
$sql = "SELECT password FROM %s WHERE username='sysadmin'";
|
$sql = "SELECT password FROM %s WHERE username='sysadmin'";
|
||||||
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
|
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
|
||||||
|
|
||||||
if ($db->next_record())
|
if ($db->next_record()) {
|
||||||
{
|
|
||||||
$sql = "UPDATE %s SET password='%s' WHERE username='sysadmin'";
|
$sql = "UPDATE %s SET password='%s' WHERE username='sysadmin'";
|
||||||
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), md5($password)));
|
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db), md5($password)));
|
||||||
return true;
|
return true;
|
||||||
|
@ -165,41 +158,35 @@ function updateSysadminPassword ($db, $table, $password)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function listClients ($db, $table)
|
function listClients($db, $table) {
|
||||||
{
|
|
||||||
$sql = "SELECT idclient, name, frontendpath, htmlpath FROM %s";
|
$sql = "SELECT idclient, name, frontendpath, htmlpath FROM %s";
|
||||||
|
|
||||||
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
|
$db->query(sprintf($sql, Contenido_Security::escapeDB($table, $db)));
|
||||||
|
|
||||||
$clients = array();
|
$clients = array();
|
||||||
|
|
||||||
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")] = array("name" => $db->f("name"), "frontendpath" => $db->f("frontendpath"), "htmlpath" => $db->f("htmlpath"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $clients;
|
return $clients;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateClientPath ($db, $table, $idclient, $frontendpath, $htmlpath)
|
function updateClientPath($db, $table, $idclient, $frontendpath, $htmlpath) {
|
||||||
{
|
|
||||||
$sql = "UPDATE %s SET frontendpath='%s', htmlpath='%s' WHERE idclient='%s'";
|
$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)));
|
$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)
|
function stripLastSlash($sInput) {
|
||||||
{
|
if (substr($sInput, strlen($sInput) - 1, 1) == "/") {
|
||||||
if (substr($sInput, strlen($sInput)-1,1) == "/")
|
|
||||||
{
|
|
||||||
$sInput = substr($sInput, 0, strlen($sInput) - 1);
|
$sInput = substr($sInput, 0, strlen($sInput) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $sInput;
|
return $sInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSystemDirectories ($bOriginalPath = false)
|
function getSystemDirectories($bOriginalPath = false) {
|
||||||
{
|
|
||||||
|
|
||||||
$root_path = __FILE__;
|
$root_path = __FILE__;
|
||||||
|
|
||||||
|
@ -214,36 +201,29 @@ function getSystemDirectories ($bOriginalPath = false)
|
||||||
$port = "";
|
$port = "";
|
||||||
$protocol = "http://";
|
$protocol = "http://";
|
||||||
|
|
||||||
if ($_SERVER["SERVER_PORT"] != 80)
|
if ($_SERVER["SERVER_PORT"] != 80) {
|
||||||
{
|
if ($_SERVER["SERVER_PORT"] == 443) {
|
||||||
if ($_SERVER["SERVER_PORT"] == 443)
|
|
||||||
{
|
|
||||||
$protocol = "https://";
|
$protocol = "https://";
|
||||||
} else {
|
} else {
|
||||||
$port = ":" . $_SERVER["SERVER_PORT"];
|
$port = ":" . $_SERVER["SERVER_PORT"];
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$root_http_path = $protocol . $_SERVER["SERVER_NAME"] . $port . $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) == "/")
|
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_http_path = substr($root_http_path, 0, strlen($root_http_path) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($bOriginalPath == true)
|
if ($bOriginalPath == true) {
|
||||||
{
|
|
||||||
return array($root_path, $root_http_path);
|
return array($root_path, $root_http_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_SESSION["override_root_path"]))
|
if (isset($_SESSION["override_root_path"])) {
|
||||||
{
|
|
||||||
$root_path = $_SESSION["override_root_path"];
|
$root_path = $_SESSION["override_root_path"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_SESSION["override_root_http_path"]))
|
if (isset($_SESSION["override_root_http_path"])) {
|
||||||
{
|
|
||||||
$root_http_path = $_SESSION["override_root_http_path"];
|
$root_http_path = $_SESSION["override_root_http_path"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,12 +233,9 @@ function getSystemDirectories ($bOriginalPath = false)
|
||||||
return array($root_path, $root_http_path);
|
return array($root_path, $root_http_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
function findSimilarText ($string1, $string2)
|
function findSimilarText($string1, $string2) {
|
||||||
{
|
for ($i = 0; $i < strlen($string1); $i++) {
|
||||||
for ($i=0;$i<strlen($string1);$i++)
|
if (substr($string1, 0, $i) != substr($string2, 0, $i)) {
|
||||||
{
|
|
||||||
if (substr($string1, 0, $i) != substr($string2, 0, $i))
|
|
||||||
{
|
|
||||||
return $i - 1;
|
return $i - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -266,8 +243,7 @@ function findSimilarText ($string1, $string2)
|
||||||
return $i - 1;
|
return $i - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function htmldecode($string)
|
function htmldecode($string) {
|
||||||
{
|
|
||||||
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
|
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
|
||||||
$trans_tbl = array_flip($trans_tbl);
|
$trans_tbl = array_flip($trans_tbl);
|
||||||
$ret = strtr($string, $trans_tbl);
|
$ret = strtr($string, $trans_tbl);
|
||||||
|
@ -275,17 +251,14 @@ function htmldecode($string)
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function rereadClients_Setup() {
|
||||||
function rereadClients_Setup()
|
|
||||||
{
|
|
||||||
global $cfgClient;
|
global $cfgClient;
|
||||||
global $errsite_idcat;
|
global $errsite_idcat;
|
||||||
global $errsite_idart;
|
global $errsite_idart;
|
||||||
global $db;
|
global $db;
|
||||||
global $cfg;
|
global $cfg;
|
||||||
|
|
||||||
if (!is_object($db))
|
if (!is_object($db)) {
|
||||||
{
|
|
||||||
$db = new DB_Contenido;
|
$db = new DB_Contenido;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,8 +273,7 @@ function rereadClients_Setup()
|
||||||
|
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
|
|
||||||
while ($db->next_record())
|
while ($db->next_record()) {
|
||||||
{
|
|
||||||
$cfgClient["set"] = "set";
|
$cfgClient["set"] = "set";
|
||||||
$cfgClient[$db->f("idclient")]["path"]["frontend"] = $db->f("frontendpath");
|
$cfgClient[$db->f("idclient")]["path"]["frontend"] = $db->f("frontendpath");
|
||||||
$cfgClient[$db->f("idclient")]["path"]["htmlpath"] = $db->f("htmlpath");
|
$cfgClient[$db->f("idclient")]["path"]["htmlpath"] = $db->f("htmlpath");
|
||||||
|
@ -320,4 +292,5 @@ function rereadClients_Setup()
|
||||||
$cfgClient[$db->f("idclient")]["tpl"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"] . "templates/";
|
$cfgClient[$db->f("idclient")]["tpl"]["path"] = $cfgClient[$db->f("idclient")]["path"]["frontend"] . "templates/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -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>
|
|
|
@ -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>
|
|
Laden…
In neuem Issue referenzieren