Menu

[r13]: / installation / upgrade.php  Maximize  Restore  History

Download this file

177 lines (143 with data), 6.4 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?php
/*
** Application name: phpCollab
** Path by root: ../installation/upgrade.php
** Since: 2.5 rc3
** Authors: Norman77 / Mindblender
**
** =============================================================================
**
** phpCollab - Project Managment
**
** -----------------------------------------------------------------------------
** Please refer to license, copyright, and credits in README.TXT
**
** -----------------------------------------------------------------------------
** FILE: upgrade.php
**
** DESC: Screen: Upgrade from 2.4 to 2.5
**
** =============================================================================
** CVS Tags and Keywords
** Last Editor : $Author: norman77 $
** Last Edit : $Date: 2009/01/21 21:29:19 $
** Version : $Revision: 1.2 $
** =============================================================================
*/
// Include all needed files here.. show the license as well.. we want to be legal
include("../languages/help_en.php");
include("../includes/upgrade_funcs.inc.php");
//Start the page
$setTitle = "PhpCollab Upgrade";
define('THEME','default');
$blank = "true";
include("../themes/".THEME."/block.class.php");
include('../themes/'.THEME.'/header.php');
//Get this file..
$script = "upgrade.php";
$step = getParameter('step');
$version = "2.5";
if (empty($step)) $step = 1;
// Create new block and start the breadcrumbs
$blockPage = new block();
$blockPage->openBreadcrumbs();
$blockPage->itemBreadcrumbs("<a href='../installation/$script'>Upgrade</a>");
//Content block
$block1 = new block();
if ($step == 1) {
$blockPage->itemBreadcrumbs("License");
$blockPage->closeBreadcrumbs();
$block1->heading("License");
$block1->openContent();
$block1->contentTitle("&nbsp;");
echo "<tr class='odd'><td valign='top' class='leftvalue'>&nbsp;</td><td>
<pre>";
include("../docs/copying.txt");
echo "</pre>
</td></tr>";
}
elseif ($step == 2) {
$myError = null;
$blockPage->itemBreadcrumbs("<a href='../installation/{$script}?step=1'>License</a>");
$blockPage->itemBreadcrumbs("Check DB");
$blockPage->closeBreadcrumbs();
$block1->heading("Checking Database...");
$block1->openContent();
$block1->contentTitle("Database Requirements...");
echo "<tr class='odd'><td valign='top' class='leftvalue'>&nbsp;</td><td>
We are currently checking the database to see if it needs to be updated... <br /><br /><b>Please wait...</b><br />
</td></tr>";
flush();
echo "<tr class='odd'><td valign='top' class='leftvalue'>&nbsp;</td><td>";
if (checkDatabase(&$myError)) {
echo "<br />Database looks <font style='color: green'>good</font>. We are continuing the conversion...<br /><br />";
echo "<br />Continue on to <a href='../installation/{$script}?step=3&redirect=true'>Step 3</a>.<br /><br /><b>MAKE SURE SETTINGS.PHP IS WRITEABLE!!!</b><Br /><br />";
} else {
echo "<fieldset><legend style='font-weight: bold;font-size: large;padding: 5px;color: #ff3300'>";
echo "Error...</legend>";
echo "Sorry we could not upgrade your database at this time.. you will have to reinstall or do a manual upgrade...";
if (!empty($myError)) echo "<pre>$myError</pre>";
echo "</fieldset>";
}
echo "</td></tr>";
}
elseif ($step == 3) {
$myError = null;
$blockPage->itemBreadcrumbs("<a href='../installation/{$script}?step=1'>License</a>");
$blockPage->itemBreadcrumbs("<a href='../installation/{$script}?step=2'>Check DB</a>");
$blockPage->itemBreadcrumbs("Conversion");
$blockPage->closeBreadcrumbs();
$block1->heading("Conversion and update");
$block1->openContent();
$block1->contentTitle("Checking Settings.php...");
echo "<tr class='odd'><td valign='top' class='leftvalue'>&nbsp;</td><td>
We are making sure that settings.php is writeable, we can not continue if it's not writeable. <br /><br /><b>Please wait...</b><br />
</td></tr>";
flush();
echo "<tr class='odd'><td valign='top' class='leftvalue'>&nbsp;</td><td>";
//TODO: Check file
$settingsFile = dirname(realpath(__FILE__)). "/../includes/settings.php";
unset($goon);
$goon = false;
clearstatcache();
if (!is_writable($settingsFile)) {
echo "<fieldset><legend style='font-weight: bold;font-size: large;padding: 5px;color: #ff3300'>";
echo "Error...</legend>";
echo "Your settings file is not writeable. You need to either <b>chmod 666</b> the file or <b>chmod o+w</b> the file. Hit refresh to recheck.";
if (!empty($myError)) echo "<pre>$myError</pre>";
echo "</fieldset>";
} else {
echo "<br />Okay your settings.php file looks good, we are going to continue.<br />";
$goon = true;
}
echo "<br /></td></tr>";
if ($goon) {
//Next
$block1->contentTitle("Converting...");
echo "<tr class='odd'><td valign='top' class='leftvalue'>&nbsp;</td><td>
We are now upgrading your database and writting the config file. <br /><br /><b>Please wait...</b><br />
</td></tr>";
flush();
echo "<tr class='odd'><td valign='top' class='leftvalue'>&nbsp;</td><td>";
if (convertDB()) {
echo "<br />Writting out new settings file...";
rewriteConfig($settingsFile);
//Reload the Config so we can use the root
include($settingsFile);
echo "<b> done</b><br /><br />";
echo "<br /><B>Congratulations... if there was no error writting the file, you are done.<br />Click <a href={$root}>here</a> to login.";
echo "<br><B>MAKE SURE TO DELETE UPGRADE.PHP!";
echo "</td></tr>";
}
}
}
$block1->closeContent();
$stepNext = $step + 1;
if ($step < "2") { echo "<form name='license' action='../installation/{$script}?step=2&redirect=true' method='post'><center><a href=\"javascript:document.license.submit();\"><br /><b>Step $stepNext</b></a><br /><br /></center></form><br/>"; }
$footerDev = "false";
include('../themes/'.THEME.'/footer.php');
//FOR DEBUG ****
exit();
// -----------------------
/* End of file myfile.php */
/* Location: ./installation/upgrade.php */
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.