diff --git a/setup/migrate/migrateWizard.php b/setup/migrate/migrateWizard.php index fbe812e..cf634e7 100644 --- a/setup/migrate/migrateWizard.php +++ b/setup/migrate/migrateWizard.php @@ -257,7 +257,7 @@ class MigrateWizard { } } else { // TODO: Die gracefully - $this->util->error("System has been migrated Finish"); + $this->util->error("System has been migrated Finish"); } } } diff --git a/setup/migrate/session.php b/setup/migrate/session.php index 35e7a7a..4d5489a 100644 --- a/setup/migrate/session.php +++ b/setup/migrate/session.php @@ -63,7 +63,7 @@ class Session */ public function startSession() { if(!isset($_SESSION[$this->salt]['ready'])) { - session_start(); + @session_start(); $_SESSION[$this->salt] ['ready'] = TRUE; } } diff --git a/setup/migrate/steps/migrateDatabase.php b/setup/migrate/steps/migrateDatabase.php index e9d872b..26a2257 100644 --- a/setup/migrate/steps/migrateDatabase.php +++ b/setup/migrate/steps/migrateDatabase.php @@ -122,16 +122,14 @@ class migrateDatabase extends Step $manual = false; // If file was exported manually $dbSettings = $installation['dbSettings']; $location = $installation['location']; -// $uname = $this->temp_variables['duname']; -// $pwrd = $this->temp_variables['dpassword']; $port = $this->util->getPort($location); $tmpFolder = $this->resolveTempDir(); if(WINDOWS_OS) { $termOrBash = "command prompt window"; - $exe = DS."$location".DS."mysql".DS."bin".DS."mysqldump.exe".DS; // Location of dump + $exe = "\"$location".DS."mysql".DS."bin".DS."mysqldump\""; // Location of dump } else { $termOrBash = "terminal window"; - $exe = "'$location".DS."mysql".DS."bin".DS."mysqldump'"; // Location of dump + $exe = DS."$location".DS."mysql".DS."bin".DS."mysqldump.exe".DS; } $date = date('Y-m-d-H-i-s'); if(isset($database['manual_export'])) { @@ -157,7 +155,11 @@ class migrateDatabase extends Step } } // Handle failed dump - $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions + if(WINDOWS_OS) { + $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions + } else { + $sqlFile = "C:\kt-backup-$date.sql"; // Use tmp instead due to permissions + } $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile; $this->error[]['error'] = "Could not export database:"; $this->error[]['msg'] = "Execute the following command in a $termOrBash."; diff --git a/setup/upgrade/lib/UpgradeItems.inc.php b/setup/upgrade/lib/UpgradeItems.inc.php index 561401c..f604872 100644 --- a/setup/upgrade/lib/UpgradeItems.inc.php +++ b/setup/upgrade/lib/UpgradeItems.inc.php @@ -67,15 +67,15 @@ class Upgrade_Already_Applied { class UpgradeItem { - var $type = ""; - var $name; - var $version; - var $description; - var $phase; - var $priority = 0; - var $parent; - var $date; - var $result; + public $type = ""; + public $name; + public $version; + public $description; + public $phase; + public $priority = 0; + public $parent; + public $date; + public $result; function UpgradeItem($name, $version, $description = null, $phase = 0, $priority = 0) { $this->name = $name; @@ -326,6 +326,7 @@ class SQLUpgradeItem extends UpgradeItem { public static function _getDetailsFromFileName($path) { // Old format (pre 2.0.6) + $matches = false; $matched = preg_match('#^([\d.]*)-to-([\d.]*).sql$#', $path, $matches); if ($matched != 0) { $fromVersion = $matches[1]; @@ -345,6 +346,7 @@ class SQLUpgradeItem extends UpgradeItem { //$priority = (int)$matches[4]; $priority = 0; + $priorities = false; $iPriority = preg_match('#^(.*)-(\d*)$#', $matches[3], $priorities); if($iPriority != 0){ $priority = $priorities[2]; diff --git a/setup/upgrade/lib/sqlfile.inc.php b/setup/upgrade/lib/sqlfile.inc.php index 9fb3ebc..9362844 100644 --- a/setup/upgrade/lib/sqlfile.inc.php +++ b/setup/upgrade/lib/sqlfile.inc.php @@ -42,8 +42,8 @@ class SQLFile { } function splitSQL($sql) { - $instring = false; - $i = 0; +// $instring = false; +// $i = 0; $remaining = $sql; $query = ""; $aQueries = array(); diff --git a/setup/upgrade/session.php b/setup/upgrade/session.php index 35ec698..babe7e4 100644 --- a/setup/upgrade/session.php +++ b/setup/upgrade/session.php @@ -63,7 +63,7 @@ class session */ public function startSession() { if(!isset($_SESSION[$this->salt]['ready'])) { - session_start(); + @session_start(); $_SESSION[$this->salt] ['ready'] = TRUE; } } diff --git a/setup/upgrade/stepAction.php b/setup/upgrade/stepAction.php index ac20a9c..180dcc7 100644 --- a/setup/upgrade/stepAction.php +++ b/setup/upgrade/stepAction.php @@ -229,12 +229,12 @@ class stepAction { } else { $this->_clearErrors($this->stepName); // Send Errors to session } - return $response; } else { $this->stepName = 'errors'; $this->action = $this->createStep(); $this->action->error = array('Class File Missing in Step Directory'); } + return $response; } /** @@ -308,7 +308,7 @@ class stepAction { $menu = ''; $active = false; if($this->stepClassNames) { - foreach ($this->stepClassNames as $k=>$step) { + foreach ($this->stepClassNames as $step) { if($this->step_names[$step] != '') { $item = $this->step_names[$step]; } else { @@ -452,7 +452,7 @@ class stepAction { * @access private * @return void */ - private function _loadValueToSession($class, $k, $v, $overwrite = false) { + private function _loadValueToSession($class, $k, $v) { if($this->session != null) { $this->session->setClass($class, $k, $v); } else { @@ -502,8 +502,7 @@ class stepAction { * @access private * @return void */ - private function _loadErrorToSession($class, $k, $v, $overwrite = false) { - $k = "errors"; + private function _loadErrorToSession($class, $k = "errors", $v) { if($this->session != null) { $this->session->setClassError($class, $k, $v); } else { diff --git a/setup/upgrade/steps/upgradeBackup.php b/setup/upgrade/steps/upgradeBackup.php index 51f28d8..cdbd553 100644 --- a/setup/upgrade/steps/upgradeBackup.php +++ b/setup/upgrade/steps/upgradeBackup.php @@ -188,7 +188,7 @@ class upgradeBackup extends Step { { $adminUser = $this->dbSettings['dbAdminUser']; $adminPwd = $this->dbSettings['dbAdminPass']; - $dbHost = $this->dbSettings['dbHost']; +// $dbHost = $this->dbSettings['dbHost']; $dbName = $this->dbSettings['dbName']; $dbPort = trim($this->dbSettings['dbPort']); diff --git a/setup/upgrade/steps/upgradeComplete.php b/setup/upgrade/steps/upgradeComplete.php index efa0ef9..eaa399d 100644 --- a/setup/upgrade/steps/upgradeComplete.php +++ b/setup/upgrade/steps/upgradeComplete.php @@ -42,19 +42,42 @@ class upgradeComplete extends Step { - protected $silent = false; + protected $silent = true; protected $temp_variables = array(); - - + private $migrateCheck = false; + private $servicesCheck = 'tick'; + public function doStep() { $this->temp_variables = array("step_name"=>"complete", "silent"=>$this->silent); - $this->doRun(); + $this->storeSilent(); return 'landing'; } private function doRun() { - $this->storeSilent();// Set silent mode variables + if($this->util->isMigration()) { + $this->storeSilent();// Set silent mode variables + require_once("../wizard/steps/services.php"); // configuration to read the ini path + $wizServices = new services(); + foreach ($wizServices->getServices() as $serviceName) { + $className = OS.$serviceName; + require_once("../wizard/lib/services/service.php"); + require_once("../wizard/lib/services/".OS."Service.php"); + require_once("../wizard/lib/services/$className.php"); + $aService = new $className(); + $aService->load(); // Load Defaults + $aService->start(); // Start Service + $status = $aService->status(); // Get service status + if($status) { + $this->temp_variables[$serviceName."Status"] = 'tick'; + } else { + $this->temp_variables[$serviceName."Status"] = 'cross_orange'; + $this->servicesCheck = 'cross_orange'; + } + } + $this->migrateCheck = true; + } + return true; } /** @@ -64,6 +87,8 @@ class upgradeComplete extends Step { protected function storeSilent() { $v = $this->getDataFromSession('upgradeProperties'); $this->temp_variables['sysVersion'] = $v['upgrade_version']; + $this->temp_variables['migrateCheck'] = $this->migrateCheck; + $this->temp_variables['servicesCheck'] = $this->servicesCheck; } } diff --git a/setup/upgrade/steps/upgradeDatabase.php b/setup/upgrade/steps/upgradeDatabase.php index c3360c7..804088c 100644 --- a/setup/upgrade/steps/upgradeDatabase.php +++ b/setup/upgrade/steps/upgradeDatabase.php @@ -135,7 +135,7 @@ class upgradeDatabase extends Step private function doRun($action = null) { $this->readConfig(); - $con = $this->util->dbUtilities->load($this->dbSettings['dbHost'], $this->dbSettings['dbPort'], $this->dbSettings['dbUser'],$this->dbSettings['dbPass'], $this->dbSettings['dbName']); + $this->util->dbUtilities->load($this->dbSettings['dbHost'], $this->dbSettings['dbPort'], $this->dbSettings['dbUser'],$this->dbSettings['dbPass'], $this->dbSettings['dbName']); $this->temp_variables['action'] = $action; if (is_null($action) || ($action == 'preview')) { @@ -238,7 +238,7 @@ class upgradeDatabase extends Step $this->temp_variables['detail'] = '

The table below describes the upgrades that have occurred to upgrade your KnowledgeTree installation to ' . $this->sysVersion . ''; - $pre_res = $this->performPreUpgradeActions(); + $this->performPreUpgradeActions(); $res = $this->performAllUpgrades(); if (!$res) { @@ -256,7 +256,7 @@ class upgradeDatabase extends Step $this->temp_variables['upgradeStatus'] = 'Upgrade succeeded.'; } - $post_pres = $this->performPostUpgradeActions(); + $this->performPostUpgradeActions(); return !$errors; @@ -311,7 +311,7 @@ class upgradeDatabase extends Step // Ensure all plugins are re-registered. $sql = "TRUNCATE plugin_helper"; - $res = $this->util->dbUtilities->query($sql); + $this->util->dbUtilities->query($sql); // Clear out all caches and proxies - they need to be regenerated with the new code $this->deleteDirectory($this->proxyPath); diff --git a/setup/upgrade/steps/upgradeRestore.php b/setup/upgrade/steps/upgradeRestore.php index 1cdc480..db08022 100644 --- a/setup/upgrade/steps/upgradeRestore.php +++ b/setup/upgrade/steps/upgradeRestore.php @@ -104,7 +104,7 @@ class upgradeRestore extends Step { private function restoreDatabase() { $this->temp_variables['restore'] = true; - $status = $_SESSION['backupStatus']; + //$status = $_SESSION['backupStatus']; $filename = $_SESSION['backupFile']; $stmt = $this->util->create_restore_stmt($filename, $this->dbSettings); $dir = $stmt['dir']; @@ -174,7 +174,8 @@ class upgradeRestore extends Step { $dir = $this->util->resolveTempDir(); $files = array(); - if ($dh = opendir($dir)) + $dh = opendir($dir); + if ($dh) { while (($file = readdir($dh)) !== false) { @@ -210,7 +211,7 @@ class upgradeRestore extends Step { return; } - $status = $_SESSION['backupStatus']; +// $status = $_SESSION['backupStatus']; $filename = $_SESSION['backupFile']; $stmt = $this->util->create_restore_stmt($filename, $this->dbSettings); diff --git a/setup/upgrade/steps/upgradeWelcome.php b/setup/upgrade/steps/upgradeWelcome.php index b1dbd9f..73c4c85 100644 --- a/setup/upgrade/steps/upgradeWelcome.php +++ b/setup/upgrade/steps/upgradeWelcome.php @@ -49,8 +49,11 @@ class upgradeWelcome extends step { public function doStep() { $upgradeOnly = false; - if(isset($_GET['action'])) if($_GET['action'] == 'installer') $upgradeOnly = true; -// print_r($_GET['action']); + if(isset($_GET['action'])) { + if($_GET['action'] == 'installer') { + $upgradeOnly = true; + } + } $this->temp_variables = array("step_name"=>"welcome", "upgradeOnly"=>$upgradeOnly); if($this->next()) { if ($this->doRun()) { @@ -114,7 +117,6 @@ class upgradeWelcome extends step { if($ass[0]['match_count'] == 1) return true; } - print_r($this->util->dbUtilities); $this->error[] = 'Could Not Authenticate User'; return false; diff --git a/setup/upgrade/templates/complete.tpl b/setup/upgrade/templates/complete.tpl index 91b7368..6b7e139 100644 --- a/setup/upgrade/templates/complete.tpl +++ b/setup/upgrade/templates/complete.tpl @@ -8,6 +8,60 @@

Your database has been upgraded to
+

+ +
+

     "; ?>Services

+ +
Show Details
+ + +
+ - Finish + Finish \ No newline at end of file diff --git a/setup/upgrade/templates/welcome.tpl b/setup/upgrade/templates/welcome.tpl index 502e611..7c39bab 100644 --- a/setup/upgrade/templates/welcome.tpl +++ b/setup/upgrade/templates/welcome.tpl @@ -9,7 +9,7 @@

Only administrator users may access the upgrade wizard.

- + - \ No newline at end of file + + \ No newline at end of file diff --git a/setup/upgrade/upgradeUtil.php b/setup/upgrade/upgradeUtil.php index 24dbfab..70e3a6b 100644 --- a/setup/upgrade/upgradeUtil.php +++ b/setup/upgrade/upgradeUtil.php @@ -60,6 +60,19 @@ class UpgradeUtil extends InstallUtil { return false; } + /** + * Check if we are migrating an existing installation + * + * @author KnowledgeTree Team + * @access public + * @return boolean + */ + public function isMigration() { + if(file_exists("../wizard/migrate.lock")) + return true; + return false; + } + public function error($error) { $template_vars['error'] = $error; $file = "templates/error.tpl"; @@ -122,7 +135,7 @@ class UpgradeUtil extends InstallUtil { $adminUser = $dbConfig['dbAdminUser']; $adminPwd = $dbConfig['dbAdminPass']; - $dbHost = $dbConfig['dbHost']; +// $dbHost = $dbConfig['dbHost']; $dbName = $dbConfig['dbName']; $dbPort = trim($dbConfig['dbPort']); if ($dbPort=='' || $dbPort=='default')$dbPort = get_cfg_var('mysql.default_port'); @@ -147,7 +160,8 @@ class UpgradeUtil extends InstallUtil { $mechanism = "--port=\"$dbPort\""; } - $tmpdir = $this->resolveTempDir(); +// $tmpdir = $this->resolveTempDir(); + $this->resolveTempDir(); $stmt = $prefix ."mysqladmin --user=\"$adminUser\" -p $mechanism drop \"$dbName\"
"; $stmt .= $prefix ."mysqladmin --user=\"$adminUser\" -p $mechanism create \"$dbName\"
"; diff --git a/setup/upgrade/upgrader.php b/setup/upgrade/upgrader.php index 30dedf9..55bdffb 100644 --- a/setup/upgrade/upgrader.php +++ b/setup/upgrade/upgrader.php @@ -157,7 +157,7 @@ class Upgrader { $this->simpleXmlObj = simplexml_load_file(CONF_DIR.$name); } catch (Exception $e) { $util = new UpgradeUtil(); - $util->error("Error reading configuration file: $name"); + $util->error("Error reading configuration file: $e"); exit(); } } @@ -431,8 +431,7 @@ class Upgrader { if($class->runUpgrade()) { // Check if step needs to be upgraded $class->setDataFromSession($className); // Set Session Information $class->setPostConfig(); // Set any posted variables - $response = $class->upgradeStep(); // Run upgrade step - // TODO : Break on error response + $class->upgradeStep(); // Run upgrade step } } else { $util = new UpgradeUtil(); diff --git a/setup/wizard/installWizard.php b/setup/wizard/installWizard.php index ca83100..437a776 100644 --- a/setup/wizard/installWizard.php +++ b/setup/wizard/installWizard.php @@ -294,7 +294,7 @@ class InstallWizard { } } else { // TODO: Die gracefully - $this->util->error("System has been installed Finish"); + $this->util->error("System has been installed Finish"); } } } diff --git a/setup/wizard/lib/services/unixScheduler.php b/setup/wizard/lib/services/unixScheduler.php index 64ed735..03dcdcd 100644 --- a/setup/wizard/lib/services/unixScheduler.php +++ b/setup/wizard/lib/services/unixScheduler.php @@ -57,7 +57,7 @@ class unixScheduler extends unixService { * @param string * @return void */ - public function load($options = null) { + public function load() { $this->setPhpCli(); $this->scheduler = 'scheduler'; $this->setSchedulerSource('schedulerTask.sh'); @@ -155,6 +155,7 @@ class unixScheduler extends unixService { if(is_array($response['out'])) { if(count($response['out']) > 1) { foreach ($response['out'] as $r) { + $matches = false; preg_match('/grep/', $r, $matches); // Ignore grep if(!$matches) { return 'STARTED'; diff --git a/setup/wizard/lib/services/windowsLucene.php b/setup/wizard/lib/services/windowsLucene.php index 9981663..4a0e3df 100644 --- a/setup/wizard/lib/services/windowsLucene.php +++ b/setup/wizard/lib/services/windowsLucene.php @@ -140,7 +140,7 @@ class windowsLucene extends windowsService { * @param string * @return void */ - public function load($options = null) { + public function load() { $this->setJavaBin(); $this->setLuceneDIR(SYSTEM_DIR."bin".DS."luceneserver"); $this->setLuceneExe("KTLuceneService.exe"); @@ -179,7 +179,7 @@ class windowsLucene extends windowsService { * @param string * @return void */ - private function setJavaBin($javaBin = '') { + private function setJavaBin() { if($this->util->zendBridge()) { if($this->util->javaBridge()) { $this->javaSystem = new Java('java.lang.System'); @@ -391,7 +391,7 @@ class windowsLucene extends windowsService { array_pop($sysdir); array_pop($sysdir); $zendsys = ''; - foreach ($sysdir as $k=>$v) { + foreach ($sysdir as $v) { $zendsys .= $v.DS; } $jvm = $zendsys."jre".DS."bin".DS."client".DS."jvm.dll"; @@ -429,12 +429,12 @@ class windowsLucene extends windowsService { $luceneExe = $this->getLuceneExe(); $luceneSource = $this->getLuceneSource(); $luceneDir = $this->getluceneDir(); - $javaJVM = $this->getJavaJVM(); +// $javaJVM = $this->getJavaJVM(); if($luceneExe && $luceneSource && $luceneDir) { $cmd = "\"{$luceneExe}\""." -install \"".$this->getName()."\" \"".$this->getJavaJVM(). "\" -Djava.class.path=\"".$luceneSource."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$luceneDir."\" -auto"; if(DEBUG) { echo "$cmd
"; - return ; + return false; } $response = $this->util->pexec($cmd); return $response; diff --git a/setup/wizard/lib/services/windowsOpenOffice.php b/setup/wizard/lib/services/windowsOpenOffice.php index c26517b..716b9ad 100644 --- a/setup/wizard/lib/services/windowsOpenOffice.php +++ b/setup/wizard/lib/services/windowsOpenOffice.php @@ -183,10 +183,11 @@ class windowsOpenOffice extends windowsService { } private function setWinservice($winservice = "winserv.exe") { - if(file_exists(SYS_BIN_DIR . $winservice)) + if(file_exists(SYS_BIN_DIR . $winservice)) { $this->winservice = SYS_BIN_DIR . $winservice; - else if(file_exists(SYS_BIN_DIR . "win32" . DS. $winservice)) + } else if(file_exists(SYS_BIN_DIR . "win32" . DS. $winservice)) { $this->winservice = SYS_BIN_DIR . "win32" . DS. $winservice; + } } public function getWinservice() { @@ -206,7 +207,7 @@ class windowsOpenOffice extends windowsService { $cmd = "\"{$this->winservice}\" install $this->name "."-displayname {$this->name} -start auto \"".$binary."\" -headless -invisible -nofirststartwizard -\"accept=socket,host={$this->host},port={$this->port};urp;\"";; if(DEBUG) { echo "$cmd
"; - return ; + return false; } $response = $this->util->pexec($cmd); return $response; diff --git a/setup/wizard/lib/services/windowsScheduler.php b/setup/wizard/lib/services/windowsScheduler.php index 78d08e8..05b8374 100644 --- a/setup/wizard/lib/services/windowsScheduler.php +++ b/setup/wizard/lib/services/windowsScheduler.php @@ -85,7 +85,7 @@ class windowsScheduler extends windowsService { * @param string * @return void */ - function load($options = null) { + function load() { $this->setSchedulerDIR($this->varDir."bin"); $this->setSchedulerScriptPath("taskrunner.bat"); $this->setSchedulerSource("schedulerService.php"); @@ -227,7 +227,7 @@ class windowsScheduler extends windowsService { $cmd = "\"{$this->winservice}\" install $this->name $this->options"; if(DEBUG) { echo "$cmd
"; - return ; + return false; } $response = $this->util->pexec($cmd); return $response; diff --git a/setup/wizard/lib/services/windowsService.php b/setup/wizard/lib/services/windowsService.php index 41e48bd..eebe002 100644 --- a/setup/wizard/lib/services/windowsService.php +++ b/setup/wizard/lib/services/windowsService.php @@ -163,7 +163,7 @@ class windowsService extends Service { * @return array */ public function restart() { - $response = $this->stop(); + $this->stop(); sleep(1); $this->start(); } diff --git a/setup/wizard/lib/tests/configurationStep.php b/setup/wizard/lib/tests/configurationStep.php new file mode 100644 index 0000000..a7805a8 --- /dev/null +++ b/setup/wizard/lib/tests/configurationStep.php @@ -0,0 +1,66 @@ +. +* +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, +* California 94120-7775, or email info@knowledgetree.com. +* +* The interactive user interfaces in modified source and object code versions +* of this program must display Appropriate Legal Notices, as required under +* Section 5 of the GNU General Public License version 3. +* +* In accordance with Section 7(b) of the GNU General Public License version 3, +* these Appropriate Legal Notices must retain the display of the "Powered by +* KnowledgeTree" logo and retain the original copyright notice. If the display of the +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices +* must display the words "Powered by KnowledgeTree" and retain the original +* copyright notice. +* +* @copyright 2008-2009, KnowledgeTree Inc. +* @license GNU General Public License version 3 +* @author KnowledgeTree Team +* @package Installer +* @version Version 0.1 +*/ +if(isset($_GET['action'])) { + $func = $_GET['action']; + if($func != '' && $func != 'installer') { + require_once("../iniUtilities.php"); + require_once("../step.php"); + require_once("../path.php"); + require_once("../dbUtilities.php"); + require_once("../installUtil.php"); + } +} + +class configurationStep { + +} + +if(isset($_GET['action'])) { + $func = $_GET['action']; + if($func != '' && $func != 'installer') { + $serv = new configuration(); + $func_call = strtoupper(substr($func,0,1)).substr($func,1); + $method = "do$func_call"; + $serv->$method(); + } +} +?> \ No newline at end of file diff --git a/setup/wizard/lib/tests/databaseStep.php b/setup/wizard/lib/tests/databaseStep.php new file mode 100644 index 0000000..1d26f08 --- /dev/null +++ b/setup/wizard/lib/tests/databaseStep.php @@ -0,0 +1,76 @@ +. +* +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, +* California 94120-7775, or email info@knowledgetree.com. +* +* The interactive user interfaces in modified source and object code versions +* of this program must display Appropriate Legal Notices, as required under +* Section 5 of the GNU General Public License version 3. +* +* In accordance with Section 7(b) of the GNU General Public License version 3, +* these Appropriate Legal Notices must retain the display of the "Powered by +* KnowledgeTree" logo and retain the original copyright notice. If the display of the +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices +* must display the words "Powered by KnowledgeTree" and retain the original +* copyright notice. +* +* @copyright 2008-2009, KnowledgeTree Inc. +* @license GNU General Public License version 3 +* @author KnowledgeTree Team +* @package Installer +* @version Version 0.1 +*/ + +if(isset($_GET['action'])) { + $func = $_GET['action']; + if($func != '') { + require_once("../step.php"); + require_once("../installUtil.php"); + require_once("../path.php"); + require_once("../dbUtilities.php"); + } +} + +class databaseStep { + + public function doCreateSchema() { + $this->dhost = '127.0.0.1'; + $this->duname = 'root'; + $this->dpassword = 'root'; + $this->dname = 'dms_install'; + $this->dbbinary = 'mysql'; + $this->util->dbUtilities->load($this->dhost, '', $this->duname, $this->dpassword, $this->dname); + $this->createSchema(); + echo 'Schema loaded
'; + } +} + +if(isset($_GET['action'])) { + $func = $_GET['action']; + if($func != '') { + $serv = new database(); + $func_call = strtoupper(substr($func,0,1)).substr($func,1); + $method = "do$func_call"; + $serv->$method(); + } +} +?> \ No newline at end of file diff --git a/setup/wizard/lib/tests/servicesStep.php b/setup/wizard/lib/tests/servicesStep.php new file mode 100644 index 0000000..d9fff14 --- /dev/null +++ b/setup/wizard/lib/tests/servicesStep.php @@ -0,0 +1,119 @@ +. +* +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, +* California 94120-7775, or email info@knowledgetree.com. +* +* The interactive user interfaces in modified source and object code versions +* of this program must display Appropriate Legal Notices, as required under +* Section 5 of the GNU General Public License version 3. +* +* In accordance with Section 7(b) of the GNU General Public License version 3, +* these Appropriate Legal Notices must retain the display of the "Powered by +* KnowledgeTree" logo and retain the original copyright notice. If the display of the +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices +* must display the words "Powered by KnowledgeTree" and retain the original +* copyright notice. +* +* @copyright 2008-2009, KnowledgeTree Inc. +* @license GNU General Public License version 3 +* @author KnowledgeTree Team +* @package Installer +* @version Version 0.1 +*/ +if(isset($_GET['action'])) { + $func = $_GET['action']; + if($func != '') { + require_once(WIZARD_DIR. "step.php"); + require_once(WIZARD_DIR. "installUtil.php"); + require_once(WIZARD_DIR. "path.php"); + require_once(WIZARD_DIR. "dbUtilities.php"); + } +} + +class servicesStep { + /** External Access **/ + public function doDeleteAll() { + $serverDetails = $this->getServices(); + foreach ($serverDetails as $serviceName) { + $className = OS.$serviceName; + require_once("../lib/services/service.php"); + require_once("../lib/services/".OS."Service.php"); + require_once("../lib/services/$className.php"); + $service = new $className(); + $service->uninstall(); + echo "Delete Service {$service->getName()}
"; + echo "Status of service ".$service->status()."
"; + } + } + + public function doInstallAll() { + $serverDetails = $this->getServices(); + if(!empty($serverDetails)) { + require_once("../lib/validation/serviceValidation.php"); + require_once("../lib/services/service.php"); + } + foreach ($serverDetails as $serviceName) { + $className = OS.$serviceName; + $serv = strtolower($serviceName); // Linux Systems. + require_once("../lib/services/".OS."Service.php"); + require_once("../lib/validation/$serv"."Validation.php"); + require_once("../lib/services/$className.php"); + $service = new $className(); + $class = strtolower($serviceName)."Validation"; + $vClass = new $class(); + $passed = $vClass->binaryChecks(); // Run Binary Pre Checks + $service->load(array('binary'=>$passed)); + $service->install(); + echo "Install Service {$service->getName()}
"; + echo "Status of service ".$service->status()."
"; + } + } + + public function doStatusAll() { + $serverDetails = $this->getServices(); + foreach ($serverDetails as $serviceName) { + $className = OS.$serviceName; + require_once("../lib/services/service.php"); + require_once("../lib/services/".OS."Service.php"); + require_once("../lib/services/$className.php"); + $service = new $className(); + $service->load(); + echo "{$service->getName()} : Status of service = ".$service->status()."
"; + } + } +} + +if(isset($_GET['action'])) { + $func = $_GET['action']; + if(isset($_GET['debug'])) { + define('DEBUG', $_GET['debug']); + } else { + define('DEBUG', 0); + } + if($func != '') { + $serv = new services(); + $func_call = strtoupper(substr($func,0,1)).substr($func,1); + $method = "do$func_call"; + $serv->$method(); + } +} +?> \ No newline at end of file diff --git a/setup/wizard/lib/tests/tests.php b/setup/wizard/lib/tests/tests.php new file mode 100644 index 0000000..d961860 --- /dev/null +++ b/setup/wizard/lib/tests/tests.php @@ -0,0 +1,43 @@ +. +* +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, +* California 94120-7775, or email info@knowledgetree.com. +* +* The interactive user interfaces in modified source and object code versions +* of this program must display Appropriate Legal Notices, as required under +* Section 5 of the GNU General Public License version 3. +* +* In accordance with Section 7(b) of the GNU General Public License version 3, +* these Appropriate Legal Notices must retain the display of the "Powered by +* KnowledgeTree" logo and retain the original copyright notice. If the display of the +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices +* must display the words "Powered by KnowledgeTree" and retain the original +* copyright notice. +* +* @copyright 2008-2009, KnowledgeTree Inc. +* @license GNU General Public License version 3 +* @author KnowledgeTree Team +* @package Installer +* @version Version 0.1 +*/ + +?> \ No newline at end of file diff --git a/setup/wizard/session.php b/setup/wizard/session.php index c7eecce..e3d5137 100644 --- a/setup/wizard/session.php +++ b/setup/wizard/session.php @@ -69,7 +69,7 @@ class Session */ public function startSession() { if(!isset($_SESSION[$this->salt]['ready'])) { - session_start(); + @session_start(); $_SESSION[$this->salt] ['ready'] = TRUE; } } diff --git a/setup/wizard/steps/configuration.php b/setup/wizard/steps/configuration.php index ebc8981..c3c62b7 100644 --- a/setup/wizard/steps/configuration.php +++ b/setup/wizard/steps/configuration.php @@ -39,18 +39,6 @@ * @package Installer * @version Version 0.1 */ - -if(isset($_GET['action'])) { - $func = $_GET['action']; - if($func != '' && $func != 'installer') { - require_once("../iniUtilities.php"); - require_once("../step.php"); - require_once("../path.php"); - require_once("../dbUtilities.php"); - require_once("../installUtil.php"); - } -} - class configuration extends Step { private $allConfs; @@ -680,26 +668,6 @@ class configuration extends Step * @return boolean */ private function writeConfigPath($configPath, $configContent) { -// $conf = $this->getDataFromSession("configuration"); // get data from the server -// $paths = $conf['paths']; -// if(isset($paths['configFile']['path'])) { -// $configPath = $this->getContentPath(); -// $configContent = $paths['configFile']['path']; -// } else { -// $configPath = $this->getContentPath(); -// if(!$configPath) return false; -// $this->util->iniHandler->load($configPath); -// $data = $this->util->iniHandler->getFileByLine(); -// $configContent = ''; -// foreach ($data as $k=>$v) { -// if(preg_match('/config.ini/', $k)) { -// $configContent = $k; -// break; -// } -// } -// } -// print_r($configPath); -// print_r($configContent); $fp = fopen($configPath, 'w+'); if(fwrite($fp, $configContent)) return true; @@ -707,19 +675,6 @@ class configuration extends Step } private function writeCachePath($cachePath, $cacheContent) { -// $cachePath = $this->getCachePath(); -// if(!$cachePath) return false; -// $configPath = $this->getContentPath(); -// if(!$configPath) return false; -// $this->util->iniHandler->load($configPath); -// $data = $this->util->iniHandler->getFileByLine(); -// $cacheContent = ''; -// foreach ($data as $k=>$v) { -// if(preg_match('/cache/', $k)) { -// $cacheContent = $k; -// break; -// } -// } $fp = fopen($cachePath, 'w+'); if($cacheContent != '') { if(fwrite($fp, $cacheContent)) @@ -753,13 +708,4 @@ class configuration extends Step } } -if(isset($_GET['action'])) { - $func = $_GET['action']; - if($func != '' && $func != 'installer') { - $serv = new configuration(); - $func_call = strtoupper(substr($func,0,1)).substr($func,1); - $method = "do$func_call"; - $serv->$method(); - } -} ?> \ No newline at end of file diff --git a/setup/wizard/steps/database.php b/setup/wizard/steps/database.php index 4ee436d..0e658af 100644 --- a/setup/wizard/steps/database.php +++ b/setup/wizard/steps/database.php @@ -40,16 +40,6 @@ * @version Version 0.1 */ -if(isset($_GET['action'])) { - $func = $_GET['action']; - if($func != '') { - require_once("../step.php"); - require_once("../installUtil.php"); - require_once("../path.php"); - require_once("../dbUtilities.php"); - } -} - class database extends Step { /** @@ -811,18 +801,6 @@ class database extends Step } /** - * Test database connectivity - * - * @author KnowledgeTree Team - * @param none - * @access public - * @return boolean - */ - public function doAjaxTest($host, $uname, $dname) { - - } - - /** * Initialize errors to false * * @author KnowledgeTree Team @@ -836,25 +814,6 @@ class database extends Step } } - public function doCreateSchema() { - $this->dhost = '127.0.0.1'; - $this->duname = 'root'; - $this->dpassword = 'root'; - $this->dname = 'dms_install'; - $this->dbbinary = 'mysql'; - $this->util->dbUtilities->load($this->dhost, '', $this->duname, $this->dpassword, $this->dname); - $this->createSchema(); - echo 'Schema loaded
'; - } } -if(isset($_GET['action'])) { - $func = $_GET['action']; - if($func != '') { - $serv = new database(); - $func_call = strtoupper(substr($func,0,1)).substr($func,1); - $method = "do$func_call"; - $serv->$method(); - } -} ?> \ No newline at end of file diff --git a/setup/wizard/steps/services.php b/setup/wizard/steps/services.php index 153796d..0baea83 100644 --- a/setup/wizard/steps/services.php +++ b/setup/wizard/steps/services.php @@ -40,16 +40,6 @@ * @version Version 0.1 */ -if(isset($_GET['action'])) { - $func = $_GET['action']; - if($func != '') { - require_once("../step.php"); - require_once("../installUtil.php"); - require_once("../path.php"); - require_once("../dbUtilities.php"); - } -} - class services extends Step { /** @@ -522,7 +512,7 @@ class services extends Step * @access private * @return void */ - private function storeSilent() { + public function storeSilent() { foreach ($this->getServices() as $service) { $class = strtolower($service)."Validation"; $serv = $this->$class->storeSilent(); @@ -546,71 +536,6 @@ class services extends Step return $services; } - - /** External Access **/ - public function doDeleteAll() { - $serverDetails = $this->getServices(); - foreach ($serverDetails as $serviceName) { - $className = OS.$serviceName; - require_once("../lib/services/service.php"); - require_once("../lib/services/".OS."Service.php"); - require_once("../lib/services/$className.php"); - $service = new $className(); - $service->uninstall(); - echo "Delete Service {$service->getName()}
"; - echo "Status of service ".$service->status()."
"; - } - } - - public function doInstallAll() { - $serverDetails = $this->getServices(); - if(!empty($serverDetails)) { - require_once("../lib/validation/serviceValidation.php"); - require_once("../lib/services/service.php"); - } - foreach ($serverDetails as $serviceName) { - $className = OS.$serviceName; - $serv = strtolower($serviceName); // Linux Systems. - require_once("../lib/services/".OS."Service.php"); - require_once("../lib/validation/$serv"."Validation.php"); - require_once("../lib/services/$className.php"); - $service = new $className(); - $class = strtolower($serviceName)."Validation"; - $vClass = new $class(); - $passed = $vClass->binaryChecks(); // Run Binary Pre Checks - $service->load(array('binary'=>$passed)); - $service->install(); - echo "Install Service {$service->getName()}
"; - echo "Status of service ".$service->status()."
"; - } - } - - public function doStatusAll() { - $serverDetails = $this->getServices(); - foreach ($serverDetails as $serviceName) { - $className = OS.$serviceName; - require_once("../lib/services/service.php"); - require_once("../lib/services/".OS."Service.php"); - require_once("../lib/services/$className.php"); - $service = new $className(); - $service->load(); - echo "{$service->getName()} : Status of service = ".$service->status()."
"; - } - } } -if(isset($_GET['action'])) { - $func = $_GET['action']; - if(isset($_GET['debug'])) { - define('DEBUG', $_GET['debug']); - } else { - define('DEBUG', 0); - } - if($func != '') { - $serv = new services(); - $func_call = strtoupper(substr($func,0,1)).substr($func,1); - $method = "do$func_call"; - $serv->$method(); - } -} ?> diff --git a/setup/wizard/templates/complete.tpl b/setup/wizard/templates/complete.tpl index 8d9f521..6b291f5 100644 --- a/setup/wizard/templates/complete.tpl +++ b/setup/wizard/templates/complete.tpl @@ -79,9 +79,9 @@ @@ -92,9 +92,9 @@ @@ -105,9 +105,9 @@ @@ -134,9 +134,9 @@ $redirect = "http://".$_SERVER['SERVER_NAME'].":$port".$root_url."/admin.php"; ?> - Next + Next - Finish + Finish
Username
Username
Password
Could Not Authenticate User
- Refresh + - Refresh + - Refresh + - Refresh + - Refresh + - Refresh +