Commit 962fb1ea191df8843f40b7112654aeedd4594bcf
1 parent
61f81864
StoryID:1616390: Added error message if Zend Mysql not running.
Committed by: Jarrett Jordaan Reviewed by: Philip Arkcoll
Showing
4 changed files
with
74 additions
and
18 deletions
setup/migrate/migrater.php
| ... | ... | @@ -540,6 +540,9 @@ class Migrater { |
| 540 | 540 | $this->_landing(); |
| 541 | 541 | } elseif ($res == 'landing') { |
| 542 | 542 | $this->_landing(); |
| 543 | + } elseif ($res == 'binstall') { | |
| 544 | + $util = new MigrateUtil(); | |
| 545 | + $util->redirect('../wizard/index.php?step_name=dependencies'); | |
| 543 | 546 | } else { |
| 544 | 547 | } |
| 545 | 548 | break; |
| ... | ... | @@ -550,10 +553,10 @@ class Migrater { |
| 550 | 553 | $util = new MigrateUtil(); |
| 551 | 554 | $util->redirect('../wizard/index.php?step_name=installtype'); |
| 552 | 555 | break; |
| 553 | - case 'binstall': | |
| 554 | - $util = new MigrateUtil(); | |
| 555 | - $util->redirect('../wizard/index.php?step_name=dependencies'); | |
| 556 | - break; | |
| 556 | +// case 'binstall': | |
| 557 | +// $util = new MigrateUtil(); | |
| 558 | +// $util->redirect('../wizard/index.php?step_name=dependencies'); | |
| 559 | +// break; | |
| 557 | 560 | default: |
| 558 | 561 | // TODO : handle silent |
| 559 | 562 | $this->_landing(); | ... | ... |
setup/migrate/steps/migrateComplete.php
| ... | ... | @@ -57,6 +57,14 @@ class migrateComplete extends Step { |
| 57 | 57 | */ |
| 58 | 58 | protected $mysqlServiceName = "KTMysql"; |
| 59 | 59 | |
| 60 | + /** | |
| 61 | + * Name of BitRock Stack MySql | |
| 62 | + * | |
| 63 | + * @access protected | |
| 64 | + * @var string | |
| 65 | + */ | |
| 66 | + protected $zendMysql = "MySQL_ZendServer51"; | |
| 67 | + | |
| 60 | 68 | /** |
| 61 | 69 | * Returns step state |
| 62 | 70 | * |
| ... | ... | @@ -67,23 +75,25 @@ class migrateComplete extends Step { |
| 67 | 75 | */ |
| 68 | 76 | function doStep() { |
| 69 | 77 | $this->temp_variables = array("step_name"=>"complete", "silent"=>$this->silent); |
| 70 | - $this->doRun(); | |
| 71 | - return 'landing'; | |
| 78 | + return $this->doRun(); | |
| 72 | 79 | } |
| 73 | 80 | |
| 74 | 81 | function doRun() { |
| 82 | + $this->checkSqlDump(); | |
| 75 | 83 | if(!$this->inStep("complete")) { |
| 76 | - $this->checkSqlDump(); | |
| 84 | + | |
| 77 | 85 | return 'landing'; |
| 78 | 86 | } |
| 79 | 87 | if($this->next()) { |
| 88 | + $this->checkZendMysql(); | |
| 80 | 89 | if($this->checkMysql()) { |
| 81 | - return 'next'; | |
| 90 | + return 'binstall'; | |
| 82 | 91 | } else { |
| 83 | 92 | return 'error'; |
| 84 | 93 | } |
| 85 | 94 | } |
| 86 | 95 | $this->removeInstallSessions(); |
| 96 | + return 'landing'; | |
| 87 | 97 | } |
| 88 | 98 | |
| 89 | 99 | private function removeInstallSessions() { |
| ... | ... | @@ -132,17 +142,51 @@ class migrateComplete extends Step { |
| 132 | 142 | $running = true; |
| 133 | 143 | } |
| 134 | 144 | if($running) { |
| 135 | - $this->temp_variables['services']['KTMysql']['class'] = "cross"; | |
| 136 | - $this->temp_variables['services']['KTMysql']['name'] = "KTMysql"; | |
| 137 | - $this->temp_variables['services']['KTMysql']['msg'] = "Service Running"; | |
| 145 | + $this->temp_variables['ktmysql']['class'] = "cross"; | |
| 146 | + $this->temp_variables['ktmysql']['name'] = "KTMysql"; | |
| 147 | + $this->temp_variables['ktmysql']['msg'] = "Service Running"; | |
| 138 | 148 | $this->error[] = "Service : KTMysql running.<br/>"; |
| 139 | 149 | return false; |
| 140 | 150 | } else { |
| 141 | - $this->temp_variables['services']['KTMysql']['class'] = "tick"; | |
| 142 | - $this->temp_variables['services']['KTMysql']['name'] = "KTMysql"; | |
| 143 | - $this->temp_variables['services']['KTMysql']['msg'] = "Service has been uninstalled"; | |
| 151 | + $this->temp_variables['ktmysql']['class'] = "tick"; | |
| 152 | + $this->temp_variables['ktmysql']['name'] = "KTMysql"; | |
| 153 | + $this->temp_variables['ktmysql']['msg'] = "Service has been uninstalled"; | |
| 144 | 154 | return true; |
| 145 | 155 | } |
| 146 | 156 | } |
| 157 | + | |
| 158 | + private function checkZendMysql() { | |
| 159 | + $running = false; | |
| 160 | + if(WINDOWS_OS) { | |
| 161 | + $cmd = "sc query {$this->zendMysql}"; | |
| 162 | + $response = $this->util->pexec($cmd); | |
| 163 | + if($response['out']) { | |
| 164 | + $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key | |
| 165 | + } | |
| 166 | + if($state == "STARTED") | |
| 167 | + $running = true; | |
| 168 | + } else { | |
| 169 | + //TODO : Read fomr my.cnf file | |
| 170 | + $mysqlPid = "/var/run/mysqld/mysqld.sock"; | |
| 171 | + if(file_exists($mysqlPid)) | |
| 172 | + $running = true; | |
| 173 | + } | |
| 174 | + if($running) { | |
| 175 | + $this->temp_variables['zmysql']['class'] = "tick"; | |
| 176 | + $this->temp_variables['zmysql']['name'] = "KTMysql"; | |
| 177 | + $this->temp_variables['zmysql']['msg'] = "Service Running"; | |
| 178 | + return true; | |
| 179 | + } else { | |
| 180 | + $this->temp_variables['zmysql']['class'] = "cross"; | |
| 181 | + $this->temp_variables['zmysql']['name'] = "KTMysql"; | |
| 182 | + $this->temp_variables['zmysql']['msg'] = "Service has been uninstalled"; | |
| 183 | + $this->error[] = "Service : KTMysql running.<br/>"; | |
| 184 | + return false; | |
| 185 | + } | |
| 186 | + } | |
| 187 | + | |
| 188 | + public function getErrors() { | |
| 189 | + return $this->error; | |
| 190 | + } | |
| 147 | 191 | } |
| 148 | 192 | ?> |
| 149 | 193 | \ No newline at end of file | ... | ... |
setup/migrate/steps/migrateInstallation.php
| ... | ... | @@ -247,7 +247,6 @@ class migrateInstallation extends step |
| 247 | 247 | $this->urlPaths = array(array('name'=> 'Var Directory', 'path'=> $varDir), |
| 248 | 248 | array('name'=> 'Log Directory', 'path'=> $varDir.DS.'log'), |
| 249 | 249 | array('name'=> 'Document Root', 'path'=> $varDir.DS.'Documents'), |
| 250 | - array('name'=> 'UI Directory', 'path'=> $froot.DS.'presentation'.DS.'lookAndFeel'.DS.'knowledgeTree'), | |
| 251 | 250 | array('name'=> 'Temporary Directory', 'path'=> $varDir.DS.'tmp'), |
| 252 | 251 | array('name'=> 'Cache Directory', 'path'=> $varDir.DS.'cache'), |
| 253 | 252 | array('name'=> 'Upload Directory', 'path'=> $varDir.DS.'uploads'), | ... | ... |
setup/migrate/templates/complete.tpl
| ... | ... | @@ -16,9 +16,19 @@ |
| 16 | 16 | <span class='<?php echo $sql['class']; ?>'> </span><?php echo $sql['msg']; ?> |
| 17 | 17 | <br /><br /> |
| 18 | 18 | <h3>Start new MySQL service</h3> |
| 19 | - In order to complete the upgrade process please start the Zend Server MySQL process (<a href="http://wiki.knowledgetree.com/Web_Based_Migrater#Post_Migrate" target="_blank">Click here for help</a>). | |
| 20 | - | |
| 19 | + In order to complete the upgrade process please start the Zend Server MySQL process, and shutdown the KnowledgeTree Mysql Service. (<a href="http://wiki.knowledgetree.com/Web_Based_Migrater#Deactivate_Services" target="_blank">Click here for help</a>). | |
| 20 | + <br /><br /> | |
| 21 | + <span class='<?php echo $ktmysql['class']; ?>'> </span> | |
| 22 | + <?php echo $ktmysql['name']; ?> | |
| 23 | + <?php echo $ktmysql['msg']; ?> | |
| 24 | + <br /><br /> | |
| 25 | + <?php if (WINDOWS_OS) { ?> | |
| 26 | + <span class='<?php echo $zmysql['class']; ?>'> </span> | |
| 27 | + <?php echo $zmysql['name']; ?> | |
| 28 | + <?php echo $zmysql['msg']; ?> | |
| 29 | + <?php } ?> | |
| 21 | 30 | </div> |
| 22 | - <input class="button_next" type="submit" value="Continue Installation" name="BInstall"/> | |
| 31 | +<!-- <input class="button_next" type="submit" value="Continue Installation" name="BInstall"/>--> | |
| 32 | + <input class="button_next" type="submit" value="Continue Installation" name="Next"/> | |
| 23 | 33 | </form> |
| 24 | 34 | <?php if (AJAX) { echo $html->js('form.js'); } ?> |
| 25 | 35 | \ No newline at end of file | ... | ... |