Commit 6a895397aeea30c870e41258e6c0577ec9f18efc
1 parent
adf1a089
Daily Commit
Committed by: Jarrett Jordaan Reviewed by: Paul Barrett
Showing
10 changed files
with
112 additions
and
89 deletions
setup/migrate/config/commercial_config.xml
| @@ -10,8 +10,8 @@ | @@ -10,8 +10,8 @@ | ||
| 10 | <migrate version="3.7" type="Community Edition"> | 10 | <migrate version="3.7" type="Community Edition"> |
| 11 | <steps> | 11 | <steps> |
| 12 | <step name="Current Installation">installation</step> | 12 | <step name="Current Installation">installation</step> |
| 13 | - <step name="Deactivate Services">services</step> | ||
| 14 | <step name="Database Migration">database</step> | 13 | <step name="Database Migration">database</step> |
| 14 | + <step name="Deactivate Services">services</step> | ||
| 15 | <step name="Complete">complete</step> | 15 | <step name="Complete">complete</step> |
| 16 | </steps> | 16 | </steps> |
| 17 | </migrate> | 17 | </migrate> |
| 18 | \ No newline at end of file | 18 | \ No newline at end of file |
setup/migrate/config/community_config.xml
| @@ -10,8 +10,8 @@ | @@ -10,8 +10,8 @@ | ||
| 10 | <migrate version="3.7" type="Community Edition"> | 10 | <migrate version="3.7" type="Community Edition"> |
| 11 | <steps> | 11 | <steps> |
| 12 | <step name="Current Installation">installation</step> | 12 | <step name="Current Installation">installation</step> |
| 13 | - <step name="Deactivate Services">services</step> | ||
| 14 | <step name="Database Migration">database</step> | 13 | <step name="Database Migration">database</step> |
| 14 | + <step name="Deactivate Services">services</step> | ||
| 15 | <step name="Complete">complete</step> | 15 | <step name="Complete">complete</step> |
| 16 | </steps> | 16 | </steps> |
| 17 | </migrate> | 17 | </migrate> |
| 18 | \ No newline at end of file | 18 | \ No newline at end of file |
setup/migrate/migrateUtil.php
| @@ -50,7 +50,7 @@ class MigrateUtil extends InstallUtil { | @@ -50,7 +50,7 @@ class MigrateUtil extends InstallUtil { | ||
| 50 | * @param none | 50 | * @param none |
| 51 | * @return boolean | 51 | * @return boolean |
| 52 | */ | 52 | */ |
| 53 | - public function isSystemMigrateed() { | 53 | + public function isSystemMigrated() { |
| 54 | if (file_exists(dirname(__FILE__)."/migrate")) { | 54 | if (file_exists(dirname(__FILE__)."/migrate")) { |
| 55 | 55 | ||
| 56 | return true; | 56 | return true; |
setup/migrate/migrateWizard.php
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | * KnowledgeTree Community Edition | 5 | * KnowledgeTree Community Edition |
| 6 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| 7 | * Copyright (C) 2008,2009 KnowledgeTree Inc. | 7 | * Copyright (C) 2008,2009 KnowledgeTree Inc. |
| 8 | -* | 8 | +* |
| 9 | * | 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify it under | 10 | * This program is free software; you can redistribute it and/or modify it under |
| 11 | * the terms of the GNU General Public License version 3 as published by the | 11 | * the terms of the GNU General Public License version 3 as published by the |
| @@ -98,10 +98,10 @@ class MigrateWizard { | @@ -98,10 +98,10 @@ class MigrateWizard { | ||
| 98 | * @param none | 98 | * @param none |
| 99 | * @return boolean | 99 | * @return boolean |
| 100 | */ | 100 | */ |
| 101 | - private function isSystemMigrateed() { | ||
| 102 | - return $this->util->isSystemMigrateed(); | 101 | + private function isSystemMigrated() { |
| 102 | + return $this->util->isSystemMigrated(); | ||
| 103 | } | 103 | } |
| 104 | - | 104 | + |
| 105 | /** | 105 | /** |
| 106 | * Display the wizard | 106 | * Display the wizard |
| 107 | * | 107 | * |
| @@ -119,7 +119,7 @@ class MigrateWizard { | @@ -119,7 +119,7 @@ class MigrateWizard { | ||
| 119 | $ins->step(); // Run step | 119 | $ins->step(); // Run step |
| 120 | } | 120 | } |
| 121 | } | 121 | } |
| 122 | - | 122 | + |
| 123 | /** | 123 | /** |
| 124 | * Set bypass flag | 124 | * Set bypass flag |
| 125 | * | 125 | * |
| @@ -131,7 +131,7 @@ class MigrateWizard { | @@ -131,7 +131,7 @@ class MigrateWizard { | ||
| 131 | private function setBypass($bypass) { | 131 | private function setBypass($bypass) { |
| 132 | $this->bypass = $bypass; | 132 | $this->bypass = $bypass; |
| 133 | } | 133 | } |
| 134 | - | 134 | + |
| 135 | /** | 135 | /** |
| 136 | * Set util reference | 136 | * Set util reference |
| 137 | * | 137 | * |
| @@ -143,7 +143,7 @@ class MigrateWizard { | @@ -143,7 +143,7 @@ class MigrateWizard { | ||
| 143 | private function setIUtil($util) { | 143 | private function setIUtil($util) { |
| 144 | $this->util = $util; | 144 | $this->util = $util; |
| 145 | } | 145 | } |
| 146 | - | 146 | + |
| 147 | /** | 147 | /** |
| 148 | * Get bypass flag | 148 | * Get bypass flag |
| 149 | * | 149 | * |
| @@ -155,7 +155,7 @@ class MigrateWizard { | @@ -155,7 +155,7 @@ class MigrateWizard { | ||
| 155 | public function getBypass() { | 155 | public function getBypass() { |
| 156 | return $this->bypass; | 156 | return $this->bypass; |
| 157 | } | 157 | } |
| 158 | - | 158 | + |
| 159 | /** | 159 | /** |
| 160 | * Bypass and force an migrate | 160 | * Bypass and force an migrate |
| 161 | * | 161 | * |
| @@ -165,9 +165,9 @@ class MigrateWizard { | @@ -165,9 +165,9 @@ class MigrateWizard { | ||
| 165 | * @return boolean | 165 | * @return boolean |
| 166 | */ | 166 | */ |
| 167 | private function bypass() { | 167 | private function bypass() { |
| 168 | - | 168 | + |
| 169 | } | 169 | } |
| 170 | - | 170 | + |
| 171 | /** | 171 | /** |
| 172 | * Create migrate file | 172 | * Create migrate file |
| 173 | * | 173 | * |
| @@ -179,7 +179,7 @@ class MigrateWizard { | @@ -179,7 +179,7 @@ class MigrateWizard { | ||
| 179 | private function createMigrateFile() { | 179 | private function createMigrateFile() { |
| 180 | @touch("migrate"); | 180 | @touch("migrate"); |
| 181 | } | 181 | } |
| 182 | - | 182 | + |
| 183 | /** | 183 | /** |
| 184 | * Remove migrate file | 184 | * Remove migrate file |
| 185 | * | 185 | * |
| @@ -191,7 +191,7 @@ class MigrateWizard { | @@ -191,7 +191,7 @@ class MigrateWizard { | ||
| 191 | private function removeMigrateFile() { | 191 | private function removeMigrateFile() { |
| 192 | @unlink("migrate"); | 192 | @unlink("migrate"); |
| 193 | } | 193 | } |
| 194 | - | 194 | + |
| 195 | /** | 195 | /** |
| 196 | * Load default values | 196 | * Load default values |
| 197 | * | 197 | * |
| @@ -206,7 +206,7 @@ class MigrateWizard { | @@ -206,7 +206,7 @@ class MigrateWizard { | ||
| 206 | } | 206 | } |
| 207 | $this->setIUtil(new MigrateUtil()); | 207 | $this->setIUtil(new MigrateUtil()); |
| 208 | } | 208 | } |
| 209 | - | 209 | + |
| 210 | /** | 210 | /** |
| 211 | * Run pre-migrateation system checks | 211 | * Run pre-migrateation system checks |
| 212 | * | 212 | * |
| @@ -232,7 +232,7 @@ class MigrateWizard { | @@ -232,7 +232,7 @@ class MigrateWizard { | ||
| 232 | break; | 232 | break; |
| 233 | } | 233 | } |
| 234 | } | 234 | } |
| 235 | - | 235 | + |
| 236 | /** | 236 | /** |
| 237 | * Control all requests to wizard | 237 | * Control all requests to wizard |
| 238 | * | 238 | * |
| @@ -248,7 +248,7 @@ class MigrateWizard { | @@ -248,7 +248,7 @@ class MigrateWizard { | ||
| 248 | } elseif ($this->getBypass() === "0") { | 248 | } elseif ($this->getBypass() === "0") { |
| 249 | $this->createMigrateFile(); | 249 | $this->createMigrateFile(); |
| 250 | } | 250 | } |
| 251 | - if(!$this->isSystemMigrateed()) { // Check if the systems not migrated | 251 | + if(!$this->isSystemMigrated()) { // Check if the systems not migrated |
| 252 | $response = $this->systemChecks(); | 252 | $response = $this->systemChecks(); |
| 253 | if($response === true) { | 253 | if($response === true) { |
| 254 | $this->displayMigrater(); | 254 | $this->displayMigrater(); |
setup/migrate/steps/migrateDatabase.php
| 1 | <?php | 1 | <?php |
| 2 | /** | 2 | /** |
| 3 | -* Database Step Controller. | 3 | +* Database Step Controller. |
| 4 | * | 4 | * |
| 5 | * KnowledgeTree Community Edition | 5 | * KnowledgeTree Community Edition |
| 6 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| @@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
| 40 | * @version Version 0.1 | 40 | * @version Version 0.1 |
| 41 | */ | 41 | */ |
| 42 | 42 | ||
| 43 | -class migrateDatabase extends Step | 43 | +class migrateDatabase extends Step |
| 44 | { | 44 | { |
| 45 | /** | 45 | /** |
| 46 | * List of errors encountered | 46 | * List of errors encountered |
| @@ -50,7 +50,7 @@ class migrateDatabase extends Step | @@ -50,7 +50,7 @@ class migrateDatabase extends Step | ||
| 50 | * @var array | 50 | * @var array |
| 51 | */ | 51 | */ |
| 52 | public $error = array(); | 52 | public $error = array(); |
| 53 | - | 53 | + |
| 54 | /** | 54 | /** |
| 55 | * Flag to store class information in session | 55 | * Flag to store class information in session |
| 56 | * | 56 | * |
| @@ -59,7 +59,7 @@ class migrateDatabase extends Step | @@ -59,7 +59,7 @@ class migrateDatabase extends Step | ||
| 59 | * @var array | 59 | * @var array |
| 60 | */ | 60 | */ |
| 61 | public $storeInSession = true; | 61 | public $storeInSession = true; |
| 62 | - | 62 | + |
| 63 | /** | 63 | /** |
| 64 | * Flag if step needs to be migrated | 64 | * Flag if step needs to be migrated |
| 65 | * | 65 | * |
| @@ -68,7 +68,7 @@ class migrateDatabase extends Step | @@ -68,7 +68,7 @@ class migrateDatabase extends Step | ||
| 68 | * @var array | 68 | * @var array |
| 69 | */ | 69 | */ |
| 70 | protected $runMigrate = true; | 70 | protected $runMigrate = true; |
| 71 | - | 71 | + |
| 72 | /** | 72 | /** |
| 73 | * Flag if step needs to run silently | 73 | * Flag if step needs to run silently |
| 74 | * | 74 | * |
| @@ -112,7 +112,7 @@ class migrateDatabase extends Step | @@ -112,7 +112,7 @@ class migrateDatabase extends Step | ||
| 112 | } else if($this->previous()) { | 112 | } else if($this->previous()) { |
| 113 | return 'previous'; | 113 | return 'previous'; |
| 114 | } | 114 | } |
| 115 | - | 115 | + |
| 116 | return 'landing'; | 116 | return 'landing'; |
| 117 | } | 117 | } |
| 118 | 118 | ||
| @@ -145,7 +145,7 @@ class migrateDatabase extends Step | @@ -145,7 +145,7 @@ class migrateDatabase extends Step | ||
| 145 | if(!$manual) { // Try to export database | 145 | if(!$manual) { // Try to export database |
| 146 | $sqlFile = $tmpFolder."/kt-backup-$date.sql"; | 146 | $sqlFile = $tmpFolder."/kt-backup-$date.sql"; |
| 147 | $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile; | 147 | $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile; |
| 148 | - $this->util->pexec($cmd); | 148 | + $response = $this->util->pexec($cmd); |
| 149 | } | 149 | } |
| 150 | if(file_exists($sqlFile)) { | 150 | if(file_exists($sqlFile)) { |
| 151 | $fileContents = file_get_contents($sqlFile); | 151 | $fileContents = file_get_contents($sqlFile); |
| @@ -156,19 +156,35 @@ class migrateDatabase extends Step | @@ -156,19 +156,35 @@ class migrateDatabase extends Step | ||
| 156 | } | 156 | } |
| 157 | // Handle failed dump | 157 | // Handle failed dump |
| 158 | if(WINDOWS_OS) { | 158 | if(WINDOWS_OS) { |
| 159 | - $sqlFile = "C:\\kt-backup-$date.sql"; // Use tmp instead due to permissions | 159 | + // Could be permissions, check error code. |
| 160 | + if($response['ret'] == 2) { | ||
| 161 | + | ||
| 162 | + } else { | ||
| 163 | + $sqlFile = "C:\\kt-backup-$date.sql"; // Use tmp instead due to permissions | ||
| 164 | + } | ||
| 160 | } else { | 165 | } else { |
| 161 | - $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions | 166 | + if($response['ret'] == 2) { |
| 167 | + | ||
| 168 | + } else { | ||
| 169 | + $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions | ||
| 170 | + } | ||
| 162 | } | 171 | } |
| 163 | $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile; | 172 | $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile; |
| 164 | - $this->error[]['error'] = "Could not export database:"; | ||
| 165 | - $this->error[]['msg'] = "Execute the following command in a $termOrBash."; | ||
| 166 | - $this->error[]['cmd'] = $cmd; | ||
| 167 | - $this->temp_variables['manual_export'] = $sqlFile; | ||
| 168 | - | 173 | + if($response['ret'] == 2) { |
| 174 | + $this->error[]['error'] = "Could not connect to KnowledgeTree Database"; | ||
| 175 | + $this->error[]['msg'] = "Make sure all KnowledgeTree Services are running."; | ||
| 176 | + $this->error[]['cmd'] = "<p class=\"description\">Click <b>Next</b> after resolving the above errors.</p>"; | ||
| 177 | + $this->temp_variables['manual_export'] = "a"; | ||
| 178 | + } else { | ||
| 179 | + $this->error[]['error'] = "Could not export database:"; | ||
| 180 | + $this->error[]['msg'] = "Execute the following command in a $termOrBash."; | ||
| 181 | + $this->error[]['cmd'] = $cmd; | ||
| 182 | + $this->temp_variables['manual_export'] = $sqlFile; | ||
| 183 | + } | ||
| 184 | + | ||
| 169 | return false; | 185 | return false; |
| 170 | } | 186 | } |
| 171 | - | 187 | + |
| 172 | // TODO | 188 | // TODO |
| 173 | function resolveTempDir() { | 189 | function resolveTempDir() { |
| 174 | if (!WINDOWS_OS) { | 190 | if (!WINDOWS_OS) { |
| @@ -179,7 +195,7 @@ class migrateDatabase extends Step | @@ -179,7 +195,7 @@ class migrateDatabase extends Step | ||
| 179 | if (!is_dir($dir)) { | 195 | if (!is_dir($dir)) { |
| 180 | mkdir($dir); | 196 | mkdir($dir); |
| 181 | } | 197 | } |
| 182 | - | 198 | + |
| 183 | return $dir; | 199 | return $dir; |
| 184 | } | 200 | } |
| 185 | 201 | ||
| @@ -197,10 +213,10 @@ class migrateDatabase extends Step | @@ -197,10 +213,10 @@ class migrateDatabase extends Step | ||
| 197 | $this->temp_variables['dumpLocation'] = $this->getPostSafe('dumpLocation'); | 213 | $this->temp_variables['dumpLocation'] = $this->getPostSafe('dumpLocation'); |
| 198 | $this->createMigrateFile(); // create lock file to indicate migration mode | 214 | $this->createMigrateFile(); // create lock file to indicate migration mode |
| 199 | } | 215 | } |
| 200 | - | 216 | + |
| 201 | /** | 217 | /** |
| 202 | * Creates migration lock file so that system knows it is supposed to run an upgrade installation | 218 | * Creates migration lock file so that system knows it is supposed to run an upgrade installation |
| 203 | - * | 219 | + * |
| 204 | * @author KnowledgeTree Team | 220 | * @author KnowledgeTree Team |
| 205 | * @access private | 221 | * @access private |
| 206 | * @return void | 222 | * @return void |
| @@ -208,7 +224,7 @@ class migrateDatabase extends Step | @@ -208,7 +224,7 @@ class migrateDatabase extends Step | ||
| 208 | private function createMigrateFile() { | 224 | private function createMigrateFile() { |
| 209 | @touch(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock"); | 225 | @touch(SYSTEM_DIR.'var'.DS.'bin'.DS."migrate.lock"); |
| 210 | } | 226 | } |
| 211 | - | 227 | + |
| 212 | /** | 228 | /** |
| 213 | * Safer way to return post data | 229 | * Safer way to return post data |
| 214 | * | 230 | * |
| @@ -220,7 +236,7 @@ class migrateDatabase extends Step | @@ -220,7 +236,7 @@ class migrateDatabase extends Step | ||
| 220 | public function getPostSafe($key) { | 236 | public function getPostSafe($key) { |
| 221 | return isset($_POST[$key]) ? $_POST[$key] : ""; | 237 | return isset($_POST[$key]) ? $_POST[$key] : ""; |
| 222 | } | 238 | } |
| 223 | - | 239 | + |
| 224 | /** | 240 | /** |
| 225 | * Stores varibles used by template | 241 | * Stores varibles used by template |
| 226 | * | 242 | * |
| @@ -244,7 +260,7 @@ class migrateDatabase extends Step | @@ -244,7 +260,7 @@ class migrateDatabase extends Step | ||
| 244 | public function getErrors() { | 260 | public function getErrors() { |
| 245 | return $this->error; | 261 | return $this->error; |
| 246 | } | 262 | } |
| 247 | - | 263 | + |
| 248 | /** | 264 | /** |
| 249 | * Initialize errors to false | 265 | * Initialize errors to false |
| 250 | * | 266 | * |
| @@ -258,12 +274,12 @@ class migrateDatabase extends Step | @@ -258,12 +274,12 @@ class migrateDatabase extends Step | ||
| 258 | $this->error[$e] = false; | 274 | $this->error[$e] = false; |
| 259 | } | 275 | } |
| 260 | } | 276 | } |
| 261 | - | 277 | + |
| 262 | private function storeSilent() { | 278 | private function storeSilent() { |
| 263 | // TODO | 279 | // TODO |
| 264 | $_SESSION['migrate']['database']['dumpLocation'] = $this->sqlDumpFile; | 280 | $_SESSION['migrate']['database']['dumpLocation'] = $this->sqlDumpFile; |
| 265 | $this->temp_variables['dumpLocation'] = $this->sqlDumpFile; | 281 | $this->temp_variables['dumpLocation'] = $this->sqlDumpFile; |
| 266 | } | 282 | } |
| 267 | - | 283 | + |
| 268 | } | 284 | } |
| 269 | ?> | 285 | ?> |
| 270 | \ No newline at end of file | 286 | \ No newline at end of file |
setup/migrate/steps/migrateInstallation.php
| 1 | <?php | 1 | <?php |
| 2 | /** | 2 | /** |
| 3 | -* Migrate Step Controller. | 3 | +* Migrate Step Controller. |
| 4 | * | 4 | * |
| 5 | * KnowledgeTree Community Edition | 5 | * KnowledgeTree Community Edition |
| 6 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| @@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
| 40 | * @version Version 0.1 | 40 | * @version Version 0.1 |
| 41 | */ | 41 | */ |
| 42 | 42 | ||
| 43 | -class migrateInstallation extends step | 43 | +class migrateInstallation extends step |
| 44 | { | 44 | { |
| 45 | /** | 45 | /** |
| 46 | * Flag to display confirmation page first | 46 | * Flag to display confirmation page first |
| @@ -50,7 +50,7 @@ class migrateInstallation extends step | @@ -50,7 +50,7 @@ class migrateInstallation extends step | ||
| 50 | * @var array | 50 | * @var array |
| 51 | */ | 51 | */ |
| 52 | public $displayFirst = false; | 52 | public $displayFirst = false; |
| 53 | - | 53 | + |
| 54 | /** | 54 | /** |
| 55 | * Flag to store class information in session | 55 | * Flag to store class information in session |
| 56 | * | 56 | * |
| @@ -77,13 +77,13 @@ class migrateInstallation extends step | @@ -77,13 +77,13 @@ class migrateInstallation extends step | ||
| 77 | * @var array | 77 | * @var array |
| 78 | */ | 78 | */ |
| 79 | protected $silent = false; | 79 | protected $silent = false; |
| 80 | - | 80 | + |
| 81 | private $location = ''; | 81 | private $location = ''; |
| 82 | - | 82 | + |
| 83 | private $dbSettings = array(); | 83 | private $dbSettings = array(); |
| 84 | - | 84 | + |
| 85 | private $ktSettings = array(); | 85 | private $ktSettings = array(); |
| 86 | - | 86 | + |
| 87 | private $urlPaths = array(); | 87 | private $urlPaths = array(); |
| 88 | 88 | ||
| 89 | /** | 89 | /** |
| @@ -92,15 +92,15 @@ class migrateInstallation extends step | @@ -92,15 +92,15 @@ class migrateInstallation extends step | ||
| 92 | * @author KnowledgeTree Team | 92 | * @author KnowledgeTree Team |
| 93 | * @access public | 93 | * @access public |
| 94 | * @var object | 94 | * @var object |
| 95 | - */ | 95 | + */ |
| 96 | private $settings = array(); | 96 | private $settings = array(); |
| 97 | - | 97 | + |
| 98 | private $supportedVersion = '3.6.1'; | 98 | private $supportedVersion = '3.6.1'; |
| 99 | - | 99 | + |
| 100 | private $foundVersion = 'Unknown'; | 100 | private $foundVersion = 'Unknown'; |
| 101 | - | 101 | + |
| 102 | private $versionError = false; | 102 | private $versionError = false; |
| 103 | - | 103 | + |
| 104 | public function doStep() { | 104 | public function doStep() { |
| 105 | $this->temp_variables = array("step_name"=>"installation", "silent"=>$this->silent); | 105 | $this->temp_variables = array("step_name"=>"installation", "silent"=>$this->silent); |
| 106 | $this->detectInstallation(); | 106 | $this->detectInstallation(); |
| @@ -122,8 +122,8 @@ class migrateInstallation extends step | @@ -122,8 +122,8 @@ class migrateInstallation extends step | ||
| 122 | return 'next'; | 122 | return 'next'; |
| 123 | } | 123 | } |
| 124 | $this->doRun(); | 124 | $this->doRun(); |
| 125 | - | ||
| 126 | - return 'landing'; | 125 | + |
| 126 | + return 'landing'; | ||
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | public function detectInstallation() { | 129 | public function detectInstallation() { |
| @@ -141,7 +141,7 @@ class migrateInstallation extends step | @@ -141,7 +141,7 @@ class migrateInstallation extends step | ||
| 141 | } | 141 | } |
| 142 | } | 142 | } |
| 143 | } | 143 | } |
| 144 | - | 144 | + |
| 145 | public function doRun() { | 145 | public function doRun() { |
| 146 | if(!$this->readConfig()) { | 146 | if(!$this->readConfig()) { |
| 147 | $this->storeSilent(); | 147 | $this->storeSilent(); |
| @@ -154,7 +154,7 @@ class migrateInstallation extends step | @@ -154,7 +154,7 @@ class migrateInstallation extends step | ||
| 154 | $this->storeSilent(); | 154 | $this->storeSilent(); |
| 155 | return true; | 155 | return true; |
| 156 | } | 156 | } |
| 157 | - | 157 | + |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | public function checkVersion() { | 160 | public function checkVersion() { |
| @@ -163,10 +163,10 @@ class migrateInstallation extends step | @@ -163,10 +163,10 @@ class migrateInstallation extends step | ||
| 163 | $this->error[] = "KT installation needs to be 3.6.1 or higher"; | 163 | $this->error[] = "KT installation needs to be 3.6.1 or higher"; |
| 164 | return false; | 164 | return false; |
| 165 | } | 165 | } |
| 166 | - | 166 | + |
| 167 | return true; | 167 | return true; |
| 168 | } | 168 | } |
| 169 | - | 169 | + |
| 170 | public function readVersion() { | 170 | public function readVersion() { |
| 171 | $verFile = $this->location."/knowledgeTree/docs/VERSION.txt"; | 171 | $verFile = $this->location."/knowledgeTree/docs/VERSION.txt"; |
| 172 | if(file_exists($verFile)) { | 172 | if(file_exists($verFile)) { |
| @@ -176,25 +176,25 @@ class migrateInstallation extends step | @@ -176,25 +176,25 @@ class migrateInstallation extends step | ||
| 176 | $this->error[] = "KT installation version not found"; | 176 | $this->error[] = "KT installation version not found"; |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | - return false; | 179 | + return false; |
| 180 | } | 180 | } |
| 181 | - | 181 | + |
| 182 | public function readConfig() { | 182 | public function readConfig() { |
| 183 | if(isset($_POST['location'])) { | 183 | if(isset($_POST['location'])) { |
| 184 | $ktInstallPath = $_POST['location']; | 184 | $ktInstallPath = $_POST['location']; |
| 185 | if($ktInstallPath != '' || strlen($ktInstallPath) == 0) { | 185 | if($ktInstallPath != '' || strlen($ktInstallPath) == 0) { |
| 186 | $this->location = $ktInstallPath; | 186 | $this->location = $ktInstallPath; |
| 187 | - | 187 | + |
| 188 | return $this->configExists($ktInstallPath); | 188 | return $this->configExists($ktInstallPath); |
| 189 | - } | 189 | + } |
| 190 | } else { | 190 | } else { |
| 191 | - | 191 | + |
| 192 | return false; | 192 | return false; |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | return false; | 195 | return false; |
| 196 | } | 196 | } |
| 197 | - | 197 | + |
| 198 | private function configExists($ktInstallPath) { | 198 | private function configExists($ktInstallPath) { |
| 199 | if(file_exists($ktInstallPath)) { | 199 | if(file_exists($ktInstallPath)) { |
| 200 | $configPath = $ktInstallPath.DS."knowledgeTree".DS."config".DS."config-path"; | 200 | $configPath = $ktInstallPath.DS."knowledgeTree".DS."config".DS."config-path"; |
| @@ -203,7 +203,7 @@ class migrateInstallation extends step | @@ -203,7 +203,7 @@ class migrateInstallation extends step | ||
| 203 | if(file_exists($configFilePath)) { // For 3.7 and after | 203 | if(file_exists($configFilePath)) { // For 3.7 and after |
| 204 | $this->loadConfig($configFilePath); | 204 | $this->loadConfig($configFilePath); |
| 205 | $this->storeSilent(); | 205 | $this->storeSilent(); |
| 206 | - | 206 | + |
| 207 | return true; | 207 | return true; |
| 208 | } else { | 208 | } else { |
| 209 | $configFilePath = $ktInstallPath.DS."knowledgeTree".DS.$configFilePath; // For older than 3.6.2 | 209 | $configFilePath = $ktInstallPath.DS."knowledgeTree".DS.$configFilePath; // For older than 3.6.2 |
| @@ -211,7 +211,7 @@ class migrateInstallation extends step | @@ -211,7 +211,7 @@ class migrateInstallation extends step | ||
| 211 | if(file_exists($configFilePath)) { | 211 | if(file_exists($configFilePath)) { |
| 212 | $this->loadConfig($configFilePath); | 212 | $this->loadConfig($configFilePath); |
| 213 | $this->storeSilent(); | 213 | $this->storeSilent(); |
| 214 | - | 214 | + |
| 215 | return true; | 215 | return true; |
| 216 | } | 216 | } |
| 217 | $this->error[] = "KT installation configuration file empty"; | 217 | $this->error[] = "KT installation configuration file empty"; |
| @@ -222,10 +222,10 @@ class migrateInstallation extends step | @@ -222,10 +222,10 @@ class migrateInstallation extends step | ||
| 222 | } else { | 222 | } else { |
| 223 | $this->error[] = "Please Enter a Location"; | 223 | $this->error[] = "Please Enter a Location"; |
| 224 | } | 224 | } |
| 225 | - | 225 | + |
| 226 | return false; | 226 | return false; |
| 227 | } | 227 | } |
| 228 | - | 228 | + |
| 229 | private function loadConfig($path) { | 229 | private function loadConfig($path) { |
| 230 | $this->util->iniUtilities->load($path); | 230 | $this->util->iniUtilities->load($path); |
| 231 | $dbSettings = $this->util->iniUtilities->getSection('db'); | 231 | $dbSettings = $this->util->iniUtilities->getSection('db'); |
| @@ -233,7 +233,6 @@ class migrateInstallation extends step | @@ -233,7 +233,6 @@ class migrateInstallation extends step | ||
| 233 | 'dbName'=> $dbSettings['dbName'], | 233 | 'dbName'=> $dbSettings['dbName'], |
| 234 | 'dbUser'=> $dbSettings['dbUser'], | 234 | 'dbUser'=> $dbSettings['dbUser'], |
| 235 | 'dbPass'=> $dbSettings['dbPass'], | 235 | 'dbPass'=> $dbSettings['dbPass'], |
| 236 | - 'dbPort'=> $this->util->getPort($this->location), | ||
| 237 | 'dbAdminUser'=> $dbSettings['dbAdminUser'], | 236 | 'dbAdminUser'=> $dbSettings['dbAdminUser'], |
| 238 | 'dbAdminPass'=> $dbSettings['dbAdminPass'], | 237 | 'dbAdminPass'=> $dbSettings['dbAdminPass'], |
| 239 | ); | 238 | ); |
| @@ -253,11 +252,12 @@ class migrateInstallation extends step | @@ -253,11 +252,12 @@ class migrateInstallation extends step | ||
| 253 | array('name'=> 'Cache Directory', 'path'=> $varDir.DS.'cache'), | 252 | array('name'=> 'Cache Directory', 'path'=> $varDir.DS.'cache'), |
| 254 | array('name'=> 'Upload Directory', 'path'=> $varDir.DS.'uploads'), | 253 | array('name'=> 'Upload Directory', 'path'=> $varDir.DS.'uploads'), |
| 255 | ); | 254 | ); |
| 255 | + $this->dbSettings['dbPort'] = $this->util->getPort($this->location); // Add Port | ||
| 256 | $this->temp_variables['urlPaths'] = $this->urlPaths; | 256 | $this->temp_variables['urlPaths'] = $this->urlPaths; |
| 257 | $this->temp_variables['ktSettings'] = $this->ktSettings; | 257 | $this->temp_variables['ktSettings'] = $this->ktSettings; |
| 258 | $this->temp_variables['dbSettings'] = $this->dbSettings; | 258 | $this->temp_variables['dbSettings'] = $this->dbSettings; |
| 259 | } | 259 | } |
| 260 | - | 260 | + |
| 261 | private function setDetails() { | 261 | private function setDetails() { |
| 262 | $inst = $this->getDataFromSession("installation"); | 262 | $inst = $this->getDataFromSession("installation"); |
| 263 | if ($inst) { | 263 | if ($inst) { |
| @@ -266,7 +266,7 @@ class migrateInstallation extends step | @@ -266,7 +266,7 @@ class migrateInstallation extends step | ||
| 266 | } | 266 | } |
| 267 | } | 267 | } |
| 268 | } | 268 | } |
| 269 | - | 269 | + |
| 270 | public function getStepVars() { | 270 | public function getStepVars() { |
| 271 | return $this->temp_variables; | 271 | return $this->temp_variables; |
| 272 | } | 272 | } |
| @@ -274,13 +274,13 @@ class migrateInstallation extends step | @@ -274,13 +274,13 @@ class migrateInstallation extends step | ||
| 274 | public function getErrors() { | 274 | public function getErrors() { |
| 275 | return $this->error; | 275 | return $this->error; |
| 276 | } | 276 | } |
| 277 | - | 277 | + |
| 278 | public function storeSilent() { | 278 | public function storeSilent() { |
| 279 | if($this->location==1) { $this->location = '';} | 279 | if($this->location==1) { $this->location = '';} |
| 280 | $this->temp_variables['location'] = $this->location; | 280 | $this->temp_variables['location'] = $this->location; |
| 281 | $this->temp_variables['foundVersion'] = $this->foundVersion; | 281 | $this->temp_variables['foundVersion'] = $this->foundVersion; |
| 282 | $this->temp_variables['versionError'] = $this->versionError; | 282 | $this->temp_variables['versionError'] = $this->versionError; |
| 283 | $this->temp_variables['settings'] = $this->settings; | 283 | $this->temp_variables['settings'] = $this->settings; |
| 284 | - } | 284 | + } |
| 285 | } | 285 | } |
| 286 | ?> | 286 | ?> |
| 287 | \ No newline at end of file | 287 | \ No newline at end of file |
setup/migrate/templates/database.tpl
| @@ -2,17 +2,20 @@ | @@ -2,17 +2,20 @@ | ||
| 2 | <p class="title">Migrate Database</p> | 2 | <p class="title">Migrate Database</p> |
| 3 | <div id="database" class="step1" style="display:block;"> | 3 | <div id="database" class="step1" style="display:block;"> |
| 4 | <div class="description"> | 4 | <div class="description"> |
| 5 | - This step configures the connection to the database server and migrates the database. | 5 | + This step configures the connection to the database server and migrates the database. |
| 6 | <!-- The details for an administrative <br/>--> | 6 | <!-- The details for an administrative <br/>--> |
| 7 | <!-- user on the database server are required in order to be able to configure and migrate the database.--> | 7 | <!-- user on the database server are required in order to be able to configure and migrate the database.--> |
| 8 | </div> | 8 | </div> |
| 9 | <div id="step_content_<?php echo $step_name; ?>" class="step"> | 9 | <div id="step_content_<?php echo $step_name; ?>" class="step"> |
| 10 | + <?php if(empty($errors)) { ?> | ||
| 10 | <p class="description">The Setup Wizard will now migrate your existing database to the new Zend Server stack. This process may take | 11 | <p class="description">The Setup Wizard will now migrate your existing database to the new Zend Server stack. This process may take |
| 11 | several minutes to complete.</p><br /> | 12 | several minutes to complete.</p><br /> |
| 12 | <span class="error">Please ensure that your database is backed up before proceeding. If you need assistance with backing up see the <a class="description_click" target="_blank" href="http://wiki.knowledgetree.com/Backing_up_and_restoring_KnowledgeTree">'Backing up and restoring KnowledgeTree'</a> wiki entry. | 13 | <span class="error">Please ensure that your database is backed up before proceeding. If you need assistance with backing up see the <a class="description_click" target="_blank" href="http://wiki.knowledgetree.com/Backing_up_and_restoring_KnowledgeTree">'Backing up and restoring KnowledgeTree'</a> wiki entry. |
| 13 | </span> | 14 | </span> |
| 14 | <br /><br /> | 15 | <br /><br /> |
| 15 | <p class="description">Click <b>Next</b> to continue.</p> | 16 | <p class="description">Click <b>Next</b> to continue.</p> |
| 17 | + <?php } ?> | ||
| 18 | +<!--Handle a failed dump--> | ||
| 16 | <?php if(isset($errors)) { ?> | 19 | <?php if(isset($errors)) { ?> |
| 17 | <?php | 20 | <?php |
| 18 | foreach ($errors as $error) { | 21 | foreach ($errors as $error) { |
| @@ -35,7 +38,7 @@ | @@ -35,7 +38,7 @@ | ||
| 35 | <?php | 38 | <?php |
| 36 | } | 39 | } |
| 37 | ?> | 40 | ?> |
| 38 | - | 41 | + |
| 39 | <?php | 42 | <?php |
| 40 | if(isset($error['cmd'])) { | 43 | if(isset($error['cmd'])) { |
| 41 | echo $error['cmd']; | 44 | echo $error['cmd']; |
setup/migrate/templates/services.tpl
| 1 | <form action="index.php?step_name=<?php echo $step_name; ?>" method="post" id="<?php echo $step_name; ?>"> | 1 | <form action="index.php?step_name=<?php echo $step_name; ?>" method="post" id="<?php echo $step_name; ?>"> |
| 2 | <p class="title">Deactivate Services</p> | 2 | <p class="title">Deactivate Services</p> |
| 3 | - | 3 | + |
| 4 | <p class="description"> | 4 | <p class="description"> |
| 5 | All KnowledgeTree services need to be deactivated before the migration takes place. | 5 | All KnowledgeTree services need to be deactivated before the migration takes place. |
| 6 | </p> | 6 | </p> |
| @@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
| 34 | <!--Content--> | 34 | <!--Content--> |
| 35 | <div id="step_content_<?php echo $step_name; ?>" class="step"> | 35 | <div id="step_content_<?php echo $step_name; ?>" class="step"> |
| 36 | <?php if(!$alreadyUninstalled) { ?> | 36 | <?php if(!$alreadyUninstalled) { ?> |
| 37 | - | 37 | + |
| 38 | <?php } else { ?> | 38 | <?php } else { ?> |
| 39 | All services are uninstalled. | 39 | All services are uninstalled. |
| 40 | <?php } ?> | 40 | <?php } ?> |
| @@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
| 48 | $display = 'none'; | 48 | $display = 'none'; |
| 49 | } | 49 | } |
| 50 | ?> | 50 | ?> |
| 51 | - <div id="option6" class="onclick" onclick="javascript:{w.toggleClass('service_details', 'option6');}"><?php echo $details; ?></div> | 51 | + <div id="option6" class="onclick notop" onclick="javascript:{w.toggleClass('service_details', 'option6');}"><?php echo $details; ?></div> |
| 52 | <div class="service_details" style="display:<?php echo $display; ?>"> | 52 | <div class="service_details" style="display:<?php echo $display; ?>"> |
| 53 | <?php } ?> | 53 | <?php } ?> |
| 54 | <table> | 54 | <table> |
setup/wizard/installUtil.php
| @@ -939,7 +939,7 @@ class InstallUtil { | @@ -939,7 +939,7 @@ class InstallUtil { | ||
| 939 | } | 939 | } |
| 940 | return join(" ", $aSafeArgs); | 940 | return join(" ", $aSafeArgs); |
| 941 | } | 941 | } |
| 942 | - | 942 | + |
| 943 | /** | 943 | /** |
| 944 | * The system identifier is a unique ID defined in every installation of KnowledgeTree | 944 | * The system identifier is a unique ID defined in every installation of KnowledgeTree |
| 945 | * | 945 | * |
| @@ -948,14 +948,14 @@ class InstallUtil { | @@ -948,14 +948,14 @@ class InstallUtil { | ||
| 948 | function getSystemIdentifier($db = true) | 948 | function getSystemIdentifier($db = true) |
| 949 | { | 949 | { |
| 950 | $sIdentifier = null; | 950 | $sIdentifier = null; |
| 951 | - | 951 | + |
| 952 | if ($db) { | 952 | if ($db) { |
| 953 | $sIdentifier = $this->getSystemSetting('kt_system_identifier'); | 953 | $sIdentifier = $this->getSystemSetting('kt_system_identifier'); |
| 954 | } | 954 | } |
| 955 | - | 955 | + |
| 956 | if (empty($sIdentifier)) { | 956 | if (empty($sIdentifier)) { |
| 957 | // if we have one from the session, simply return that one | 957 | // if we have one from the session, simply return that one |
| 958 | - if (isset($_SESSION['installers']['registration']['installation_guid']) | 958 | + if (isset($_SESSION['installers']['registration']['installation_guid']) |
| 959 | && !empty($_SESSION['installers']['registration']['installation_guid'])) { | 959 | && !empty($_SESSION['installers']['registration']['installation_guid'])) { |
| 960 | $sIdentifier = $_SESSION['installers']['registration']['installation_guid']; | 960 | $sIdentifier = $_SESSION['installers']['registration']['installation_guid']; |
| 961 | } | 961 | } |
| @@ -968,7 +968,7 @@ class InstallUtil { | @@ -968,7 +968,7 @@ class InstallUtil { | ||
| 968 | } | 968 | } |
| 969 | return $sIdentifier; | 969 | return $sIdentifier; |
| 970 | } | 970 | } |
| 971 | - | 971 | + |
| 972 | function setSystemSetting($name, $value) | 972 | function setSystemSetting($name, $value) |
| 973 | { | 973 | { |
| 974 | // we either need to insert or update: | 974 | // we either need to insert or update: |
| @@ -982,14 +982,14 @@ class InstallUtil { | @@ -982,14 +982,14 @@ class InstallUtil { | ||
| 982 | // update | 982 | // update |
| 983 | $query = 'UPDATE ' . $sTable . ' SET value = "' . $value . '" WHERE name = "' . $name . '"'; | 983 | $query = 'UPDATE ' . $sTable . ' SET value = "' . $value . '" WHERE name = "' . $name . '"'; |
| 984 | } | 984 | } |
| 985 | - | 985 | + |
| 986 | $res = $this->dbUtilities->query($query); | 986 | $res = $this->dbUtilities->query($query); |
| 987 | $errors = $this->dbUtilities->getErrors(); | 987 | $errors = $this->dbUtilities->getErrors(); |
| 988 | if (count($errors)) { return false; } | 988 | if (count($errors)) { return false; } |
| 989 | - | 989 | + |
| 990 | return true; | 990 | return true; |
| 991 | } | 991 | } |
| 992 | - | 992 | + |
| 993 | function getSystemSetting($name, $default = null) | 993 | function getSystemSetting($name, $default = null) |
| 994 | { | 994 | { |
| 995 | // XXX make this use a cache layer? | 995 | // XXX make this use a cache layer? |
| @@ -1009,7 +1009,7 @@ class InstallUtil { | @@ -1009,7 +1009,7 @@ class InstallUtil { | ||
| 1009 | 1009 | ||
| 1010 | return $result[$name]; | 1010 | return $result[$name]; |
| 1011 | } | 1011 | } |
| 1012 | - | 1012 | + |
| 1013 | // {{{ getTableName | 1013 | // {{{ getTableName |
| 1014 | /** | 1014 | /** |
| 1015 | * The one true way to get the correct name for a table whilst | 1015 | * The one true way to get the correct name for a table whilst |
| @@ -1024,7 +1024,7 @@ class InstallUtil { | @@ -1024,7 +1024,7 @@ class InstallUtil { | ||
| 1024 | return $sTable; | 1024 | return $sTable; |
| 1025 | } | 1025 | } |
| 1026 | // }}} | 1026 | // }}} |
| 1027 | - | 1027 | + |
| 1028 | /* | 1028 | /* |
| 1029 | Just Because. | 1029 | Just Because. |
| 1030 | */ | 1030 | */ |
setup/wizard/resources/css/migrate.css