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.
"; + return false; } else { $this->temp_variables['services']['KTMysql']['class'] = "tick"; $this->temp_variables['services']['KTMysql']['name'] = "KTMysql"; $this->temp_variables['services']['KTMysql']['msg'] = "Service has been uninstalled"; + return true; } } diff --git a/setup/migrate/templates/installation.tpl b/setup/migrate/templates/installation.tpl index 9eadc2b..4bc960b 100644 --- a/setup/migrate/templates/installation.tpl +++ b/setup/migrate/templates/installation.tpl @@ -33,7 +33,7 @@

- Make sure that the services are running for that installation. + Make sure that the KnowledgeTree services are running.


diff --git a/setup/migrate/templates/services.tpl b/setup/migrate/templates/services.tpl index 37f6255..5038d51 100644 --- a/setup/migrate/templates/services.tpl +++ b/setup/migrate/templates/services.tpl @@ -74,8 +74,10 @@ } ?> -
-

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 @@

-
-

     "; ?>Services

- -
Show Details
- - -
+

Services

+ The KnowledgeTree services need to be started to allow for optimal functioning of the search, indexing and pdf generation. + + To start the services, execute the dmsctl.sh shell script in the KnowledgeTree directory from a terminal. +
+
+ + To start the services, execute the dmsctl.bat batch file in the KnowledgeTree directory from a command prompt, run as administrator. +
+
+ +

+ + cd
+ dmsctl.bat install
+ dmsctl.bat start + + cd /usr/share/knowledgetree-ce
+ sudo ./dmsctl.sh start + +

+
Finish diff --git a/setup/upgrade/upgradeWizard.php b/setup/upgrade/upgradeWizard.php index 4741562..71b649c 100644 --- a/setup/upgrade/upgradeWizard.php +++ b/setup/upgrade/upgradeWizard.php @@ -52,7 +52,6 @@ function __autoload($class) { // Attempt and autoload classes if ($class == "template") { // Load existing templating classes require_once(WIZARD_DIR."../wizard/template.php"); require_once(WIZARD_DIR."../wizard/lib/helpers/htmlHelper.php"); - return ; } if(file_exists(WIZARD_DIR."$class.php")) { require_once(WIZARD_DIR."$class.php"); @@ -155,7 +154,7 @@ class UpgradeWizard { * @return void */ private function createUpgradeFile() { - @touch(SYSTEM_DIR.'var'.DS.'bin'.DS."upgrade.lock"); + touch(SYSTEM_DIR.'var'.DS.'bin'.DS."upgrade.lock"); } /** @@ -167,7 +166,7 @@ class UpgradeWizard { * @return void */ private function removeUpgradeFile() { - @unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."upgrade.lock"); + unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."upgrade.lock"); } /** diff --git a/setup/upgrade/upgrader.php b/setup/upgrade/upgrader.php index 003bdbd..ccabb71 100644 --- a/setup/upgrade/upgrader.php +++ b/setup/upgrade/upgrader.php @@ -413,7 +413,7 @@ class Upgrader { * @return void */ private function _completeUpgrade() { - @touch("upgrade"); + touch("upgrade"); } /** diff --git a/setup/wizard/installUtil.php b/setup/wizard/installUtil.php index a96292e..0796d87 100644 --- a/setup/wizard/installUtil.php +++ b/setup/wizard/installUtil.php @@ -712,7 +712,7 @@ class InstallUtil { */ function deleteMigrateFile() { if(file_exists(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock")) - @unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock"); + unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock"); } /** diff --git a/setup/wizard/installWizard.php b/setup/wizard/installWizard.php index 3aa44ec..bed117e 100644 --- a/setup/wizard/installWizard.php +++ b/setup/wizard/installWizard.php @@ -203,7 +203,7 @@ class InstallWizard { * @return void */ private function createInstallFile() { - @touch(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock"); + touch(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock"); } /** @@ -216,7 +216,7 @@ class InstallWizard { */ private function removeInstallFile() { if(file_exists(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock")) - @unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock"); + unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock"); } /** diff --git a/setup/wizard/path.php b/setup/wizard/path.php index 098ff11..3e6f299 100644 --- a/setup/wizard/path.php +++ b/setup/wizard/path.php @@ -126,7 +126,7 @@ $type = file_get_contents($verType); } if($type) { - define('INSTALL_TYPE', $type); + define('INSTALL_TYPE', trim($type)); } else { define('INSTALL_TYPE', 'community'); } diff --git a/setup/wizard/steps/database.php b/setup/wizard/steps/database.php index d98b4b3..aa62be1 100644 --- a/setup/wizard/steps/database.php +++ b/setup/wizard/steps/database.php @@ -768,13 +768,14 @@ class database extends Step $dbMigrate = $this->util->getDataFromPackage('migrate', 'database'); $sqlFile = $dbMigrate['dumpLocation']; $this->parse_mysql_dump($sqlFile); - $dropPluginHelper = "TRUNCATE plugin_helper;"; + $dropPluginHelper = "TRUNCATE plugin_helper;"; // Remove plugin helper table $this->util->dbUtilities->query($dropPluginHelper); - $updateUrls = 'UPDATE config_settings c SET c.value = "default" where c.group_name = "urls";'; + $updateUrls = 'UPDATE config_settings c SET c.value = "default" where c.group_name = "urls";'; // Remove references to old paths $this->util->dbUtilities->query($updateUrls); - $this->writeBinaries(); - // ensure a guid was generated and is stored - $this->util->getSystemIdentifier(); + $updateExternalBinaries = 'UPDATE config_settings c SET c.value = "default" where c.group_name = "externalBinary";'; // Remove references to old paths + $this->util->dbUtilities->query($updateExternalBinaries); + $this->writeBinaries(); // Rebuild some of the binaries + $this->util->getSystemIdentifier(); // ensure a guid was generated and is stored return true; } @@ -793,7 +794,6 @@ class database extends Step { // continue without attempting to set the path if we can't find the file in the specified location if (!file_exists($bin[1])) continue; - $updateBin = 'UPDATE config_settings c SET c.value = "'. str_replace('\\', '\\\\', $bin[1]) . '" ' . 'where c.group_name = "' . $bin[0] . '" and c.display_name = "'.$displayName.'";'; $this->util->dbUtilities->query($updateBin); diff --git a/setup/wizard/templates/complete.tpl b/setup/wizard/templates/complete.tpl index 68dadda..4f41431 100644 --- a/setup/wizard/templates/complete.tpl +++ b/setup/wizard/templates/complete.tpl @@ -16,28 +16,30 @@
-

Services

- The KnowledgeTree services need to be started to allow for optimal functioning of the search, indexing and pdf generation. - - To start the services, execute the dmsctl.sh shell script in the KnowledgeTree directory from a terminal. -
-
- - To start the services, execute the dmsctl.bat batch file in the KnowledgeTree directory from a command prompt, run as administrator. -
-
- -

- - cd
- dmsctl.bat install
- dmsctl.bat start - - cd /usr/share/knowledgetree-ce
- sudo ./dmsctl.sh start + +

Services

+ The KnowledgeTree services need to be started to allow for optimal functioning of the search, indexing and pdf generation. + + To start the services, execute the dmsctl.sh shell script in the KnowledgeTree directory from a terminal. +
+
+ + To start the services, execute the dmsctl.bat batch file in the KnowledgeTree directory from a command prompt, run as administrator. +
+
+ +

+ + cd
+ dmsctl.bat install
+ dmsctl.bat start + + cd /usr/share/knowledgetree-ce
+ sudo ./dmsctl.sh start + +

+
-

-