diff --git a/setup/migrate/migrateWizard.php b/setup/migrate/migrateWizard.php index c13b6b9..82cdeaf 100644 --- a/setup/migrate/migrateWizard.php +++ b/setup/migrate/migrateWizard.php @@ -177,7 +177,7 @@ class MigrateWizard { * @return void */ private function createMigrateFile() { - @touch("migrate"); + touch("migrate"); } /** @@ -189,7 +189,7 @@ class MigrateWizard { * @return void */ private function removeMigrateFile() { - @unlink("migrate"); + unlink("migrate"); } /** diff --git a/setup/migrate/migrater.php b/setup/migrate/migrater.php index ba0d0ef..dff40d1 100644 --- a/setup/migrate/migrater.php +++ b/setup/migrate/migrater.php @@ -413,7 +413,7 @@ class Migrater { * @return void */ private function _completeMigrate() { - @touch("migrate"); + touch("migrate"); } /** diff --git a/setup/migrate/steps/migrateDatabase.php b/setup/migrate/steps/migrateDatabase.php index 2bba900..179d212 100644 --- a/setup/migrate/steps/migrateDatabase.php +++ b/setup/migrate/steps/migrateDatabase.php @@ -117,6 +117,7 @@ class migrateDatabase extends Step } } } + $noFile = false; $installation = $this->getDataFromSession("installation"); // Get installation directory $manual = false; // If file was exported manually $dbSettings = $installation['dbSettings']; @@ -125,7 +126,7 @@ class migrateDatabase extends Step $tmpFolder = $this->resolveTempDir(); if(WINDOWS_OS) { $termOrBash = "command prompt window"; - $exe = "$location".DS."mysql".DS."bin".DS."mysqldump.exe".DS; + $exe = "\"$location".DS."mysql".DS."bin".DS."mysqldump.exe\""; } else { $termOrBash = "terminal window"; $exe = "\"$location".DS."mysql".DS."bin".DS."mysqldump\""; // Location of dump @@ -153,23 +154,20 @@ class migrateDatabase extends Step return true; } } + $noFile = true; // Handle failed dump if(WINDOWS_OS) { // Could be permissions, check error code. - if($response['ret'] == 2) { - - } else { + if(!$noFile) { $sqlFile = "C:\\kt-backup-$date.sql"; // Use tmp instead due to permissions } } else { - if($response['ret'] == 2) { - - } else { + if(!$noFile) { $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions } } $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile; - if($response['ret'] == 2) { + if($noFile) { $this->error[]['error'] = "Could not connect to the KnowledgeTree Database"; $this->error[]['msg'] = "Make sure all KnowledgeTree Services are running."; $this->error[]['cmd'] = "
Click Next after resolving the above errors.
"; @@ -207,6 +205,7 @@ class migrateDatabase extends Step * @return void */ private function setDetails() { + $this->createMigrateFile(); // create lock file to indicate migration mode $database = $this->getDataFromSession("database"); if(isset($database['dumpLocation'])) { if(!empty($database['dumpLocation'])) { @@ -219,7 +218,7 @@ class migrateDatabase extends Step $this->temp_variables['duname'] = $this->getPostSafe('duname'); $this->temp_variables['dpassword'] = $this->getPostSafe('dpassword'); $this->temp_variables['dumpLocation'] = $this->getPostSafe('dumpLocation'); - $this->createMigrateFile(); // create lock file to indicate migration mode + return true; } @@ -231,7 +230,7 @@ class migrateDatabase extends Step * @return void */ private function createMigrateFile() { - @touch(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock"); + touch(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock"); } /** diff --git a/setup/migrate/steps/migrateServices.php b/setup/migrate/steps/migrateServices.php index 9d463b8..b1f0aed 100644 --- a/setup/migrate/steps/migrateServices.php +++ b/setup/migrate/steps/migrateServices.php @@ -272,7 +272,9 @@ class migrateServices extends Step $this->temp_variables['services'][$serv->getName()]['class'] = $state; $this->temp_variables['services'][$serv->getName()]['name'] = $serv->getName(); } - $this->checkMysql(); + if(!$this->checkMysql()) { + return false; + } if ($this->serviceCheck != 'tick') { return false; } @@ -292,10 +294,12 @@ class migrateServices extends Step $this->temp_variables['services']['KTMysql']['name'] = "KTMysql"; $this->temp_variables['services']['KTMysql']['msg'] = "Service Running"; $this->error[] = "Service : KTMysql running.- Make sure that the services are running for that installation. + Make sure that the KnowledgeTree services are running.
Click Next after deactivating the above services.
+ +Click Next if deactivating the above services.
+ diff --git a/setup/upgrade/steps/upgradeDatabase.php b/setup/upgrade/steps/upgradeDatabase.php index 804088c..789f483 100644 --- a/setup/upgrade/steps/upgradeDatabase.php +++ b/setup/upgrade/steps/upgradeDatabase.php @@ -268,7 +268,7 @@ class upgradeDatabase extends Step // It should idealy work the same as the upgrades. // Lock the scheduler $lockFile = $this->cachePath . DIRECTORY_SEPARATOR . 'scheduler.lock'; - @touch($lockFile); + touch($lockFile); return true; } @@ -287,7 +287,7 @@ class upgradeDatabase extends Step // things up a bit exec("del /q /s " . escapeshellarg($sPath)); } - $hPath = @opendir($sPath); + $hPath = opendir($sPath); while (($sFilename = readdir($hPath)) !== false) { if (in_array($sFilename, array('.', '..'))) { continue; @@ -297,11 +297,11 @@ class upgradeDatabase extends Step $this->deleteDirectory($sFullFilename); continue; } - @chmod($sFullFilename, 0666); - @unlink($sFullFilename); + chmod($sFullFilename, 0666); + unlink($sFullFilename); } closedir($hPath); - @rmdir($sPath); + rmdir($sPath); } private function performPostUpgradeActions() { @@ -320,7 +320,7 @@ class upgradeDatabase extends Step // Unlock the scheduler $lockFile = $this->cachePath . DIRECTORY_SEPARATOR . 'scheduler.lock'; if(file_exists($lockFile)){ - @unlink($lockFile); + unlink($lockFile); } return true; diff --git a/setup/upgrade/steps/upgradeWelcome.php b/setup/upgrade/steps/upgradeWelcome.php index e6d3c74..a33502d 100644 --- a/setup/upgrade/steps/upgradeWelcome.php +++ b/setup/upgrade/steps/upgradeWelcome.php @@ -92,19 +92,12 @@ class upgradeWelcome extends step { $dconf = $this->getDataFromPackage('installers', 'database'); // Use info from install if($dconf) { // From Install $this->util->dbUtilities->load($dconf['dhost'], $dconf['dport'], $dconf['duname'], $dconf['dpassword'], $dconf['dname']); - } elseif($upgradeOnly) { - require_once("../wizard/steps/configuration.php"); // configuration to read the ini path - $wizConfigHandler = new configuration(); - $configPath = $wizConfigHandler->readConfigPathIni(); - $this->util->iniUtilities->load($configPath); - $dconf = $this->util->iniUtilities->getSection('db'); - $this->util->dbUtilities->load($dconf['dbHost'],$dconf['dbPort'], $dconf['dbUser'], $dconf['dbPass'], $dconf['dbName']); $sQuery = "SELECT count(*) AS match_count FROM users WHERE username = '$username' AND password = '".md5($password)."'"; $res = $this->util->dbUtilities->query($sQuery); $ass = $this->util->dbUtilities->fetchAssoc($res); if($ass[0]['match_count'] == 1) return true; - } else { // Upgrade + } elseif($upgradeOnly) { require_once("../wizard/steps/configuration.php"); // configuration to read the ini path $wizConfigHandler = new configuration(); $configPath = $wizConfigHandler->readConfigPathIni(); @@ -116,6 +109,20 @@ class upgradeWelcome extends step { $ass = $this->util->dbUtilities->fetchAssoc($res); if($ass[0]['match_count'] == 1) return true; + } else { // Upgrade + require_once("../wizard/steps/configuration.php"); // configuration to read the ini path + $wizConfigHandler = new configuration(); + $configPath = $wizConfigHandler->readConfigPathIni(); + if($configPath) { + $this->util->iniUtilities->load($configPath); + $dconf = $this->util->iniUtilities->getSection('db'); + $this->util->dbUtilities->load($dconf['dbHost'],$dconf['dbPort'], $dconf['dbUser'], $dconf['dbPass'], $dconf['dbName']); + $sQuery = "SELECT count(*) AS match_count FROM users WHERE username = '$username' AND password = '".md5($password)."'"; + $res = $this->util->dbUtilities->query($sQuery); + $ass = $this->util->dbUtilities->fetchAssoc($res); + if($ass[0]['match_count'] == 1) + return true; + } } $this->error[] = 'Could Not Authenticate User'; return false; diff --git a/setup/upgrade/templates/complete.tpl b/setup/upgrade/templates/complete.tpl index 9dd4dd4..9d86f35 100644 --- a/setup/upgrade/templates/complete.tpl +++ b/setup/upgrade/templates/complete.tpl @@ -10,57 +10,28 @@
+
+ cd
+ dmsctl.bat install
+ dmsctl.bat start
+
+ cd /usr/share/knowledgetree-ce
+ sudo ./dmsctl.sh start
+
+
-
- cd
- dmsctl.bat install
- dmsctl.bat start
-
- cd /usr/share/knowledgetree-ce
- sudo ./dmsctl.sh start
+
+
+
+ cd
+ dmsctl.bat install
+ dmsctl.bat start
+
+ cd /usr/share/knowledgetree-ce
+ sudo ./dmsctl.sh start
+
+