diff --git a/include/class.setup.php b/include/class.setup.php index f281da61b59a910063af511bcb2a0d0ff9da7cf7..cc13fe2f5e60b273f4aff26dbcb754aebfd917c0 100644 --- a/include/class.setup.php +++ b/include/class.setup.php @@ -93,6 +93,10 @@ Class SetupWizard { return (extension_loaded('mysqli')); } + function check_mysql_version() { + return (version_compare(db_version(), $this->getMySQLVersion())>=0); + } + function check_prereq() { return ($this->check_php() && $this->check_mysql()); } diff --git a/include/class.upgrader.php b/include/class.upgrader.php index 69af4dfde6ee3f1b96b583ac3d00abcf07ff8562..c08ff6c43cbbd4e9e347efc27108873d1695e0c5 100644 --- a/include/class.upgrader.php +++ b/include/class.upgrader.php @@ -103,20 +103,16 @@ class Upgrader { return $this->getCurrentStream()->upgrade(); } - function check_prereq() { - if ($this->getCurrentStream()) - return $this->getCurrentStream()->check_prereq(); - } - function check_php() { - if ($this->getCurrentStream()) - return $this->getCurrentStream()->check_php(); - } - function check_mysql() { - if ($this->getCurrentStream()) - return $this->getCurrentStream()->check_mysql(); + function __call($what, $args) { + if ($this->getCurrentStream()) { + $callable = array($this->getCurrentStream(), $what); + if (!is_callable($callable)) + throw new Exception('InternalError: Upgrader method not callable: ' + . $what); + return call_user_func_array($callable, $args); + } } - function getTask() { if($this->getCurrentStream()) return $this->getCurrentStream()->getTask(); @@ -213,6 +209,9 @@ class StreamUpgrader extends SetupWizard { $this->migrater = null; } + function check_prereq() { + return (parent::check_prereq() && $this->check_mysql_version()); + } function onError($error) { global $ost, $thisstaff; diff --git a/include/upgrader/prereq.inc.php b/include/upgrader/prereq.inc.php index ac2b0b2febf2d454604d5f03476ea9b83c6bbb11..98665cbc9dece47058ff2526164cb2cf4634fa3b 100644 --- a/include/upgrader/prereq.inc.php +++ b/include/upgrader/prereq.inc.php @@ -17,7 +17,9 @@ if(!defined('OSTSCPINC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access D <li class="<?php echo $upgrader->check_php()?'yes':'no'; ?>"> PHP v5.3 or greater - (<small><b><?php echo PHP_VERSION; ?></b></small>)</li> <li class="<?php echo $upgrader->check_mysql()?'yes':'no'; ?>"> - MySQL v5.0 or greater - (<small><b><?php echo extension_loaded('mysql')?'module loaded':'missing!'; ?></b></small>)</li> + MySQLi extension for PHP - (<small><b><?php echo extension_loaded('mysqli')?'module loaded':'missing!'; ?></b></small>)</li> + <li class="<?php echo $upgrader->check_mysql_version()?'yes':'no'; ?>"> + MySQL v5.0 or greater - (<small><b><?php echo db_version(); ?></b></small>)</li> </ul> <h3>Highly Recommended:</h3> We highly recommend that you follow the steps below. diff --git a/setup/inc/install-prereq.inc.php b/setup/inc/install-prereq.inc.php index 37579a32a1ac976e0800511612f29029e1f23be3..90e0f176ac0f0cb138b136a2e76ff16427f73898 100644 --- a/setup/inc/install-prereq.inc.php +++ b/setup/inc/install-prereq.inc.php @@ -17,7 +17,7 @@ if(!defined('SETUPINC')) die('Kwaheri!'); <li class="<?php echo $installer->check_php()?'yes':'no'; ?>"> PHP v5.3 or greater - (<small><b><?php echo PHP_VERSION; ?></b></small>)</li> <li class="<?php echo $installer->check_mysql()?'yes':'no'; ?>"> - MySQL v5.0 or greater - (<small><b><?php echo extension_loaded('mysql')?'module loaded':'missing!'; ?></b></small>)</li> + MySQLi extension for PHP - (<small><b><?php echo extension_loaded('mysqli')?'module loaded':'missing!'; ?></b></small>)</li> </ul> <h3>Recommended:</h3> You can use osTicket without these, but you may not be able to use all features.