Skip to content
Snippets Groups Projects
Commit 334461e1 authored by Jared Hancock's avatar Jared Hancock
Browse files

setup: Make mysqli extension requirement clearer

parent d665d394
No related branches found
No related tags found
No related merge requests found
...@@ -93,6 +93,10 @@ Class SetupWizard { ...@@ -93,6 +93,10 @@ Class SetupWizard {
return (extension_loaded('mysqli')); return (extension_loaded('mysqli'));
} }
function check_mysql_version() {
return (version_compare(db_version(), $this->getMySQLVersion())>=0);
}
function check_prereq() { function check_prereq() {
return ($this->check_php() && $this->check_mysql()); return ($this->check_php() && $this->check_mysql());
} }
......
...@@ -103,20 +103,16 @@ class Upgrader { ...@@ -103,20 +103,16 @@ class Upgrader {
return $this->getCurrentStream()->upgrade(); return $this->getCurrentStream()->upgrade();
} }
function check_prereq() { function __call($what, $args) {
if ($this->getCurrentStream()) if ($this->getCurrentStream()) {
return $this->getCurrentStream()->check_prereq(); $callable = array($this->getCurrentStream(), $what);
} if (!is_callable($callable))
function check_php() { throw new Exception('InternalError: Upgrader method not callable: '
if ($this->getCurrentStream()) . $what);
return $this->getCurrentStream()->check_php(); return call_user_func_array($callable, $args);
} }
function check_mysql() {
if ($this->getCurrentStream())
return $this->getCurrentStream()->check_mysql();
} }
function getTask() { function getTask() {
if($this->getCurrentStream()) if($this->getCurrentStream())
return $this->getCurrentStream()->getTask(); return $this->getCurrentStream()->getTask();
...@@ -213,6 +209,9 @@ class StreamUpgrader extends SetupWizard { ...@@ -213,6 +209,9 @@ class StreamUpgrader extends SetupWizard {
$this->migrater = null; $this->migrater = null;
} }
function check_prereq() {
return (parent::check_prereq() && $this->check_mysql_version());
}
function onError($error) { function onError($error) {
global $ost, $thisstaff; global $ost, $thisstaff;
......
...@@ -17,7 +17,9 @@ if(!defined('OSTSCPINC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access D ...@@ -17,7 +17,9 @@ if(!defined('OSTSCPINC') || !$thisstaff || !$thisstaff->isAdmin()) die('Access D
<li class="<?php echo $upgrader->check_php()?'yes':'no'; ?>"> <li class="<?php echo $upgrader->check_php()?'yes':'no'; ?>">
PHP v5.3 or greater - (<small><b><?php echo PHP_VERSION; ?></b></small>)</li> PHP v5.3 or greater - (<small><b><?php echo PHP_VERSION; ?></b></small>)</li>
<li class="<?php echo $upgrader->check_mysql()?'yes':'no'; ?>"> <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> </ul>
<h3>Highly Recommended:</h3> <h3>Highly Recommended:</h3>
We highly recommend that you follow the steps below. We highly recommend that you follow the steps below.
......
...@@ -17,7 +17,7 @@ if(!defined('SETUPINC')) die('Kwaheri!'); ...@@ -17,7 +17,7 @@ if(!defined('SETUPINC')) die('Kwaheri!');
<li class="<?php echo $installer->check_php()?'yes':'no'; ?>"> <li class="<?php echo $installer->check_php()?'yes':'no'; ?>">
PHP v5.3 or greater - (<small><b><?php echo PHP_VERSION; ?></b></small>)</li> PHP v5.3 or greater - (<small><b><?php echo PHP_VERSION; ?></b></small>)</li>
<li class="<?php echo $installer->check_mysql()?'yes':'no'; ?>"> <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> </ul>
<h3>Recommended:</h3> <h3>Recommended:</h3>
You can use osTicket without these, but you may not be able to use all features. You can use osTicket without these, but you may not be able to use all features.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment