diff --git a/setup/migrate/lib/services/unixService.php b/setup/migrate/lib/services/unixService.php index 4c564b4..ccdd912 100644 --- a/setup/migrate/lib/services/unixService.php +++ b/setup/migrate/lib/services/unixService.php @@ -41,6 +41,8 @@ */ class unixService extends Service { + public $name; + /** * Retrieve Service name * diff --git a/setup/migrate/migrateUtil.php b/setup/migrate/migrateUtil.php index 09acd7f..7619f9b 100644 --- a/setup/migrate/migrateUtil.php +++ b/setup/migrate/migrateUtil.php @@ -79,6 +79,7 @@ class MigrateUtil { ob_end_clean(); echo $contents; } + /** * Check if system needs to be migrated * @@ -89,13 +90,20 @@ class MigrateUtil { */ public function checkStructurePermissions() { // Check if Wizard Directory is writable - if(!$this->_checkPermission(WIZARD_DIR)) { + if(!$this->_checkPermission(MIGRATE_DIR)) { return 'wizard'; } return true; } + + function getInstallerServices() { + require_once("../wizard/installUtil.php"); + require_once("../wizard/steps/services.php"); + + return new services(); + } /** * Redirect * diff --git a/setup/migrate/migrateWizard.php b/setup/migrate/migrateWizard.php index 7958327..5858f71 100644 --- a/setup/migrate/migrateWizard.php +++ b/setup/migrate/migrateWizard.php @@ -49,8 +49,8 @@ include("path.php"); // Paths */ function __autoload($class) { // Attempt and autoload classes $class = strtolower(substr($class,0,1)).substr($class,1); // Linux Systems. - if(file_exists(WIZARD_DIR."$class.php")) { - require_once(WIZARD_DIR."$class.php"); + if(file_exists(MIGRATE_DIR."$class.php")) { + require_once(MIGRATE_DIR."$class.php"); } elseif (file_exists(STEP_DIR."$class.php")) { require_once(STEP_DIR."$class.php"); } elseif (file_exists(WIZARD_LIB."$class.php")) { diff --git a/setup/migrate/path.php b/setup/migrate/path.php index cd1d393..09d142d 100644 --- a/setup/migrate/path.php +++ b/setup/migrate/path.php @@ -67,21 +67,24 @@ $sys .= $v.DS; } // Define paths to wizard - define('WIZARD_DIR', $wizard.DS); - define('WIZARD_LIB', WIZARD_DIR."lib".DS); + define('MIGRATE_DIR', $wizard.DS); + define('WIZARD_LIB', MIGRATE_DIR."lib".DS); define('SERVICE_LIB', WIZARD_LIB."services".DS); - define('SQL_DIR', WIZARD_DIR."sql".DS); + define('SQL_DIR', MIGRATE_DIR."sql".DS); define('SQL_UPGRADE_DIR', SQL_DIR."upgrades".DS); - define('CONF_DIR', WIZARD_DIR."config".DS); - define('RES_DIR', WIZARD_DIR."resources".DS); - define('STEP_DIR', WIZARD_DIR."steps".DS); - define('TEMP_DIR', WIZARD_DIR."templates".DS); - define('SHELL_DIR', WIZARD_DIR."shells".DS); - define('OUTPUT_DIR', WIZARD_DIR."output".DS); + define('CONF_DIR', MIGRATE_DIR."config".DS); + define('RES_DIR', MIGRATE_DIR."resources".DS); + define('STEP_DIR', MIGRATE_DIR."steps".DS); + define('TEMP_DIR', MIGRATE_DIR."templates".DS); + define('SHELL_DIR', MIGRATE_DIR."shells".DS); + define('OUTPUT_DIR', MIGRATE_DIR."output".DS); // Define paths to system webroot define('SYSTEM_DIR', $sys); + define('SYS_VAR_DIR', SYSTEM_DIR."var".DS); define('SYS_BIN_DIR', SYSTEM_DIR."bin".DS); - define('SYS_LOG_DIR', SYSTEM_DIR."var".DS."log".DS); + define('SYS_LOG_DIR', SYS_VAR_DIR."log".DS); + define('SYS_OUT_DIR', SYS_VAR_DIR); + define('VAR_BIN_DIR', SYS_VAR_DIR."bin".DS); // Define paths to system array_pop($xdir); $asys = ''; diff --git a/setup/migrate/stepAction.php b/setup/migrate/stepAction.php index 47e7598..30724ed 100644 --- a/setup/migrate/stepAction.php +++ b/setup/migrate/stepAction.php @@ -246,7 +246,8 @@ class stepAction { * @return object Step */ public function createStep() { - $step_class = $this->makeCamelCase($this->stepName); + $step_class = "migrate".$this->makeCamelCase($this->stepName); + return new $step_class(); } diff --git a/setup/migrate/steps/migrateComplete.php b/setup/migrate/steps/migrateComplete.php new file mode 100644 index 0000000..44cc440 --- /dev/null +++ b/setup/migrate/steps/migrateComplete.php @@ -0,0 +1,101 @@ +. +* +* 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 Migrater +* @version Version 0.1 +*/ + +class migrateComplete extends Step { + + /** + * Reference to Database object + * + * @author KnowledgeTree Team + * @access private + * @var object + */ + private $_dbhandler = null; + + /** + * List of services to check + * + * @access private + * @var array + */ + private $services_check = 'tick'; + private $paths_check = 'tick'; + private $privileges_check = 'tick'; + private $database_check = 'tick'; + protected $silent = true; + + protected $util = null; + + public function __construct() { + $this->temp_variables = array("step_name"=>"complete", "silent"=>$this->silent); + $this->_dbhandler = new dbUtil(); + $this->util = new MigrateUtil(); + } + + function doStep() { + $this->doRun(); + return 'landing'; + } + + function doRun() { + $this->checkServices(); + $this->storeSilent();// Set silent mode variables + } + + private function checkServices() + { + $services = new services(); + foreach ($services->getServices() as $serviceName) { + $this->temp_variables[$serviceName."Status"] = 'tick'; + } + return true; + } + + /** + * Set all silent mode varibles + * + */ + private function storeSilent() { + $this->temp_variables['services_check'] = $this->services_check; + } +} +?> \ No newline at end of file diff --git a/setup/migrate/steps/migrateDatabase.php b/setup/migrate/steps/migrateDatabase.php new file mode 100644 index 0000000..21d0197 --- /dev/null +++ b/setup/migrate/steps/migrateDatabase.php @@ -0,0 +1,348 @@ +. +* +* 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 Migrater +* @version Version 0.1 +*/ + +class migrateDatabase extends Step +{ + /** + * Reference to Database object + * + * @author KnowledgeTree Team + * @access public + * @var object + */ + public $_dbhandler = null; + + /** + * Reference to Database object + * + * @author KnowledgeTree Team + * @access public + * @var object + */ + public $_util = null; + + /** + * Database type + * + * @author KnowledgeTree Team + * @access private + * @var array + */ + private $dtype = ''; + + /** + * Database types + * + * @author KnowledgeTree Team + * @access private + * @var array + */ + private $dtypes = array(); + + /** + * Database host + * + * @author KnowledgeTree Team + * @access private + * @var string + */ + private $dhost = ''; + + /** + * Database port + * + * @author KnowledgeTree Team + * @access private + * @var string + */ + private $dport = ''; + + /** + * Database name + * + * @author KnowledgeTree Team + * @access private + * @var string + */ + private $dname = ''; + + /** + * Database root username + * + * @author KnowledgeTree Team + * @access private + * @var string + */ + private $duname = ''; + + /** + * Database root password + * + * @author KnowledgeTree Team + * @access private + * @var string + */ + private $dpassword = ''; + + /** + * Database dms username + * + * @author KnowledgeTree Team + * @access private + * @var string + */ + private $dmsname = ''; + + /** + * Database dms password + * + * @author KnowledgeTree Team + * @access private + * @var string + */ + private $dmspassword = ''; + + /** + * Default dms user username + * + * @author KnowledgeTree Team + * @access private + * @var boolean + */ + private $dmsusername = ''; + + /** + * Default dms user password + * + * @author KnowledgeTree Team + * @access private + * @var boolean + */ + private $dmsuserpassword = ''; + + /** + * Location of database binaries. + * + * @author KnowledgeTree Team + * @access private + * @var string + */ + private $mysqlDir; // TODO:multiple databases + + /** + * Name of database binary. + * + * @author KnowledgeTree Team + * @access private + * @var string + */ + private $dbbinary = ''; // TODO:multiple databases + + /** + * Database table prefix + * + * @author KnowledgeTree Team + * @access private + * @var string + */ + private $tprefix = ''; + + /** + * Flag to drop database + * + * @author KnowledgeTree Team + * @access private + * @var boolean + */ + private $ddrop = false; + + /** + * List of errors encountered + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + public $error = array(); + + /** + * List of errors used in template + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + public $templateErrors = array('dmspassword', 'dmsuserpassword', 'con', 'dname', 'dtype', 'duname', 'dpassword'); + + /** + * Flag to store class information in session + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + public $storeInSession = true; + + /** + * Flag if step needs to be migrated + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + protected $runMigrate = true; + + /** + * Flag if step needs to run silently + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + protected $silent = true; + + /** + * Constructs database object + * + * @author KnowledgeTree Team + * @access public + * @param none + */ + public function __construct() { + $this->temp_variables = array("step_name"=>"database", "silent"=>$this->silent); + $this->_dbhandler = new dbUtil(); + $this->_util = new MigrateUtil(); + if(WINDOWS_OS) + $this->mysqlDir = MYSQL_BIN; + } + + /** + * Main control of database setup + * + * @author KnowledgeTree Team + * @param none + * @access public + * @return string + */ + public function doStep() { + $this->initErrors(); + $this->setDetails(); // Set any posted variables + if(!$this->inStep("database")) { + return 'landing'; + } + if($this->next()) { + return 'next'; + } else if($this->previous()) { + return 'previous'; + } + + return 'landing'; + } + + /** + * Store options + * + * @author KnowledgeTree Team + * @params object SimpleXmlObject + * @access private + * @return void + */ + private function setDetails() { + $this->temp_variables['dhost'] = $this->getPostSafe('dhost'); + $this->temp_variables['dport'] = $this->getPostSafe('dport'); + $this->temp_variables['duname'] = $this->getPostSafe('duname'); + $this->temp_variables['dpassword'] = $this->getPostSafe('dpassword'); + $this->temp_variables['dbbinary'] = $this->getPostSafe('dbbinary'); + } + + /** + * Safer way to return post data + * + * @author KnowledgeTree Team + * @params SimpleXmlObject $simplexml + * @access public + * @return void + */ + public function getPostSafe($key) { + return isset($_POST[$key]) ? $_POST[$key] : ""; + } + + /** + * Stores varibles used by template + * + * @author KnowledgeTree Team + * @params none + * @access public + * @return array + */ + public function getStepVars() { + return $this->temp_variables; + } + + /** + * Returns database errors + * + * @author KnowledgeTree Team + * @access public + * @params none + * @return array + */ + public function getErrors() { + + return $this->error; + } + + /** + * Initialize errors to false + * + * @author KnowledgeTree Team + * @param none + * @access private + * @return boolean + */ + private function initErrors() { + foreach ($this->templateErrors as $e) { + $this->error[$e] = false; + } + } +} +?> \ No newline at end of file diff --git a/setup/migrate/steps/migrateErrors.php b/setup/migrate/steps/migrateErrors.php new file mode 100644 index 0000000..bdd8687 --- /dev/null +++ b/setup/migrate/steps/migrateErrors.php @@ -0,0 +1,57 @@ +. +* +* 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 Migrater +* @version Version 0.1 +*/ +class migrateErrors extends Step { + public $error = array(); + + function doStep() { + return 'landing'; + } + + function getErrors() { + return $this->error; + } + + function getName() { + return 'error'; + } +} +?> \ No newline at end of file diff --git a/setup/migrate/steps/migrateInstallation.php b/setup/migrate/steps/migrateInstallation.php new file mode 100644 index 0000000..ef7304b --- /dev/null +++ b/setup/migrate/steps/migrateInstallation.php @@ -0,0 +1,213 @@ +. +* +* 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 Migrater +* @version Version 0.1 +*/ + +class migrateInstallation extends step +{ + /** + * Flag to display confirmation page first + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + public $displayFirst = false; + + /** + * Flag to store class information in session + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + protected $storeInSession = true; + + /** + * List of paths + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + protected $paths = array(); + + /** + * Flag if step needs to run silently + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + protected $silent = false; + + private $location = ''; + private $dbSettings = array(); + private $ktSettings = array(); + private $urlPaths = array(); + + function __construct() { + $this->temp_variables = array("step_name"=>"installation", "silent"=>$this->silent); + } + + public function doStep() { + $this->detectInstallation(); + if(!$this->inStep("installation")) { + $this->setDetails(); + $this->doRun(); + return 'landing'; + } + if($this->next()) { + if($this->doRun()) { + $this->setDetails(); + return 'confirm'; + } else { + return 'error'; + } + } else if($this->previous()) { + return 'previous'; + } else if($this->confirm()) { + return 'next'; + } + $this->doRun(); + + return 'landing'; + } + + public function detectInstallation() { + if(WINDOWS_OS) { + $path1 = "'C:\\Program Files\ktdms'"; + $path2 = "'C:\\Program Files x86\ktdms'"; + if(file_exists($path1)) + $this->location = "C:\\Program Files\ktdms"; + elseif (file_exists($path2)) + $this->location = "C:\\Program Files x86\ktdms"; + } else { + $path1 = "/opt/ktdms"; + $path2 = "/var/www/ktdms"; + if(file_exists($path1)) + $this->location = $path1; + elseif(file_exists($path2)) + $this->location = $path2; + } + } + + public function doRun() { + $ktInstallPath = isset($_POST['location']) ? $_POST['location']: ''; + if($ktInstallPath != '') { + $this->location = $ktInstallPath; + //echo $ktInstallPath;die; + if(file_exists($ktInstallPath)) { + $configPath = $ktInstallPath.DS."knowledgeTree".DS."config".DS."config-path"; + if(file_exists($configPath)) { + $configFilePath = file_get_contents($configPath); + if(file_exists($configFilePath)) { + $this->readConfig($configFilePath); + $this->storeSilent(); + + return true; + } else { + $this->error[] = "KT installation configuration file empty"; + } + } else { + $this->error[] = "KT installation configuration file not found"; + } + } else { + $this->error[] = "KT installation not found"; + } + } + $this->storeSilent(); + + return false; + } + + private function readConfig($path) { + $ini = new Ini($path); + $dbSettings = $ini->getSection('db'); + $this->dbSettings = array('dbHost'=> $dbSettings['dbHost'], + 'dbName'=> $dbSettings['dbName'], + 'dbUser'=> $dbSettings['dbUser'], + 'dbPass'=> $dbSettings['dbPass'], + 'dbPort'=> $dbSettings['dbPort'], + 'dbAdminUser'=> $dbSettings['dbAdminUser'], + 'dbAdminPass'=> $dbSettings['dbAdminPass'], + ); + $ktSettings = $ini->getSection('KnowledgeTree'); + $froot = $ktSettings['fileSystemRoot']; + if ($froot == 'default') { + $froot = $this->location; + } + $this->ktSettings = array('fileSystemRoot'=> $froot, + ); + $urlPaths = $ini->getSection('urls'); + $this->urlPaths = array(array('name'=> 'Var Directory', 'path'=> $froot.DS.'var'), + array('name'=> 'Log Directory', 'path'=> $froot.DS.'log'), + array('name'=> 'Document Root', 'path'=> $froot.DS.'Documents'), + array('name'=> 'UI Directory', 'path'=> $froot.DS.'presentation'.DS.'lookAndFeel'.DS.'knowledgeTree'), + array('name'=> 'Temporary Directory', 'path'=> $froot.DS.'tmp'), + array('name'=> 'Cache Directory', 'path'=> $froot.DS.'cache'), + ); + $this->temp_variables['urlPaths'] = $this->urlPaths; + $this->temp_variables['ktSettings'] = $this->ktSettings; + $this->temp_variables['dbSettings'] = $this->dbSettings; + } + + private function setDetails() { + $inst = $this->getDataFromSession("installation"); + if ($inst) { + $this->location = $inst['location']; + } + } + + public function getStepVars() { + return $this->temp_variables; + } + + public function getErrors() { + return $this->error; + } + + public function storeSilent() { + $this->temp_variables['location'] = $this->location; + + } + +} +?> \ No newline at end of file diff --git a/setup/migrate/steps/migrateServices.php b/setup/migrate/steps/migrateServices.php new file mode 100644 index 0000000..6476c63 --- /dev/null +++ b/setup/migrate/steps/migrateServices.php @@ -0,0 +1,278 @@ +. +* +* 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 Migrater +* @version Version 0.1 +*/ + +class migrateServices extends Step +{ + /** + * List of errors encountered + * + * @author KnowledgeTree Team + * @access protected + * @var array + */ + protected $error = array(); + + /** + * Flag if step needs to be migrated + * + * @author KnowledgeTree Team + * @access protected + * @var array + */ + protected $runMigrate = true; + + /** + * List of services to be migrated + * + * @author KnowledgeTree Team + * @access private + * @var array + */ + private $services = array(); + + /** + * Reference to utility object + * + * @author KnowledgeTree Team + * @access protected + * @var string + */ + protected $util; + + + /** + * Flag if services are already uninstalled + * + * @author KnowledgeTree Team + * @access private + * @var mixed + */ + private $alreadyUninstalled = false; + + /** + * Service Migrateed + * + * @author KnowledgeTree Team + * @access private + * @var array + */ + private $serviceCheck = 'tick'; + + /** + * Flag to store class information in session + * + * @author KnowledgeTree Team + * @access public + * @var boolean + */ + protected $storeInSession = true; + + /** + * List of variables to be loaded to template + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + protected $temp_variables; + + /** + * Flag if step needs to run silently + * + * @author KnowledgeTree Team + * @access public + * @var array + */ + protected $silent = true; + + /** + * Constructs services object + * + * @author KnowledgeTree Team + * @access public + * @param none + */ + public function __construct() { + $this->temp_variables = array("step_name"=>"migrateServices", "silent"=>$this->silent); + $this->util = new MigrateUtil(); + } + + /** + * Main control of services setup + * + * @author KnowledgeTree Team + * @param none + * @access public + * @return string + */ + public function doStep() + { + $this->installServices = $this->util->getInstallerServices(); + $this->services = $this->installServices->migrateGetServices(); + $this->doRun(); + $this->storeSilent(); + if(!$this->inStep("services")) { + return 'landing'; + } + if($this->next()) { + return 'next'; + } else if($this->previous()) { + return 'previous'; + } + + return 'landing'; + } + + /** + * Run step + * + * @author KnowledgeTree Team + * @param none + * @access private + * @return boolean + */ + private function doRun() { + if(!$this->alreadyUninstalled()) { // Pre-check if services are stopped + $this->stopServices(); + + } + + return $this->checkServices(); + } + + /** + * Pre-check service status + * + * @return boolean If all services are not installed + */ + public function alreadyUninstalled() { + $alreadyUninstalled = true; + foreach ($this->services as $service) { + $sStatus = $service->status(); + if($sStatus != '') { + return false; + } + } + + return $alreadyUninstalled; + } + + /** + * Attempt to stop services + * + */ + private function stopServices() { + // Try the dmsctl + $cmd = "./dmsctl.sh stop"; + $this->util->pexec($cmd); + // probably will not work. + foreach ($this->services as $service) { + $sStatus = $service->status(); + if($sStatus != '') { + $res = $service->uninstall(); + print_r($res); + } + } + } + + public function checkServices() { + foreach ($this->services as $service) { + $sStatus = $service->status(); + if($sStatus == 'STARTED') { + $state = 'cross'; + } else { + $state = 'tick'; + } + $this->temp_variables['services'][$service->getName()]['class'] = $state; + $this->temp_variables['services'][$service->getName()]['msg'] = $service->getName(); + } + } + /** + * Returns services errors + * + * @author KnowledgeTree Team + * @access public + * @params none + * @return array + */ + public function getErrors() { + return $this->error; + } + + /** + * Returns services warnings + * + * @author KnowledgeTree Team + * @access public + * @params none + * @return array + */ + public function getWarnings() { + return $this->warnings; + } + + /** + * Get the variables to be passed to the template + * + * @author KnowledgeTree Team + * @access public + * @return array + */ + public function getStepVars() + { + return $this->temp_variables; + } + + /** + * Set all silent mode varibles + * + * @author KnowledgeTree Team + * @param none + * @access private + * @return void + */ + private function storeSilent() { + $this->temp_variables['alreadyUninstalled'] = $this->alreadyUninstalled; + $this->temp_variables['serviceCheck'] = $this->serviceCheck; + } +} +?> \ No newline at end of file diff --git a/setup/migrate/steps/migrateWelcome.php b/setup/migrate/steps/migrateWelcome.php new file mode 100644 index 0000000..6ae24f3 --- /dev/null +++ b/setup/migrate/steps/migrateWelcome.php @@ -0,0 +1,63 @@ +. +* +* 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 Migrater +* @version Version 0.1 +*/ + +class migrateWelcome extends step { + + protected $silent = true; + + function __construct() { + $this->temp_variables = array("step_name"=>"welcome"); + } + + function doStep() { + if($this->next()) { + return 'next'; // Just a welcome, so return "next" action + } elseif ($this->installer()) { + return 'install'; // Just a welcome, so return "next" action + } + + return 'landing'; + } + +} + +?> \ No newline at end of file diff --git a/setup/migrate/templates/services.tpl b/setup/migrate/templates/services.tpl index 91d1c71..5b033da 100644 --- a/setup/migrate/templates/services.tpl +++ b/setup/migrate/templates/services.tpl @@ -33,15 +33,23 @@