Commit fc001bbfe0d1498b69228e76ffd67cc53d92df08

Authored by Jarrett Jordaan
1 parent 182ef4ad

Code cleanup.

Committed by: Jarrett Jordaan

Reviewed by: Megan Watson
setup/migrate/steps/migrateComplete.php
@@ -164,7 +164,6 @@ class migrateComplete extends Step { @@ -164,7 +164,6 @@ class migrateComplete extends Step {
164 if($state == "STARTED" || $state == "RUNNING") 164 if($state == "STARTED" || $state == "RUNNING")
165 $running = true; 165 $running = true;
166 } else { 166 } else {
167 - //TODO : Read fomr my.cnf file  
168 $mysqlPid = "/var/run/mysqld/mysqld.sock"; 167 $mysqlPid = "/var/run/mysqld/mysqld.sock";
169 if(file_exists($mysqlPid)) 168 if(file_exists($mysqlPid))
170 $running = true; 169 $running = true;
setup/migrate/steps/migrateDatabase.php
@@ -155,31 +155,20 @@ class migrateDatabase extends Step @@ -155,31 +155,20 @@ class migrateDatabase extends Step
155 unlink($sqlFile); 155 unlink($sqlFile);
156 } 156 }
157 } 157 }
158 - $noFile = true;  
159 // Handle failed dump 158 // Handle failed dump
160 if(WINDOWS_OS) { 159 if(WINDOWS_OS) {
161 // Could be permissions, check error code. 160 // Could be permissions, check error code.
162 - if(!$noFile) {  
163 - $sqlFile = "C:\\kt-backup-$date.sql"; // Use tmp instead due to permissions  
164 - } 161 + $sqlFile = "C:\\kt-backup-$date.sql"; // Use tmp instead due to permissions
165 } else { 162 } else {
166 - if(!$noFile) {  
167 - $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions  
168 - } 163 + $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions
169 } 164 }
170 $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile; 165 $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile;
171 - if($noFile) {  
172 - $this->error[]['error'] = "The KnowledgeTree Setup Wizard was unable to connect to your KnowledgeTree 3.6.1 database.";  
173 - $this->error[]['msg'] = "Ensure that your KnowledgeTree Mysql service is running.";  
174 - $this->error[]['cmd'] = "Click <b>Next</b> after resolving the above errors.";  
175 - $this->temp_variables['manual_export'] = "";  
176 - } else {  
177 - $this->error[]['error'] = "Could not export database:";  
178 - $this->error[]['msg'] = "Execute the following command in a $termOrBash.";  
179 - $this->error[]['cmd'] = $cmd;  
180 - $this->temp_variables['manual_export'] = $sqlFile;  
181 - }  
182 - 166 + $this->error[]['error'] = "The KnowledgeTree Setup Wizard was unable to connect to your KnowledgeTree 3.6.1 database.";
  167 + $this->error[]['msg'] = "Ensure that your KnowledgeTree Mysql service is running.";
  168 + $this->error[]['cmd'] = "Click <b>Next</b> after resolving the above errors.";
  169 + $this->temp_variables['dumpLocation'] = $sqlFile;
  170 + $this->temp_variables['manual_export'] = $sqlFile;
  171 + $this->error[]['manual'] = $cmd;
183 return false; 172 return false;
184 } 173 }
185 174
@@ -274,7 +263,7 @@ class migrateDatabase extends Step @@ -274,7 +263,7 @@ class migrateDatabase extends Step
274 return $this->error; 263 return $this->error;
275 } 264 }
276 265
277 - private function storeSilent() { 266 + public function storeSilent() {
278 // TODO 267 // TODO
279 $_SESSION['migrate']['database']['dumpLocation'] = $this->sqlDumpFile; 268 $_SESSION['migrate']['database']['dumpLocation'] = $this->sqlDumpFile;
280 $this->temp_variables['dumpLocation'] = $this->sqlDumpFile; 269 $this->temp_variables['dumpLocation'] = $this->sqlDumpFile;
setup/migrate/steps/migrateServices.php
@@ -398,7 +398,7 @@ class migrateServices extends Step @@ -398,7 +398,7 @@ class migrateServices extends Step
398 * @access private 398 * @access private
399 * @return void 399 * @return void
400 */ 400 */
401 - private function storeSilent() { 401 + public function storeSilent() {
402 $this->temp_variables['alreadyUninstalled'] = $this->alreadyUninstalled; 402 $this->temp_variables['alreadyUninstalled'] = $this->alreadyUninstalled;
403 $this->temp_variables['serviceCheck'] = $this->serviceCheck; 403 $this->temp_variables['serviceCheck'] = $this->serviceCheck;
404 $this->temp_variables['msg'] = "Turn off KnowledgeTree Mysql Instance."; 404 $this->temp_variables['msg'] = "Turn off KnowledgeTree Mysql Instance.";
setup/migrate/templates/database.tpl
@@ -118,6 +118,16 @@ @@ -118,6 +118,16 @@
118 <?php } ?> 118 <?php } ?>
119 </p> 119 </p>
120 <br/> 120 <br/>
  121 +<p class="description">
  122 + Manually perform a KnowledgeTree 3.6.1 database export
  123 +</p>
  124 +<p class="disclaimer">
  125 +<?php
  126 +if(isset($error['manual'])) {
  127 + echo $error['manual'];
  128 + }
  129 +?>
  130 +</p>
121 <?php 131 <?php
122 } 132 }
123 ?> 133 ?>
setup/migrate/templates/wizard.tpl
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 <div id="outer-wrapper" align="left"> 21 <div id="outer-wrapper" align="left">
22 <div id="header"> 22 <div id="header">
23 <div id="logo"><?php echo $html->image('dame/installer-header_logo.png'); ?> </div> 23 <div id="logo"><?php echo $html->image('dame/installer-header_logo.png'); ?> </div>
24 - <div id="install_details"> 24 + <div id="version_details">
25 <span style="font-size:120%;"> <?php if (isset($vars['migrate_version'])) echo $vars['migrate_version']; ?> </span> 25 <span style="font-size:120%;"> <?php if (isset($vars['migrate_version'])) echo $vars['migrate_version']; ?> </span>
26 <span style="font-size:120%;"> <?php if (isset($vars['migrate_version'])) echo $vars['migrate_type']; ?></span> 26 <span style="font-size:120%;"> <?php if (isset($vars['migrate_version'])) echo $vars['migrate_type']; ?></span>
27 </div> 27 </div>
setup/upgrade/steps/upgradeComplete.php
@@ -88,7 +88,7 @@ class upgradeComplete extends Step { @@ -88,7 +88,7 @@ class upgradeComplete extends Step {
88 * Set all silent mode varibles 88 * Set all silent mode varibles
89 * 89 *
90 */ 90 */
91 - protected function storeSilent() { 91 + public function storeSilent() {
92 $v = $this->getDataFromSession('upgradeProperties'); 92 $v = $this->getDataFromSession('upgradeProperties');
93 $this->temp_variables['sysVersion'] = $this->util->readVersion(); 93 $this->temp_variables['sysVersion'] = $this->util->readVersion();
94 $this->temp_variables['migrateCheck'] = $this->migrateCheck; 94 $this->temp_variables['migrateCheck'] = $this->migrateCheck;
setup/upgrade/templates/complete.tpl
@@ -31,11 +31,15 @@ @@ -31,11 +31,15 @@
31 <br/> 31 <br/>
32 [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services] 32 [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
33 <br/> 33 <br/>
34 - Right-Click and run [Install Services] as administrator 34 + Right-Click and run [Install Services] as administrator, if applicable, or
  35 + <br/>
  36 + Click [Install Services]
35 <br/> 37 <br/>
36 [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services] 38 [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
37 <br/> 39 <br/>
38 - Right-Click and run [Start Services] as administrator 40 + Right-Click and run [Start Services] as administrator, if applicable, or
  41 + <br/>
  42 + Click [Start Services]
39 <br/> 43 <br/>
40 <br/> 44 <br/>
41 <b>Alternatively:</b> 45 <b>Alternatively:</b>
setup/upgrade/templates/wizard.tpl
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 <div id="outer-wrapper" align="left"> 21 <div id="outer-wrapper" align="left">
22 <div id="header"> 22 <div id="header">
23 <div id="logo"><?php echo $html->image('dame/installer-header_logo.png'); ?></div> 23 <div id="logo"><?php echo $html->image('dame/installer-header_logo.png'); ?></div>
24 - <div id="upgrade_details"> 24 + <div id="version_details">
25 <span style="font-size:120%;"> <?php echo $vars['upgrade_version']; ?> </span> 25 <span style="font-size:120%;"> <?php echo $vars['upgrade_version']; ?> </span>
26 <span style="font-size:120%;"> <?php echo $vars['upgrade_type']; ?> </span> 26 <span style="font-size:120%;"> <?php echo $vars['upgrade_type']; ?> </span>
27 </div> 27 </div>
setup/wizard/resources/css/wizard.css
1 * { margin: 0; padding: 0; } 1 * { margin: 0; padding: 0; }
2 -  
3 body { 2 body {
4 background-attachment:scroll; 3 background-attachment:scroll;
5 background-color:transparent; 4 background-color:transparent;
@@ -70,7 +69,7 @@ select { @@ -70,7 +69,7 @@ select {
70 #outer-wrapper { 69 #outer-wrapper {
71 border:1px solid #B7B7B7; 70 border:1px solid #B7B7B7;
72 margin-top:20px; 71 margin-top:20px;
73 - /*width:1024px;*/width:964px; 72 + width:964px;
74 } 73 }
75 74
76 #header { 75 #header {
@@ -87,12 +86,12 @@ select { @@ -87,12 +86,12 @@ select {
87 #container { 86 #container {
88 background: white url("../graphics/left.png") repeat-y left; 87 background: white url("../graphics/left.png") repeat-y left;
89 overflow:auto; 88 overflow:auto;
90 - /*min-height:630px;height:410px;*/min-height:500px; 89 + min-height:500px;
91 } 90 }
92 91
93 #content { 92 #content {
94 margin-left: 220px; 93 margin-left: 220px;
95 - /*height:515px;*/height:500px; 94 + height:500px;
96 } 95 }
97 96
98 #content_container { 97 #content_container {
@@ -105,19 +104,19 @@ select { @@ -105,19 +104,19 @@ select {
105 border: 1px solid rgb(207, 207, 207); 104 border: 1px solid rgb(207, 207, 207);
106 padding: 5px; 105 padding: 5px;
107 overflow: auto; 106 overflow: auto;
108 - /*min-height: 400px;*/min-height: 300px; 107 + min-height: 300px;
109 } 108 }
110 109
111 #step_content_dependencies { 110 #step_content_dependencies {
112 border: 1px solid rgb(207, 207, 207); 111 border: 1px solid rgb(207, 207, 207);
113 - /*padding: 5px;*/padding: 12px;  
114 - /*min-height:270px;*/min-height:170px; 112 + padding: 12px;
  113 + /min-height:170px;
115 } 114 }
116 115
117 #step_content_configuration { 116 #step_content_configuration {
118 border: 1px solid rgb(207, 207, 207); 117 border: 1px solid rgb(207, 207, 207);
119 padding: 5px; 118 padding: 5px;
120 - /*min-height:320px;*//*height:330px*/min-height:130px; 119 + min-height:130px;
121 } 120 }
122 121
123 #step_content_services { 122 #step_content_services {
@@ -129,25 +128,25 @@ select { @@ -129,25 +128,25 @@ select {
129 #step_content_registration { 128 #step_content_registration {
130 border: 1px solid rgb(207, 207, 207); 129 border: 1px solid rgb(207, 207, 207);
131 padding: 5px; 130 padding: 5px;
132 - /*min-height:320px;*/min-height:100px; 131 + min-height:100px;
133 } 132 }
134 133
135 #step_content_registration_confirm { 134 #step_content_registration_confirm {
136 border: 1px solid rgb(207, 207, 207); 135 border: 1px solid rgb(207, 207, 207);
137 padding: 5px; 136 padding: 5px;
138 - /*min-height:400px;*/min-height:300px; 137 + min-height:300px;
139 } 138 }
140 139
141 #step_content_install { 140 #step_content_install {
142 border: 1px solid rgb(207, 207, 207); 141 border: 1px solid rgb(207, 207, 207);
143 padding: 5px; 142 padding: 5px;
144 - /*min-height:400px;*/min-height:150px; 143 + min-height:150px;
145 } 144 }
146 145
147 #step_content_database { 146 #step_content_database {
148 border: 1px solid rgb(207, 207, 207); 147 border: 1px solid rgb(207, 207, 207);
149 padding: 5px; 148 padding: 5px;
150 - /*min-height:365px;*/min-height:240px; 149 + min-height:240px;
151 } 150 }
152 151
153 #step_content_database_confirm { 152 #step_content_database_confirm {
@@ -164,7 +163,7 @@ select { @@ -164,7 +163,7 @@ select {
164 163
165 .license_agreement { 164 .license_agreement {
166 overflow: scroll; 165 overflow: scroll;
167 - /*height:370px;*/height:270px; 166 + height:270px;
168 overflow-x:hidden; 167 overflow-x:hidden;
169 border:1px solid #CFCFCF; 168 border:1px solid #CFCFCF;
170 } 169 }
@@ -204,11 +203,11 @@ select { @@ -204,11 +203,11 @@ select {
204 203
205 #logo { 204 #logo {
206 position:relative; 205 position:relative;
207 - /*right:760px;*/right:75%;  
208 - /*top:20px;*/top:25%; 206 + right:75%;
  207 + top:25%;
209 } 208 }
210 209
211 -#install_details { 210 +#version_details {
212 bottom:20px; 211 bottom:20px;
213 position:relative; 212 position:relative;
214 right:10px; 213 right:10px;
@@ -282,7 +281,7 @@ select { @@ -282,7 +281,7 @@ select {
282 } 281 }
283 282
284 .conf_paths { 283 .conf_paths {
285 - /*width:755px;*/width:100%; 284 + width:100%;
286 } 285 }
287 286
288 .errors { 287 .errors {
@@ -320,7 +319,6 @@ select { @@ -320,7 +319,6 @@ select {
320 font-size:13px; 319 font-size:13px;
321 font-weight:bold; 320 font-weight:bold;
322 margin-left:5px; 321 margin-left:5px;
323 - /*margin-top:10px;*/  
324 } 322 }
325 323
326 .step .radio { 324 .step .radio {
@@ -368,7 +366,9 @@ select { @@ -368,7 +366,9 @@ select {
368 .onclick { 366 .onclick {
369 cursor: pointer; 367 cursor: pointer;
370 color: #EC7725; 368 color: #EC7725;
371 - /*width: 150px;*//*width:350px;top:12px;position:relative;*/width:350px;padding-top:12px;position:static; 369 + width:350px;
  370 + padding-top:12px;
  371 + position:static;
372 } 372 }
373 373
374 .description { 374 .description {
@@ -415,18 +415,10 @@ table#dbconf tr td input{ @@ -415,18 +415,10 @@ table#dbconf tr td input{
415 padding: 5px 8px; 415 padding: 5px 8px;
416 } 416 }
417 417
418 -/*#section {  
419 -  
420 -}*/  
421 -  
422 .php_ext_details table { 418 .php_ext_details table {
423 - width:745px; 419 + width:645px;
424 } 420 }
425 421
426 -/*.php_ext_details table tr {  
427 -  
428 -}*/  
429 -  
430 td.ext_indicator { 422 td.ext_indicator {
431 width:10px; 423 width:10px;
432 } 424 }
@@ -456,7 +448,7 @@ td.dir_description { @@ -456,7 +448,7 @@ td.dir_description {
456 } 448 }
457 449
458 .php_con_details table { 450 .php_con_details table {
459 - /*width:745px;*/width:675px; 451 + width:675px;
460 } 452 }
461 453
462 .error_message { 454 .error_message {
@@ -515,12 +507,6 @@ td.dir_description { @@ -515,12 +507,6 @@ td.dir_description {
515 font-size:12pt; 507 font-size:12pt;
516 } 508 }
517 509
518 -.demo {  
519 - /*left:75px;  
520 - position:relative;  
521 - width:600px*/  
522 -}  
523 -  
524 .text_message { 510 .text_message {
525 511
526 } 512 }
@@ -540,7 +526,7 @@ td.dir_description { @@ -540,7 +526,7 @@ td.dir_description {
540 526
541 #loading { 527 #loading {
542 bottom:250px; 528 bottom:250px;
543 - /*left:500px;*/left:400px; 529 + left:400px;
544 position:relative; 530 position:relative;
545 height:0px; 531 height:0px;
546 width:0px; 532 width:0px;
@@ -563,15 +549,15 @@ td.dir_description { @@ -563,15 +549,15 @@ td.dir_description {
563 } 549 }
564 550
565 .dependency_details { 551 .dependency_details {
566 - /*top:12px;*/padding-top:12px;  
567 - /*position:relative;*/position:static; 552 + padding-top:12px;
  553 + position:static;
568 width:650px; 554 width:650px;
569 } 555 }
570 556
571 .dependencies { 557 .dependencies {
572 - /*position:relative;*/position:static; 558 + position:static;
573 right:30%; 559 right:30%;
574 - /*width:880px;*/width:650px; 560 + width:650px;
575 } 561 }
576 562
577 .registration_template { 563 .registration_template {
@@ -583,7 +569,7 @@ td.dir_description { @@ -583,7 +569,7 @@ td.dir_description {
583 } 569 }
584 570
585 .description_complete { 571 .description_complete {
586 - /*position:relative;*/position:static; 572 + position:static;
587 right:35%; 573 right:35%;
588 width:100%; 574 width:100%;
589 } 575 }
@@ -603,14 +589,6 @@ td.dir_description { @@ -603,14 +589,6 @@ td.dir_description {
603 font-family:sans-serif; 589 font-family:sans-serif;
604 } 590 }
605 591
606 -.twitter {  
607 -  
608 -}  
609 -  
610 -.facebook {  
611 -  
612 -}  
613 -  
614 .connect { 592 .connect {
615 float:none; 593 float:none;
616 padding-bottom:0; 594 padding-bottom:0;
setup/wizard/steps/complete.php
@@ -169,7 +169,6 @@ class complete extends Step { @@ -169,7 +169,6 @@ class complete extends Step {
169 $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dport'], $dbconf['dmsusername'], $dbconf['dmsuserpassword'], $dbconf['dname']); 169 $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dport'], $dbconf['dmsusername'], $dbconf['dmsuserpassword'], $dbconf['dname']);
170 $loaded = $this->util->dbUtilities->getDatabaseLink(); 170 $loaded = $this->util->dbUtilities->getDatabaseLink();
171 // if we can log in to the database, check access 171 // if we can log in to the database, check access
172 - // TODO check write access?  
173 if ($loaded) 172 if ($loaded)
174 { 173 {
175 $this->temp_variables['dbConnectUser'] .= sprintf($html, 'tick', '', 'Database connectivity successful (user: ' . $dbconf['dmsusername'] . ')'); 174 $this->temp_variables['dbConnectUser'] .= sprintf($html, 'tick', '', 'Database connectivity successful (user: ' . $dbconf['dmsusername'] . ')');
@@ -257,7 +256,7 @@ class complete extends Step { @@ -257,7 +256,7 @@ class complete extends Step {
257 * Set all silent mode varibles 256 * Set all silent mode varibles
258 * 257 *
259 */ 258 */
260 - private function storeSilent() { 259 + public function storeSilent() {
261 $this->temp_variables['services_check'] = $this->services_check; 260 $this->temp_variables['services_check'] = $this->services_check;
262 $this->temp_variables['paths_check'] = $this->paths_check; 261 $this->temp_variables['paths_check'] = $this->paths_check;
263 $this->temp_variables['privileges_check'] = $this->privileges_check; 262 $this->temp_variables['privileges_check'] = $this->privileges_check;
setup/wizard/steps/database.php
@@ -886,7 +886,7 @@ class database extends Step @@ -886,7 +886,7 @@ class database extends Step
886 private function closeMysql() { 886 private function closeMysql() {
887 try { 887 try {
888 $this->util->dbUtilities->close(); 888 $this->util->dbUtilities->close();
889 - } catch (Exeption $e) { 889 + } catch (Exception $e) {
890 $this->error['con'] = "Could not close: " . $e; 890 $this->error['con'] = "Could not close: " . $e;
891 } 891 }
892 } 892 }
setup/wizard/steps/services.php
@@ -245,8 +245,7 @@ class services extends Step @@ -245,8 +245,7 @@ class services extends Step
245 $this->serviceCheck = 'tick'; 245 $this->serviceCheck = 'tick';
246 } 246 }
247 $this->storeSilent(); // Store info needed for silent mode 247 $this->storeSilent(); // Store info needed for silent mode
248 - if(!empty($errors))  
249 - return false; 248 +
250 return true; 249 return true;
251 } 250 }
252 251
setup/wizard/templates/wizard.tpl
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <div id="outer-wrapper" align="left"> 20 <div id="outer-wrapper" align="left">
21 <div id="header"> 21 <div id="header">
22 <div id="logo"><?php echo $html->image('dame/installer-header_logo.png'); ?> </div> 22 <div id="logo"><?php echo $html->image('dame/installer-header_logo.png'); ?> </div>
23 - <div id="install_details"> 23 + <div id="version_details">
24 <span style="font-size:120%;"> <?php echo $vars['install_version']; ?> </span> 24 <span style="font-size:120%;"> <?php echo $vars['install_version']; ?> </span>
25 <span style="font-size:120%;"><?php echo $vars['install_type']; ?></span> 25 <span style="font-size:120%;"><?php echo $vars['install_type']; ?></span>
26 </div> 26 </div>
@@ -45,7 +45,6 @@ @@ -45,7 +45,6 @@
45 </div> 45 </div>
46 <div class="clearing">&nbsp;</div> 46 <div class="clearing">&nbsp;</div>
47 </div> 47 </div>
48 -  
49 <div id="footer"> 48 <div id="footer">
50 <?php echo $html->image('dame/powered-by-kt.png', array("height"=>"23px", "width"=>"105px", "style"=>"padding: 5px;")); ?> 49 <?php echo $html->image('dame/powered-by-kt.png', array("height"=>"23px", "width"=>"105px", "style"=>"padding: 5px;")); ?>
51 </div> 50 </div>