Commit 4218665a3bc9f5ba2f768fb6d5dd5302e47cc0c2

Authored by Paul Barrett
2 parents 52aa4d9c e20c84f5

Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge

Showing 1 changed file with 59 additions and 15 deletions
setup/wizard/installUtil.php
... ... @@ -66,21 +66,6 @@ class InstallUtil {
66 66 return false;
67 67 }
68 68  
69   - /**
70   - * Check if system needs to be migrated
71   - *
72   - * @author KnowledgeTree Team
73   - * @access public
74   - * @param none
75   - * @return boolean
76   - */
77   - public function isMigration() {
78   - if (isset($_POST['Migrate'])) {
79   - return true;
80   - }
81   - return false;
82   - }
83   -
84 69 public function error($error) {
85 70 $template_vars['error'] = $error;
86 71 $file = "templates/error.tpl";
... ... @@ -518,6 +503,42 @@ class InstallUtil {
518 503 }
519 504  
520 505 /**
  506 + * Check if system needs to be migrated
  507 + *
  508 + * @author KnowledgeTree Team
  509 + * @access public
  510 + * @param none
  511 + * @return boolean
  512 + */
  513 + public function migrationSpecified() {
  514 + if(isset($_POST['installtype'])) {
  515 + if($_POST['installtype'] == "Upgrade Installation") {
  516 + return true;
  517 + }
  518 + }
  519 +
  520 + return false;
  521 + }
  522 +
  523 + /**
  524 + * Check if system needs to be migrated
  525 + *
  526 + * @author KnowledgeTree Team
  527 + * @access public
  528 + * @param none
  529 + * @return boolean
  530 + */
  531 + public function upgradeSpecified() {
  532 + if(isset($_POST['installtype'])) {
  533 + if($_POST['installtype'] == "Upgrade Only") {
  534 + return true;
  535 + }
  536 + }
  537 +
  538 + return false;
  539 + }
  540 +
  541 + /**
521 542 * Get session data from package
522 543 *
523 544 * @author KnowledgeTree Team
... ... @@ -644,7 +665,30 @@ class InstallUtil {
644 665 return '';
645 666 }
646 667  
  668 + /**
  669 + * Deletes migration lock file if a clean install is chosen
  670 + * This is in case someone changes their mind after choosing upgrade/migrate and clicks back up to this step
  671 + *
  672 + * @author KnowledgeTree Team
  673 + * @access private
  674 + * @return void
  675 + */
  676 + function deleteMigrateFile() {
  677 + if(file_exists("migrate.lock"))
  678 + @unlink("migrate.lock");
  679 + }
647 680  
  681 + /**
  682 + * Check if we are migrating an existing installation
  683 + *
  684 + * @return unknown
  685 + */
  686 + function isMigration() {
  687 + if(file_exists("migrate.lock"))
  688 + return true;
  689 + return false;
  690 + }
  691 +
648 692 /**
649 693 * Portably execute a command on any of the supported platforms.
650 694 *
... ...