Commit 347ab714fa27aa955281a1f21c3ab82f44354445
Merge branch 'edge' of github.com:ktgit/knowledgetree into edge
Showing
16 changed files
with
101 additions
and
117 deletions
setup/migrate/migrateWizard.php
| @@ -177,7 +177,7 @@ class MigrateWizard { | @@ -177,7 +177,7 @@ class MigrateWizard { | ||
| 177 | * @return void | 177 | * @return void |
| 178 | */ | 178 | */ |
| 179 | private function createMigrateFile() { | 179 | private function createMigrateFile() { |
| 180 | - @touch("migrate"); | 180 | + touch("migrate"); |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | /** | 183 | /** |
| @@ -189,7 +189,7 @@ class MigrateWizard { | @@ -189,7 +189,7 @@ class MigrateWizard { | ||
| 189 | * @return void | 189 | * @return void |
| 190 | */ | 190 | */ |
| 191 | private function removeMigrateFile() { | 191 | private function removeMigrateFile() { |
| 192 | - @unlink("migrate"); | 192 | + unlink("migrate"); |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | /** | 195 | /** |
setup/migrate/migrater.php
setup/migrate/steps/migrateDatabase.php
| @@ -117,6 +117,7 @@ class migrateDatabase extends Step | @@ -117,6 +117,7 @@ class migrateDatabase extends Step | ||
| 117 | } | 117 | } |
| 118 | } | 118 | } |
| 119 | } | 119 | } |
| 120 | + $noFile = false; | ||
| 120 | $installation = $this->getDataFromSession("installation"); // Get installation directory | 121 | $installation = $this->getDataFromSession("installation"); // Get installation directory |
| 121 | $manual = false; // If file was exported manually | 122 | $manual = false; // If file was exported manually |
| 122 | $dbSettings = $installation['dbSettings']; | 123 | $dbSettings = $installation['dbSettings']; |
| @@ -125,7 +126,7 @@ class migrateDatabase extends Step | @@ -125,7 +126,7 @@ class migrateDatabase extends Step | ||
| 125 | $tmpFolder = $this->resolveTempDir(); | 126 | $tmpFolder = $this->resolveTempDir(); |
| 126 | if(WINDOWS_OS) { | 127 | if(WINDOWS_OS) { |
| 127 | $termOrBash = "command prompt window"; | 128 | $termOrBash = "command prompt window"; |
| 128 | - $exe = "$location".DS."mysql".DS."bin".DS."mysqldump.exe".DS; | 129 | + $exe = "\"$location".DS."mysql".DS."bin".DS."mysqldump.exe\""; |
| 129 | } else { | 130 | } else { |
| 130 | $termOrBash = "terminal window"; | 131 | $termOrBash = "terminal window"; |
| 131 | $exe = "\"$location".DS."mysql".DS."bin".DS."mysqldump\""; // Location of dump | 132 | $exe = "\"$location".DS."mysql".DS."bin".DS."mysqldump\""; // Location of dump |
| @@ -153,23 +154,20 @@ class migrateDatabase extends Step | @@ -153,23 +154,20 @@ class migrateDatabase extends Step | ||
| 153 | return true; | 154 | return true; |
| 154 | } | 155 | } |
| 155 | } | 156 | } |
| 157 | + $noFile = true; | ||
| 156 | // Handle failed dump | 158 | // Handle failed dump |
| 157 | if(WINDOWS_OS) { | 159 | if(WINDOWS_OS) { |
| 158 | // Could be permissions, check error code. | 160 | // Could be permissions, check error code. |
| 159 | - if($response['ret'] == 2) { | ||
| 160 | - | ||
| 161 | - } else { | 161 | + if(!$noFile) { |
| 162 | $sqlFile = "C:\\kt-backup-$date.sql"; // Use tmp instead due to permissions | 162 | $sqlFile = "C:\\kt-backup-$date.sql"; // Use tmp instead due to permissions |
| 163 | } | 163 | } |
| 164 | } else { | 164 | } else { |
| 165 | - if($response['ret'] == 2) { | ||
| 166 | - | ||
| 167 | - } else { | 165 | + if(!$noFile) { |
| 168 | $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions | 166 | $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions |
| 169 | } | 167 | } |
| 170 | } | 168 | } |
| 171 | $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile; | 169 | $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile; |
| 172 | - if($response['ret'] == 2) { | 170 | + if($noFile) { |
| 173 | $this->error[]['error'] = "Could not connect to the KnowledgeTree Database"; | 171 | $this->error[]['error'] = "Could not connect to the KnowledgeTree Database"; |
| 174 | $this->error[]['msg'] = "Make sure all KnowledgeTree Services are running."; | 172 | $this->error[]['msg'] = "Make sure all KnowledgeTree Services are running."; |
| 175 | $this->error[]['cmd'] = "<p class=\"description\">Click <b>Next</b> after resolving the above errors.</p>"; | 173 | $this->error[]['cmd'] = "<p class=\"description\">Click <b>Next</b> after resolving the above errors.</p>"; |
| @@ -207,6 +205,7 @@ class migrateDatabase extends Step | @@ -207,6 +205,7 @@ class migrateDatabase extends Step | ||
| 207 | * @return void | 205 | * @return void |
| 208 | */ | 206 | */ |
| 209 | private function setDetails() { | 207 | private function setDetails() { |
| 208 | + $this->createMigrateFile(); // create lock file to indicate migration mode | ||
| 210 | $database = $this->getDataFromSession("database"); | 209 | $database = $this->getDataFromSession("database"); |
| 211 | if(isset($database['dumpLocation'])) { | 210 | if(isset($database['dumpLocation'])) { |
| 212 | if(!empty($database['dumpLocation'])) { | 211 | if(!empty($database['dumpLocation'])) { |
| @@ -219,7 +218,7 @@ class migrateDatabase extends Step | @@ -219,7 +218,7 @@ class migrateDatabase extends Step | ||
| 219 | $this->temp_variables['duname'] = $this->getPostSafe('duname'); | 218 | $this->temp_variables['duname'] = $this->getPostSafe('duname'); |
| 220 | $this->temp_variables['dpassword'] = $this->getPostSafe('dpassword'); | 219 | $this->temp_variables['dpassword'] = $this->getPostSafe('dpassword'); |
| 221 | $this->temp_variables['dumpLocation'] = $this->getPostSafe('dumpLocation'); | 220 | $this->temp_variables['dumpLocation'] = $this->getPostSafe('dumpLocation'); |
| 222 | - $this->createMigrateFile(); // create lock file to indicate migration mode | 221 | + |
| 223 | return true; | 222 | return true; |
| 224 | } | 223 | } |
| 225 | 224 | ||
| @@ -231,7 +230,7 @@ class migrateDatabase extends Step | @@ -231,7 +230,7 @@ class migrateDatabase extends Step | ||
| 231 | * @return void | 230 | * @return void |
| 232 | */ | 231 | */ |
| 233 | private function createMigrateFile() { | 232 | private function createMigrateFile() { |
| 234 | - @touch(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock"); | 233 | + touch(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock"); |
| 235 | } | 234 | } |
| 236 | 235 | ||
| 237 | /** | 236 | /** |
setup/migrate/steps/migrateServices.php
| @@ -272,7 +272,9 @@ class migrateServices extends Step | @@ -272,7 +272,9 @@ class migrateServices extends Step | ||
| 272 | $this->temp_variables['services'][$serv->getName()]['class'] = $state; | 272 | $this->temp_variables['services'][$serv->getName()]['class'] = $state; |
| 273 | $this->temp_variables['services'][$serv->getName()]['name'] = $serv->getName(); | 273 | $this->temp_variables['services'][$serv->getName()]['name'] = $serv->getName(); |
| 274 | } | 274 | } |
| 275 | - $this->checkMysql(); | 275 | + if(!$this->checkMysql()) { |
| 276 | + return false; | ||
| 277 | + } | ||
| 276 | if ($this->serviceCheck != 'tick') { | 278 | if ($this->serviceCheck != 'tick') { |
| 277 | return false; | 279 | return false; |
| 278 | } | 280 | } |
| @@ -292,10 +294,12 @@ class migrateServices extends Step | @@ -292,10 +294,12 @@ class migrateServices extends Step | ||
| 292 | $this->temp_variables['services']['KTMysql']['name'] = "KTMysql"; | 294 | $this->temp_variables['services']['KTMysql']['name'] = "KTMysql"; |
| 293 | $this->temp_variables['services']['KTMysql']['msg'] = "Service Running"; | 295 | $this->temp_variables['services']['KTMysql']['msg'] = "Service Running"; |
| 294 | $this->error[] = "Service : KTMysql running.<br/>"; | 296 | $this->error[] = "Service : KTMysql running.<br/>"; |
| 297 | + return false; | ||
| 295 | } else { | 298 | } else { |
| 296 | $this->temp_variables['services']['KTMysql']['class'] = "tick"; | 299 | $this->temp_variables['services']['KTMysql']['class'] = "tick"; |
| 297 | $this->temp_variables['services']['KTMysql']['name'] = "KTMysql"; | 300 | $this->temp_variables['services']['KTMysql']['name'] = "KTMysql"; |
| 298 | $this->temp_variables['services']['KTMysql']['msg'] = "Service has been uninstalled"; | 301 | $this->temp_variables['services']['KTMysql']['msg'] = "Service has been uninstalled"; |
| 302 | + return true; | ||
| 299 | } | 303 | } |
| 300 | } | 304 | } |
| 301 | 305 |
setup/migrate/templates/installation.tpl
| @@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
| 33 | </p> | 33 | </p> |
| 34 | <p class="empty_space"> | 34 | <p class="empty_space"> |
| 35 | <small> | 35 | <small> |
| 36 | - Make sure that the services are running for that installation. | 36 | + Make sure that the KnowledgeTree services are running. |
| 37 | </small> | 37 | </small> |
| 38 | </p> | 38 | </p> |
| 39 | <br/> | 39 | <br/> |
setup/migrate/templates/services.tpl
| @@ -74,8 +74,10 @@ | @@ -74,8 +74,10 @@ | ||
| 74 | } | 74 | } |
| 75 | ?> | 75 | ?> |
| 76 | </table> | 76 | </table> |
| 77 | - <br/> | ||
| 78 | - <p class=\"description\">Click <b>Next</b> after deactivating the above services.</p> | 77 | + <?php if ($serviceCheck != 'tick') { ?> |
| 78 | + <br/> | ||
| 79 | + <p class=\"description\">Click <b>Next</b> if deactivating the above services.</p> | ||
| 80 | + <?php } ?> | ||
| 79 | <?php if($silent) { ?> | 81 | <?php if($silent) { ?> |
| 80 | </div> | 82 | </div> |
| 81 | <?php } ?> | 83 | <?php } ?> |
setup/upgrade/steps/upgradeDatabase.php
| @@ -268,7 +268,7 @@ class upgradeDatabase extends Step | @@ -268,7 +268,7 @@ class upgradeDatabase extends Step | ||
| 268 | // It should idealy work the same as the upgrades. | 268 | // It should idealy work the same as the upgrades. |
| 269 | // Lock the scheduler | 269 | // Lock the scheduler |
| 270 | $lockFile = $this->cachePath . DIRECTORY_SEPARATOR . 'scheduler.lock'; | 270 | $lockFile = $this->cachePath . DIRECTORY_SEPARATOR . 'scheduler.lock'; |
| 271 | - @touch($lockFile); | 271 | + touch($lockFile); |
| 272 | return true; | 272 | return true; |
| 273 | 273 | ||
| 274 | } | 274 | } |
| @@ -287,7 +287,7 @@ class upgradeDatabase extends Step | @@ -287,7 +287,7 @@ class upgradeDatabase extends Step | ||
| 287 | // things up a bit | 287 | // things up a bit |
| 288 | exec("del /q /s " . escapeshellarg($sPath)); | 288 | exec("del /q /s " . escapeshellarg($sPath)); |
| 289 | } | 289 | } |
| 290 | - $hPath = @opendir($sPath); | 290 | + $hPath = opendir($sPath); |
| 291 | while (($sFilename = readdir($hPath)) !== false) { | 291 | while (($sFilename = readdir($hPath)) !== false) { |
| 292 | if (in_array($sFilename, array('.', '..'))) { | 292 | if (in_array($sFilename, array('.', '..'))) { |
| 293 | continue; | 293 | continue; |
| @@ -297,11 +297,11 @@ class upgradeDatabase extends Step | @@ -297,11 +297,11 @@ class upgradeDatabase extends Step | ||
| 297 | $this->deleteDirectory($sFullFilename); | 297 | $this->deleteDirectory($sFullFilename); |
| 298 | continue; | 298 | continue; |
| 299 | } | 299 | } |
| 300 | - @chmod($sFullFilename, 0666); | ||
| 301 | - @unlink($sFullFilename); | 300 | + chmod($sFullFilename, 0666); |
| 301 | + unlink($sFullFilename); | ||
| 302 | } | 302 | } |
| 303 | closedir($hPath); | 303 | closedir($hPath); |
| 304 | - @rmdir($sPath); | 304 | + rmdir($sPath); |
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | private function performPostUpgradeActions() { | 307 | private function performPostUpgradeActions() { |
| @@ -320,7 +320,7 @@ class upgradeDatabase extends Step | @@ -320,7 +320,7 @@ class upgradeDatabase extends Step | ||
| 320 | // Unlock the scheduler | 320 | // Unlock the scheduler |
| 321 | $lockFile = $this->cachePath . DIRECTORY_SEPARATOR . 'scheduler.lock'; | 321 | $lockFile = $this->cachePath . DIRECTORY_SEPARATOR . 'scheduler.lock'; |
| 322 | if(file_exists($lockFile)){ | 322 | if(file_exists($lockFile)){ |
| 323 | - @unlink($lockFile); | 323 | + unlink($lockFile); |
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | return true; | 326 | return true; |
setup/upgrade/steps/upgradeWelcome.php
| @@ -92,19 +92,12 @@ class upgradeWelcome extends step { | @@ -92,19 +92,12 @@ class upgradeWelcome extends step { | ||
| 92 | $dconf = $this->getDataFromPackage('installers', 'database'); // Use info from install | 92 | $dconf = $this->getDataFromPackage('installers', 'database'); // Use info from install |
| 93 | if($dconf) { // From Install | 93 | if($dconf) { // From Install |
| 94 | $this->util->dbUtilities->load($dconf['dhost'], $dconf['dport'], $dconf['duname'], $dconf['dpassword'], $dconf['dname']); | 94 | $this->util->dbUtilities->load($dconf['dhost'], $dconf['dport'], $dconf['duname'], $dconf['dpassword'], $dconf['dname']); |
| 95 | - } elseif($upgradeOnly) { | ||
| 96 | - require_once("../wizard/steps/configuration.php"); // configuration to read the ini path | ||
| 97 | - $wizConfigHandler = new configuration(); | ||
| 98 | - $configPath = $wizConfigHandler->readConfigPathIni(); | ||
| 99 | - $this->util->iniUtilities->load($configPath); | ||
| 100 | - $dconf = $this->util->iniUtilities->getSection('db'); | ||
| 101 | - $this->util->dbUtilities->load($dconf['dbHost'],$dconf['dbPort'], $dconf['dbUser'], $dconf['dbPass'], $dconf['dbName']); | ||
| 102 | $sQuery = "SELECT count(*) AS match_count FROM users WHERE username = '$username' AND password = '".md5($password)."'"; | 95 | $sQuery = "SELECT count(*) AS match_count FROM users WHERE username = '$username' AND password = '".md5($password)."'"; |
| 103 | $res = $this->util->dbUtilities->query($sQuery); | 96 | $res = $this->util->dbUtilities->query($sQuery); |
| 104 | $ass = $this->util->dbUtilities->fetchAssoc($res); | 97 | $ass = $this->util->dbUtilities->fetchAssoc($res); |
| 105 | if($ass[0]['match_count'] == 1) | 98 | if($ass[0]['match_count'] == 1) |
| 106 | return true; | 99 | return true; |
| 107 | - } else { // Upgrade | 100 | + } elseif($upgradeOnly) { |
| 108 | require_once("../wizard/steps/configuration.php"); // configuration to read the ini path | 101 | require_once("../wizard/steps/configuration.php"); // configuration to read the ini path |
| 109 | $wizConfigHandler = new configuration(); | 102 | $wizConfigHandler = new configuration(); |
| 110 | $configPath = $wizConfigHandler->readConfigPathIni(); | 103 | $configPath = $wizConfigHandler->readConfigPathIni(); |
| @@ -116,6 +109,20 @@ class upgradeWelcome extends step { | @@ -116,6 +109,20 @@ class upgradeWelcome extends step { | ||
| 116 | $ass = $this->util->dbUtilities->fetchAssoc($res); | 109 | $ass = $this->util->dbUtilities->fetchAssoc($res); |
| 117 | if($ass[0]['match_count'] == 1) | 110 | if($ass[0]['match_count'] == 1) |
| 118 | return true; | 111 | return true; |
| 112 | + } else { // Upgrade | ||
| 113 | + require_once("../wizard/steps/configuration.php"); // configuration to read the ini path | ||
| 114 | + $wizConfigHandler = new configuration(); | ||
| 115 | + $configPath = $wizConfigHandler->readConfigPathIni(); | ||
| 116 | + if($configPath) { | ||
| 117 | + $this->util->iniUtilities->load($configPath); | ||
| 118 | + $dconf = $this->util->iniUtilities->getSection('db'); | ||
| 119 | + $this->util->dbUtilities->load($dconf['dbHost'],$dconf['dbPort'], $dconf['dbUser'], $dconf['dbPass'], $dconf['dbName']); | ||
| 120 | + $sQuery = "SELECT count(*) AS match_count FROM users WHERE username = '$username' AND password = '".md5($password)."'"; | ||
| 121 | + $res = $this->util->dbUtilities->query($sQuery); | ||
| 122 | + $ass = $this->util->dbUtilities->fetchAssoc($res); | ||
| 123 | + if($ass[0]['match_count'] == 1) | ||
| 124 | + return true; | ||
| 125 | + } | ||
| 119 | } | 126 | } |
| 120 | $this->error[] = 'Could Not Authenticate User'; | 127 | $this->error[] = 'Could Not Authenticate User'; |
| 121 | return false; | 128 | return false; |
setup/upgrade/templates/complete.tpl
| @@ -10,57 +10,28 @@ | @@ -10,57 +10,28 @@ | ||
| 10 | </div> | 10 | </div> |
| 11 | <br/><br/> | 11 | <br/><br/> |
| 12 | <?php if($migrateCheck) { ?> | 12 | <?php if($migrateCheck) { ?> |
| 13 | - <div> | ||
| 14 | - <h3><?php echo "<span class='{$servicesCheck}'> </span>"; ?>Services</h3> | ||
| 15 | - <?php if($silent) { ?> | ||
| 16 | - <div id="option2" class="onclick notop" onclick="javascript:{w.toggleClass('services_check', 'option2');}">Show Details</div> | ||
| 17 | - <div class="services_check" style="display:none"> | ||
| 18 | - <?php } ?> | ||
| 19 | - <table style="width:755px;"> | ||
| 20 | - <tr> | ||
| 21 | - <td style="width:15px;"> <?php echo "<span class='{$LuceneStatus}'> </span>"; ?> </td> | ||
| 22 | - <td style="width:640px;"> Lucene Service <?php if ($LuceneStatus != 'tick') { ?> Could not be started <?php } else { ?> Started <?php } ?></td> | ||
| 23 | - <?php if ($LuceneStatus != 'tick') { ?> | ||
| 24 | - <td> | ||
| 25 | - <?php if (AJAX) { ?> | ||
| 26 | -<!-- <a href="#" class="refresh" onclick="w.refresh('complete')">Refresh</a>--> | ||
| 27 | - <?php } else { ?> | ||
| 28 | -<!-- <a href="javascript:this.location.reload();" class="refresh">Refresh</a>--> | ||
| 29 | - <?php } ?> | ||
| 30 | - </td> | ||
| 31 | - <?php } ?> | ||
| 32 | - </tr> | ||
| 33 | - <tr> | ||
| 34 | - <td> <?php echo "<span class='{$SchedulerStatus}'> </span>"; ?> </td> | ||
| 35 | - <td> Scheduler Service <?php if ($SchedulerStatus != 'tick') { ?> Could not be started <?php } else { ?> Started <?php } ?></td> | ||
| 36 | - <?php if ($SchedulerStatus != 'tick') { ?> | ||
| 37 | - <td> | ||
| 38 | - <?php if (AJAX) { ?> | ||
| 39 | -<!-- <a href="#" class="refresh" onclick="w.refresh('complete')">Refresh</a>--> | ||
| 40 | - <?php } else { ?> | ||
| 41 | -<!-- <a href="javascript:this.location.reload();" class="refresh">Refresh</a>--> | ||
| 42 | - <?php } ?> | ||
| 43 | - </td> | ||
| 44 | - <?php } ?> | ||
| 45 | - </tr> | ||
| 46 | - <tr> | ||
| 47 | - <td> <?php echo "<span class='{$OpenOfficeStatus}'> </span>"; ?> </td> | ||
| 48 | - <td> OpenOffice Service <?php if ($OpenOfficeStatus != 'tick') { ?> Could not be started <?php } else { ?> Started <?php } ?></td> | ||
| 49 | - <?php if ($OpenOfficeStatus != 'tick') { ?> | ||
| 50 | - <td> | ||
| 51 | - <?php if (AJAX) { ?> | ||
| 52 | -<!-- <a href="#" class="refresh" onclick="w.refresh('complete')">Refresh</a>--> | ||
| 53 | - <?php } else { ?> | ||
| 54 | -<!-- <a href="javascript:this.location.reload();" class="refresh">Refresh</a>--> | ||
| 55 | - <?php } ?> | ||
| 56 | - </td> | ||
| 57 | - <?php } ?> | ||
| 58 | - </tr> | ||
| 59 | - </table> | ||
| 60 | - <?php if($silent) { ?> | ||
| 61 | - </div> | ||
| 62 | - <?php } ?> | ||
| 63 | - </div> | 13 | + <h3>Services</h3> |
| 14 | + The KnowledgeTree services need to be started to allow for optimal functioning of the search, indexing and pdf generation. | ||
| 15 | + <?php if(!WINDOWS_OS) { ?> | ||
| 16 | + To start the services, execute the dmsctl.sh shell script in the KnowledgeTree directory from a terminal. | ||
| 17 | + <br/> | ||
| 18 | + <br/> | ||
| 19 | + <?php } else { ?> | ||
| 20 | + To start the services, execute the dmsctl.bat batch file in the KnowledgeTree directory from a command prompt, run as administrator. | ||
| 21 | + <br/> | ||
| 22 | + <br/> | ||
| 23 | + <?php } ?> | ||
| 24 | + <p class="disclaimer"> | ||
| 25 | + <?php if(WINDOWS_OS) { ?> | ||
| 26 | + cd <?php echo "\"".SYSTEM_ROOT."\""; ?> <br/> | ||
| 27 | + dmsctl.bat install<br/> | ||
| 28 | + dmsctl.bat start | ||
| 29 | + <?php } else { ?> | ||
| 30 | + cd /usr/share/knowledgetree-ce<br/> | ||
| 31 | + sudo ./dmsctl.sh start | ||
| 32 | + <?php } ?> | ||
| 33 | + </p> | ||
| 34 | + <br/> | ||
| 64 | <?php } ?> | 35 | <?php } ?> |
| 65 | </div> | 36 | </div> |
| 66 | <a href="../../login.php" class="back button_next" style="width:50px;" onclick="javascript:{w.clearSessions();}">Finish</a> | 37 | <a href="../../login.php" class="back button_next" style="width:50px;" onclick="javascript:{w.clearSessions();}">Finish</a> |
setup/upgrade/upgradeWizard.php
| @@ -52,7 +52,6 @@ function __autoload($class) { // Attempt and autoload classes | @@ -52,7 +52,6 @@ function __autoload($class) { // Attempt and autoload classes | ||
| 52 | if ($class == "template") { // Load existing templating classes | 52 | if ($class == "template") { // Load existing templating classes |
| 53 | require_once(WIZARD_DIR."../wizard/template.php"); | 53 | require_once(WIZARD_DIR."../wizard/template.php"); |
| 54 | require_once(WIZARD_DIR."../wizard/lib/helpers/htmlHelper.php"); | 54 | require_once(WIZARD_DIR."../wizard/lib/helpers/htmlHelper.php"); |
| 55 | - return ; | ||
| 56 | } | 55 | } |
| 57 | if(file_exists(WIZARD_DIR."$class.php")) { | 56 | if(file_exists(WIZARD_DIR."$class.php")) { |
| 58 | require_once(WIZARD_DIR."$class.php"); | 57 | require_once(WIZARD_DIR."$class.php"); |
| @@ -155,7 +154,7 @@ class UpgradeWizard { | @@ -155,7 +154,7 @@ class UpgradeWizard { | ||
| 155 | * @return void | 154 | * @return void |
| 156 | */ | 155 | */ |
| 157 | private function createUpgradeFile() { | 156 | private function createUpgradeFile() { |
| 158 | - @touch(SYSTEM_DIR.'var'.DS.'bin'.DS."upgrade.lock"); | 157 | + touch(SYSTEM_DIR.'var'.DS.'bin'.DS."upgrade.lock"); |
| 159 | } | 158 | } |
| 160 | 159 | ||
| 161 | /** | 160 | /** |
| @@ -167,7 +166,7 @@ class UpgradeWizard { | @@ -167,7 +166,7 @@ class UpgradeWizard { | ||
| 167 | * @return void | 166 | * @return void |
| 168 | */ | 167 | */ |
| 169 | private function removeUpgradeFile() { | 168 | private function removeUpgradeFile() { |
| 170 | - @unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."upgrade.lock"); | 169 | + unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."upgrade.lock"); |
| 171 | } | 170 | } |
| 172 | 171 | ||
| 173 | /** | 172 | /** |
setup/upgrade/upgrader.php
setup/wizard/installUtil.php
| @@ -712,7 +712,7 @@ class InstallUtil { | @@ -712,7 +712,7 @@ class InstallUtil { | ||
| 712 | */ | 712 | */ |
| 713 | function deleteMigrateFile() { | 713 | function deleteMigrateFile() { |
| 714 | if(file_exists(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock")) | 714 | if(file_exists(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock")) |
| 715 | - @unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock"); | 715 | + unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock"); |
| 716 | } | 716 | } |
| 717 | 717 | ||
| 718 | /** | 718 | /** |
setup/wizard/installWizard.php
| @@ -203,7 +203,7 @@ class InstallWizard { | @@ -203,7 +203,7 @@ class InstallWizard { | ||
| 203 | * @return void | 203 | * @return void |
| 204 | */ | 204 | */ |
| 205 | private function createInstallFile() { | 205 | private function createInstallFile() { |
| 206 | - @touch(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock"); | 206 | + touch(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock"); |
| 207 | } | 207 | } |
| 208 | 208 | ||
| 209 | /** | 209 | /** |
| @@ -216,7 +216,7 @@ class InstallWizard { | @@ -216,7 +216,7 @@ class InstallWizard { | ||
| 216 | */ | 216 | */ |
| 217 | private function removeInstallFile() { | 217 | private function removeInstallFile() { |
| 218 | if(file_exists(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock")) | 218 | if(file_exists(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock")) |
| 219 | - @unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock"); | 219 | + unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock"); |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | /** | 222 | /** |
setup/wizard/path.php
| @@ -126,7 +126,7 @@ | @@ -126,7 +126,7 @@ | ||
| 126 | $type = file_get_contents($verType); | 126 | $type = file_get_contents($verType); |
| 127 | } | 127 | } |
| 128 | if($type) { | 128 | if($type) { |
| 129 | - define('INSTALL_TYPE', $type); | 129 | + define('INSTALL_TYPE', trim($type)); |
| 130 | } else { | 130 | } else { |
| 131 | define('INSTALL_TYPE', 'community'); | 131 | define('INSTALL_TYPE', 'community'); |
| 132 | } | 132 | } |
setup/wizard/steps/database.php
| @@ -768,13 +768,14 @@ class database extends Step | @@ -768,13 +768,14 @@ class database extends Step | ||
| 768 | $dbMigrate = $this->util->getDataFromPackage('migrate', 'database'); | 768 | $dbMigrate = $this->util->getDataFromPackage('migrate', 'database'); |
| 769 | $sqlFile = $dbMigrate['dumpLocation']; | 769 | $sqlFile = $dbMigrate['dumpLocation']; |
| 770 | $this->parse_mysql_dump($sqlFile); | 770 | $this->parse_mysql_dump($sqlFile); |
| 771 | - $dropPluginHelper = "TRUNCATE plugin_helper;"; | 771 | + $dropPluginHelper = "TRUNCATE plugin_helper;"; // Remove plugin helper table |
| 772 | $this->util->dbUtilities->query($dropPluginHelper); | 772 | $this->util->dbUtilities->query($dropPluginHelper); |
| 773 | - $updateUrls = 'UPDATE config_settings c SET c.value = "default" where c.group_name = "urls";'; | 773 | + $updateUrls = 'UPDATE config_settings c SET c.value = "default" where c.group_name = "urls";'; // Remove references to old paths |
| 774 | $this->util->dbUtilities->query($updateUrls); | 774 | $this->util->dbUtilities->query($updateUrls); |
| 775 | - $this->writeBinaries(); | ||
| 776 | - // ensure a guid was generated and is stored | ||
| 777 | - $this->util->getSystemIdentifier(); | 775 | + $updateExternalBinaries = 'UPDATE config_settings c SET c.value = "default" where c.group_name = "externalBinary";'; // Remove references to old paths |
| 776 | + $this->util->dbUtilities->query($updateExternalBinaries); | ||
| 777 | + $this->writeBinaries(); // Rebuild some of the binaries | ||
| 778 | + $this->util->getSystemIdentifier(); // ensure a guid was generated and is stored | ||
| 778 | 779 | ||
| 779 | return true; | 780 | return true; |
| 780 | } | 781 | } |
| @@ -793,7 +794,6 @@ class database extends Step | @@ -793,7 +794,6 @@ class database extends Step | ||
| 793 | { | 794 | { |
| 794 | // continue without attempting to set the path if we can't find the file in the specified location | 795 | // continue without attempting to set the path if we can't find the file in the specified location |
| 795 | if (!file_exists($bin[1])) continue; | 796 | if (!file_exists($bin[1])) continue; |
| 796 | - | ||
| 797 | $updateBin = 'UPDATE config_settings c SET c.value = "'. str_replace('\\', '\\\\', $bin[1]) . '" ' | 797 | $updateBin = 'UPDATE config_settings c SET c.value = "'. str_replace('\\', '\\\\', $bin[1]) . '" ' |
| 798 | . 'where c.group_name = "' . $bin[0] . '" and c.display_name = "'.$displayName.'";'; | 798 | . 'where c.group_name = "' . $bin[0] . '" and c.display_name = "'.$displayName.'";'; |
| 799 | $this->util->dbUtilities->query($updateBin); | 799 | $this->util->dbUtilities->query($updateBin); |
setup/wizard/templates/complete.tpl
| @@ -16,28 +16,30 @@ | @@ -16,28 +16,30 @@ | ||
| 16 | <br/> | 16 | <br/> |
| 17 | <div id="step_content_<?php echo $step_name; ?>" class="step"> | 17 | <div id="step_content_<?php echo $step_name; ?>" class="step"> |
| 18 | <?php if(!$servicesValidation) { ?> | 18 | <?php if(!$servicesValidation) { ?> |
| 19 | - <h3>Services</h3> | ||
| 20 | - The KnowledgeTree services need to be started to allow for optimal functioning of the search, indexing and pdf generation. | ||
| 21 | - <?php if(!WINDOWS_OS) { ?> | ||
| 22 | - To start the services, execute the dmsctl.sh shell script in the KnowledgeTree directory from a terminal. | ||
| 23 | - <br/> | ||
| 24 | - <br/> | ||
| 25 | - <?php } else { ?> | ||
| 26 | - To start the services, execute the dmsctl.bat batch file in the KnowledgeTree directory from a command prompt, run as administrator. | ||
| 27 | - <br/> | ||
| 28 | - <br/> | ||
| 29 | - <?php } ?> | ||
| 30 | - <p class="disclaimer"> | ||
| 31 | - <?php if(WINDOWS_OS) { ?> | ||
| 32 | - cd <?php echo "\"".SYSTEM_ROOT."\""; ?> <br/> | ||
| 33 | - dmsctl.bat install<br/> | ||
| 34 | - dmsctl.bat start | ||
| 35 | - <?php } else { ?> | ||
| 36 | - cd /usr/share/knowledgetree-ce<br/> | ||
| 37 | - sudo ./dmsctl.sh start | 19 | + <?php if(!$migrate_check) { ?> |
| 20 | + <h3>Services</h3> | ||
| 21 | + The KnowledgeTree services need to be started to allow for optimal functioning of the search, indexing and pdf generation. | ||
| 22 | + <?php if(!WINDOWS_OS) { ?> | ||
| 23 | + To start the services, execute the dmsctl.sh shell script in the KnowledgeTree directory from a terminal. | ||
| 24 | + <br/> | ||
| 25 | + <br/> | ||
| 26 | + <?php } else { ?> | ||
| 27 | + To start the services, execute the dmsctl.bat batch file in the KnowledgeTree directory from a command prompt, run as administrator. | ||
| 28 | + <br/> | ||
| 29 | + <br/> | ||
| 30 | + <?php } ?> | ||
| 31 | + <p class="disclaimer"> | ||
| 32 | + <?php if(WINDOWS_OS) { ?> | ||
| 33 | + cd <?php echo "\"".SYSTEM_ROOT."\""; ?> <br/> | ||
| 34 | + dmsctl.bat install<br/> | ||
| 35 | + dmsctl.bat start | ||
| 36 | + <?php } else { ?> | ||
| 37 | + cd /usr/share/knowledgetree-ce<br/> | ||
| 38 | + sudo ./dmsctl.sh start | ||
| 39 | + <?php } ?> | ||
| 40 | + </p> | ||
| 41 | + <br/> | ||
| 38 | <?php } ?> | 42 | <?php } ?> |
| 39 | - </p> | ||
| 40 | - <br/> | ||
| 41 | <?php } ?> | 43 | <?php } ?> |
| 42 | <!-- Paths and Permissions --> | 44 | <!-- Paths and Permissions --> |
| 43 | <?php | 45 | <?php |