Commit f8e9e0ae7ff51d2d82679692ec157269f44e9a29
1 parent
79c38dcb
Story Id:1166880 Daily Commit
Committed by: Jarrett Jordaan Reviewed by: Paul Barrett
Showing
16 changed files
with
123 additions
and
62 deletions
setup/migrate/templates/installation.tpl
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | Please verify the location of your current installation. |
| 32 | 32 | </p> |
| 33 | 33 | |
| 34 | - <input name="location" type="text" style="width:430px; float:left" value="<?php echo $location; ?>"> | |
| 34 | + <input id="location" name="location" type="text" style="width:430px; float:left" value="<?php echo $location; ?>"> | |
| 35 | 35 | <br/><br/> |
| 36 | 36 | <?php |
| 37 | 37 | if($errors) { |
| ... | ... | @@ -45,4 +45,7 @@ |
| 45 | 45 | </div> |
| 46 | 46 | <input type="submit" name="Previous" value="Previous" class="button_previous"/> |
| 47 | 47 | <input type="submit" name="Next" value="Next" class="button_next"/> |
| 48 | -</form> | |
| 49 | 48 | \ No newline at end of file |
| 49 | +</form> | |
| 50 | +<script type="text/javascript"> | |
| 51 | + $("#location").focus(); | |
| 52 | +</script> | |
| 50 | 53 | \ No newline at end of file | ... | ... |
setup/migrate/templates/installation_confirm.tpl
| ... | ... | @@ -38,10 +38,6 @@ |
| 38 | 38 | <td width="22%"">Database Name: </td> |
| 39 | 39 | <td width="50%"><?php echo $dbSettings['dbName']; ?></td> |
| 40 | 40 | </tr> |
| 41 | - <tr> | |
| 42 | - <td width="22%"">Database Name: </td> | |
| 43 | - <td width="50%"><?php echo $dbSettings['dbName']; ?></td> | |
| 44 | - </tr> | |
| 45 | 41 | </table> |
| 46 | 42 | |
| 47 | 43 | <h3>System Paths</h3> | ... | ... |
setup/wizard/dbUtil.php
setup/wizard/installUtil.php
| ... | ... | @@ -555,7 +555,15 @@ class InstallUtil { |
| 555 | 555 | return $res; |
| 556 | 556 | } |
| 557 | 557 | $cmd = "which php"; |
| 558 | - return $this->getPhpHelper($cmd); | |
| 558 | + $res = $this->getPhpHelper($cmd); | |
| 559 | + if($res != '') { | |
| 560 | + return $res; | |
| 561 | + } | |
| 562 | + if(file_exists(PHP_DIR."php")) { | |
| 563 | + return PHP_DIR."php"; | |
| 564 | + } | |
| 565 | + | |
| 566 | + return 'php'; | |
| 559 | 567 | } |
| 560 | 568 | |
| 561 | 569 | function getPhpHelper($cmd) { | ... | ... |
setup/wizard/lib/helpers/demo.sh
100644 → 100755
| 1 | 1 | #!/bin/bash |
| 2 | -rm ../../../../bin/schedulerTask.sh; | |
| 3 | 2 | rm ../../../../var/log/lucene.log; |
| 4 | 3 | rm ../../../../var/log/scheduler.log; |
| 5 | 4 | rm ../../../../var/log/openoffice.log; |
| 6 | -rm ../../../../bin/luceneserver/KnowledgeTreeIndexer.properties; | |
| 7 | 5 | rm ../../../../setup/wizard/output/outJV; |
| 8 | -pkill -f lucene; | |
| 9 | -pkill -f scheduler; | |
| 10 | -pkill -f openoffice; | |
| 11 | - | |
| 6 | +chmod 777 -R /var/lib/knowledgetree | |
| 7 | +chmod 777 -R /var/log/knowledgetree | |
| 8 | +chmod 777 -R /var/tmp/knowledgetree | |
| 9 | +chmod 777 -R /var/lib/knowledgetree/Documents | |
| 10 | +chmod 777 -R /var/lib/knowledgetree/indexes | |
| 11 | +chmod 777 -R /var/lib/knowledgetree/proxies | |
| 12 | +chmod 777 -R /var/lib/knowledgetree/uploads | ... | ... |
setup/wizard/lib/services/unixAgent.php
setup/wizard/lib/services/unixLucene.php
| ... | ... | @@ -42,7 +42,6 @@ |
| 42 | 42 | |
| 43 | 43 | class unixLucene extends unixService { |
| 44 | 44 | public $util; |
| 45 | - | |
| 46 | 45 | private $shutdownScript; |
| 47 | 46 | private $indexerDir; |
| 48 | 47 | private $lucenePidFile; |
| ... | ... | @@ -51,14 +50,11 @@ class unixLucene extends unixService { |
| 51 | 50 | private $luceneSourceLoc; |
| 52 | 51 | private $javaXms; |
| 53 | 52 | private $javaXmx; |
| 54 | - | |
| 55 | - public function __construct() { | |
| 56 | - $this->name = "KTLuceneTest"; | |
| 57 | - $this->setLuceneSource("ktlucene.jar"); | |
| 58 | - $this->util = new InstallUtil(); | |
| 59 | - } | |
| 53 | + public $name = "KTLuceneTest"; | |
| 60 | 54 | |
| 61 | 55 | public function load() { |
| 56 | + $this->util = new InstallUtil(); | |
| 57 | + $this->setLuceneSource("ktlucene.jar"); | |
| 62 | 58 | $this->setLuceneDir(SYSTEM_DIR."bin".DS."luceneserver".DS); |
| 63 | 59 | $this->setIndexerDir(SYSTEM_DIR."search2".DS."indexing".DS."bin".DS); |
| 64 | 60 | $this->setLucenePidFile("lucene_test.pid"); | ... | ... |
setup/wizard/lib/services/unixOpenOffice.php
| ... | ... | @@ -60,15 +60,11 @@ class unixOpenOffice extends unixService { |
| 60 | 60 | private $log; |
| 61 | 61 | private $options; |
| 62 | 62 | private $office; |
| 63 | + public $name = "KTOpenOffice"; | |
| 63 | 64 | |
| 64 | - public function __construct() { | |
| 65 | - $this->name = "KTOpenOffice"; | |
| 65 | + public function load() { | |
| 66 | 66 | $this->util = new InstallUtil(); |
| 67 | 67 | $this->office = 'openoffice'; |
| 68 | - } | |
| 69 | - | |
| 70 | - public function load() { | |
| 71 | - | |
| 72 | 68 | $this->setPort("8100"); |
| 73 | 69 | $this->setHost("localhost"); |
| 74 | 70 | $this->setLog("openoffice.log"); |
| ... | ... | @@ -76,8 +72,6 @@ class unixOpenOffice extends unixService { |
| 76 | 72 | $this->setOption(); |
| 77 | 73 | } |
| 78 | 74 | |
| 79 | - | |
| 80 | - | |
| 81 | 75 | private function setPort($port = "8100") { |
| 82 | 76 | $this->port = $port; |
| 83 | 77 | } | ... | ... |
setup/wizard/lib/services/unixScheduler.php
| ... | ... | @@ -46,20 +46,22 @@ class unixScheduler extends unixService { |
| 46 | 46 | private $schedulerSourceLoc; |
| 47 | 47 | private $systemDir; |
| 48 | 48 | private $scheduler; |
| 49 | + private $phpCli; | |
| 50 | + public $name = "KTSchedulerTest"; | |
| 49 | 51 | |
| 50 | - public function __construct() { | |
| 51 | - $this->name = "KTSchedulerTest"; | |
| 52 | + public function load() { | |
| 52 | 53 | $this->util = new InstallUtil(); |
| 54 | + $this->setPhpCli(); | |
| 53 | 55 | $this->scheduler = 'scheduler'; |
| 54 | 56 | $this->setSchedulerSource('schedulerTask.sh'); |
| 55 | - } | |
| 56 | - | |
| 57 | - public function load() { | |
| 58 | 57 | $this->setSystemDir(SYSTEM_ROOT."bin".DS); |
| 59 | 58 | $this->setSchedulerDir(VAR_BIN_DIR); |
| 60 | 59 | $this->setSchedulerSourceLoc('schedulerTask.sh'); |
| 61 | 60 | } |
| 62 | 61 | |
| 62 | + function setPhpCli() { | |
| 63 | + $this->phpCli = $this->util->getPhp(); | |
| 64 | + } | |
| 63 | 65 | |
| 64 | 66 | function setSystemDir($systemDir) { |
| 65 | 67 | $this->systemDir = $systemDir; |
| ... | ... | @@ -104,7 +106,7 @@ class unixScheduler extends unixService { |
| 104 | 106 | $content .= "cd ".$this->getSchedulerDir()."\n"; |
| 105 | 107 | $content .= "while true; do\n"; |
| 106 | 108 | // TODO : This will not work without CLI |
| 107 | - $content .= "php -Cq scheduler.php\n"; | |
| 109 | + $content .= "{$this->phpCli} -Cq scheduler.php\n"; | |
| 108 | 110 | $content .= "sleep 30\n"; |
| 109 | 111 | $content .= "done"; |
| 110 | 112 | @fwrite($fp, $content); |
| ... | ... | @@ -169,8 +171,6 @@ class unixScheduler extends unixService { |
| 169 | 171 | |
| 170 | 172 | return $response; |
| 171 | 173 | } |
| 172 | - | |
| 173 | - | |
| 174 | - | |
| 174 | + | |
| 175 | 175 | } |
| 176 | 176 | ?> | ... | ... |
setup/wizard/lib/services/windowsLucene.php
setup/wizard/openoffice.log
0 → 100644
setup/wizard/path.php
| ... | ... | @@ -96,28 +96,33 @@ |
| 96 | 96 | // Install Type |
| 97 | 97 | preg_match('/Zend/', $sys, $matches); // TODO: Dirty |
| 98 | 98 | if($matches) { |
| 99 | - $sysdir = explode(DS, $sys); | |
| 100 | - array_pop($sysdir); | |
| 101 | - array_pop($sysdir); | |
| 102 | - array_pop($sysdir); | |
| 103 | - array_pop($sysdir); | |
| 104 | - $zendsys = ''; | |
| 105 | - foreach ($sysdir as $k=>$v) { | |
| 106 | - $zendsys .= $v.DS; | |
| 107 | - } | |
| 108 | 99 | define('INSTALL_TYPE', 'Zend'); |
| 109 | - define('PHP_DIR', $zendsys."ZendServer".DS."bin".DS); | |
| 110 | 100 | } else { |
| 111 | 101 | $modules = get_loaded_extensions(); |
| 112 | - // TODO: Dirty | |
| 113 | 102 | if(in_array('Zend Download Server', $modules) || in_array('Zend Monitor', $modules) || in_array('Zend Utils', $modules) || in_array('Zend Page Cache', $modules)) { |
| 114 | 103 | define('INSTALL_TYPE', 'Zend'); |
| 115 | - define('PHP_DIR', ''); | |
| 116 | 104 | } else { |
| 117 | - define('INSTALL_TYPE', ''); | |
| 118 | - define('PHP_DIR', ''); | |
| 105 | + define('INSTALL_TYPE', 'Source'); | |
| 119 | 106 | } |
| 120 | 107 | } |
| 108 | + if(INSTALL_TYPE == 'Zend') { | |
| 109 | + if(WINDOWS_OS) { | |
| 110 | + $sysdir = explode(DS, $sys); | |
| 111 | + array_pop($sysdir); | |
| 112 | + array_pop($sysdir); | |
| 113 | + array_pop($sysdir); | |
| 114 | + array_pop($sysdir); | |
| 115 | + $zendsys = ''; | |
| 116 | + foreach ($sysdir as $k=>$v) { | |
| 117 | + $zendsys .= $v.DS; | |
| 118 | + } | |
| 119 | + define('PHP_DIR', $zendsys."ZendServer".DS."bin".DS); | |
| 120 | + } else { | |
| 121 | + define('PHP_DIR', DS."usr".DS."local".DS."zend".DS."bin".DS); | |
| 122 | + } | |
| 123 | + } else { | |
| 124 | + define('PHP_DIR', ''); | |
| 125 | + } | |
| 121 | 126 | // Other |
| 122 | 127 | date_default_timezone_set('Africa/Johannesburg'); |
| 123 | 128 | if(WINDOWS_OS) { // Mysql bin [Windows] | ... | ... |
setup/wizard/scheduler.log
0 → 100644
| 1 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 2 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 3 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 4 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 5 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 6 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 7 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 8 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 9 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 10 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 11 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 12 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 13 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 14 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 15 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 16 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 17 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 18 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 19 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 20 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 21 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 22 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 23 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 24 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 25 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 26 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 27 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 28 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 29 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 30 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 31 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 32 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 33 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 34 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 35 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 36 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 37 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 38 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 39 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 40 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 41 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 42 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 43 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 44 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 45 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 46 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 47 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 48 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 49 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 50 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 51 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 52 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | |
| 53 | +/var/www/installers/knowledgetree/var/bin/schedulerTask.sh: 6: php: not found | ... | ... |
setup/wizard/steps/complete.php
| ... | ... | @@ -226,6 +226,7 @@ class complete extends Step { |
| 226 | 226 | foreach ($services->getServices() as $serviceName) { |
| 227 | 227 | $className = OS.$serviceName; |
| 228 | 228 | $service = new $className(); |
| 229 | + $service->load(); | |
| 229 | 230 | $status = $services->serviceStarted($service); |
| 230 | 231 | if($status) { |
| 231 | 232 | $this->temp_variables[$serviceName."Status"] = 'tick'; | ... | ... |
setup/wizard/steps/configuration.php
| ... | ... | @@ -308,11 +308,14 @@ class configuration extends Step |
| 308 | 308 | private function registerDirs() { // Adjust directories variables |
| 309 | 309 | $this->readConfigPath(); |
| 310 | 310 | $dirs = $this->getFromConfigPath(); |
| 311 | - $directories['varDirectory'] = array('section'=>'urls', 'value'=>mysql_real_escape_string($dirs['varDirectory']['path']), 'setting'=>'varDirectory'); | |
| 312 | - $directories['logDirectory'] = array('section'=>'urls', 'value'=>mysql_real_escape_string($dirs['logDirectory']['path']), 'setting'=>'logDirectory'); | |
| 313 | - $directories['documentRoot'] = array('section'=>'urls', 'value'=>mysql_real_escape_string($dirs['documentRoot']['path']), 'setting'=>'documentRoot'); | |
| 311 | + $dbconf = $this->getDataFromSession("database"); // retrieve database information from session | |
| 312 | + $this->_dbhandler->load($dbconf['dhost'], $dbconf['duname'], $dbconf['dpassword'], $dbconf['dname']); // initialise the db connection | |
| 313 | + //$this->_dbhandler->getDatabaseLink() | |
| 314 | + $directories['varDirectory'] = array('section'=>'urls', 'value'=>addslashes($dirs['varDirectory']['path']), 'setting'=>'varDirectory'); | |
| 315 | + $directories['logDirectory'] = array('section'=>'urls', 'value'=>addslashes($dirs['logDirectory']['path']), 'setting'=>'logDirectory'); | |
| 316 | + $directories['documentRoot'] = array('section'=>'urls', 'value'=>addslashes($dirs['documentRoot']['path']), 'setting'=>'documentRoot'); | |
| 314 | 317 | $directories['uiDirectory'] = array('section'=>'urls', 'value'=>'${fileSystemRoot}/presentation/lookAndFeel/knowledgeTree', 'setting'=>'uiDirectory'); |
| 315 | - $directories['tmpDirectory'] = array('section'=>'urls', 'value'=>mysql_real_escape_string($dirs['tmpDirectory']['path']), 'setting'=>'tmpDirectory'); | |
| 318 | + $directories['tmpDirectory'] = array('section'=>'urls', 'value'=>addslashes($dirs['tmpDirectory']['path']), 'setting'=>'tmpDirectory'); | |
| 316 | 319 | |
| 317 | 320 | return $directories; |
| 318 | 321 | } | ... | ... |
setup/wizard/steps/services.php
| ... | ... | @@ -412,7 +412,7 @@ class services extends Step |
| 412 | 412 | $this->presetOpenOffice(); |
| 413 | 413 | if(!$this->schedulerInstalled) { |
| 414 | 414 | if(!WINDOWS_OS) $this->php = $this->util->getPhp(); // Get java, if it exists |
| 415 | - $passedPhp = $this->phpChecks(); // Run Java Pre Checks | |
| 415 | + $passedPhp = $this->phpChecks(); // Run Php Pre Checks | |
| 416 | 416 | if ($passedPhp) { // Install Scheduler |
| 417 | 417 | $this->installService('Scheduler'); |
| 418 | 418 | } |
| ... | ... | @@ -430,11 +430,11 @@ class services extends Step |
| 430 | 430 | } |
| 431 | 431 | if(!$this->openOfficeInstalled) { |
| 432 | 432 | if(!WINDOWS_OS) $this->soffice = $this->util->getOpenOffice(); // Get java, if it exists |
| 433 | - $passedOpenOffice = $this->openOfficeChecks(); // Run Java Pre Checks | |
| 433 | + $passedOpenOffice = $this->openOfficeChecks(); // Run Office Pre Checks | |
| 434 | 434 | if ($passedOpenOffice) { //Install OpenOffice |
| 435 | 435 | // $this->temp_variables['openOfficeExe'] = $this->soffice; |
| 436 | 436 | // TODO : Why, O, why? |
| 437 | - $this->openOfficeExeError = false; | |
| 437 | + $this->openOfficeInstalled(); | |
| 438 | 438 | $_SESSION[$this->salt]['services']['openOfficeExe'] = $this->soffice; |
| 439 | 439 | $this->installService('OpenOffice'); |
| 440 | 440 | } |
| ... | ... | @@ -510,6 +510,7 @@ class services extends Step |
| 510 | 510 | foreach ($serverDetails as $serviceName) { |
| 511 | 511 | $className = OS.$serviceName; |
| 512 | 512 | $service = new $className(); |
| 513 | + $service->load(); | |
| 513 | 514 | $status = $this->serviceInstalled($service); |
| 514 | 515 | $flag = strtolower(substr($serviceName,0,1)).substr($serviceName,1)."Installed"; |
| 515 | 516 | if(!$status) { | ... | ... |