Menu

[2eb2a2]: / dbsync.php  Maximize  Restore  History

Download this file

146 lines (125 with data), 5.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php session_start(); ?>
<html>
<head>
<title>deltasql - Database Synchronization Form</title>
<link rel="stylesheet" type="text/css" href="deltasql.css">
<link rel="shortcut icon" href="pictures/favicon.ico" />
<script language="javascript" type="text/javascript" src="validation.js"></script>
<script language="javascript" type="text/javascript">
<?php include("scriptbranches.js"); ?>
</script>
</head>
<body>
<?php
include("utils/constants.inc.php");
include("utils/copypaste.inc.php");
include("utils/components.inc.php");
if (!file_exists($configurationfile)) die("<h2><a href=\"install.php\">$installmessage</a></h2>");
include("conf/config.inc.php");
include("utils/utils.inc.php");
if(isset($_SESSION['rights'])) {
$rights = $_SESSION["rights"];
$user = $_SESSION["username"];
$userid = $_SESSION["userid"];
} else {
$rights=0; $user=""; $userid="";
}
if (isset($_GET["id"])) {
$defaultprojectid = $_GET["id"];
}
else {
// attempt to retrieve default project from cookies :-)
if (isset($_SESSION["dbsync_projectid"]))
$defaultprojectid = $_SESSION["dbsync_projectid"];
else $defaultprojectid = "";
}
if (!isset($default_copypaste)) $default_copypaste=1;
printCopyPasteJS($default_copypaste);
include("head.inc.php");
?>
<h2>Database Synchronization Form</h2>
<p>1) First, make sure your database schema has a table called TBSYNCHRONIZE. If not, click on the <a href="list_projects.php">
project list</a> and press on the 'Table' link, this will generate a script you have to launch on your database schema.
</p>
<p>2) You should run the following query into the database instance you would like
to synchronize, and then fill the form below with the query's results as explained in the italic comments</p>
<?php
echo "<tt>";
echo "<p id='clipboard_text'>select * from tbsynchronize where versionnr = (select max(versionnr) from tbsynchronize);</p>";
echo "</tt>";
echo "<center>";
printCopyPasteLink("Copy this query to clipboard", 0, $default_copypaste);
echo "</center>";
?>
<p>3) Please enter the synchronization details you retrieved from the query:</p>
<form name="syncform" action="dbsync_update.php" method="post">
<?php
mysql_connect($dbserver, $username, $password);
@mysql_select_db($database) or die("Unable to select database");
echo "<table>";
echo "<tr><td><b>Project Name:</b></td><td>";
printProjectComboBox($defaultprojectid, 'onchange="javascript: getBranches2ndList(this.value);"');
echo "</select>";
echo "</td><td><i>= value in column projectname</i></td></tr>";
echo "<tr><td><b>Version Number:</b></td>";
echo "<td><input type=\"text\" name=\"lastversionnr\" value=\"\"></td><td><i>= value in column versionnr</i></td></tr>";
echo "<tr><td><b>From:</b></td>";
echo "<td>";
echo "<select NAME=\"frombranchid\" onchange=\"javascript: getBranches3rdList(this.value);\">";
printBranchesAndTags();
echo "</select><br><br>";
echo "</select></td><td><i>= value in column branchname or tagname</i></td></tr>";
echo "<tr><td><b>Update To:</b></td>";
echo "<td>";
echo "<select NAME=\"tobranchid\">";
printBranchesAndTags();
echo "</select>";
echo "</td><td><i>= HEAD if schema has to include all scripts or another branch name if not</i></td></tr>";
if ($rights>1) {
echo "<tr>";
echo "<td><b>Exclude:</b></td>";
echo "<td><input name=\"frmexcludeviews\" type=\"checkbox\" value=\"1\"/>Views";
echo "<input name=\"frmexcludepackages\" type=\"checkbox\" value=\"1\"/>Packages</td>";
echo "<td>";
echo "<a href=\"detect_packages_and_views.php\">Detect views and packages</a></td>";
echo "</tr>";
}
echo "<tr><td><b>Output Format:</b> </td>";
echo "<td>";
echo "<input type=\"radio\" name=\"formatgroup\" value=\"html\" checked> HTML";
echo "<input type=\"radio\" name=\"formatgroup\" value=\"text\"> Text";
echo "<input type=\"radio\" name=\"formatgroup\" value=\"xml\"> XML";
echo "<input type=\"radio\" name=\"formatgroup\" value=\"singlefiles\"> Single files (zipped)";
echo "</td></tr>";
echo "<tr><td><b>Debug:</b> </td>";
echo "<td><input name=\"frmdebug\" type=\"checkbox\" value=\"1\"/>Include debug information";
echo "</td></tr>";
echo "</table><br><br>";
mysql_close();
?>
<b>4) Please copy and execute in a sql client (like SqlPlus or Toad or PhpMyAdmin) the script you
will receive after pressing the button below!<br> This will update both your database schema and the
synchronization information in table TBSYNCHRONIZE.</b><br><br>
<center><input type="Submit" value="Generate Synchronization Script"></center>
</form>
<br>
<?php
if ($defaultprojectid!="") {
echo "
<script type='text/javascript'>
getBranches2ndList($defaultprojectid);
</script>
";
}
?>
<?php
if (isset($_SESSION['displayhelplinks'])) $displayhelp=$_SESSION['displayhelplinks']; else $displayhelp=$default_displayhelplinks;
if ($displayhelp==1)
echo '<a href="manual.php#syncworks"><img src="icons/help.png"> How synchronization works with examples</a><br>';
?>
<?php
include("bottom.inc.php");
printCopyPasteBlock("select * from tbsynchronize where versionnr = (select max(versionnr) from tbsynchronize);", $default_copypaste);
?>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.