diff --git a/src/includes/psmconfig.inc.php b/src/includes/psmconfig.inc.php index 530753c8..37d50d96 100644 --- a/src/includes/psmconfig.inc.php +++ b/src/includes/psmconfig.inc.php @@ -30,7 +30,7 @@ /** * Current PSM version */ -define('PSM_VERSION', '3.4.5'); +define('PSM_VERSION', '3.5.0'); /** * URL to check for updates. Will not be checked if turned off on config page. diff --git a/src/psm/Util/Install/Installer.php b/src/psm/Util/Install/Installer.php index 6ba3585c..e9cef7fb 100644 --- a/src/psm/Util/Install/Installer.php +++ b/src/psm/Util/Install/Installer.php @@ -342,6 +342,9 @@ class Installer if (version_compare($version_from, '3.4.2', '<')) { $this->upgrade342(); } + if (version_compare($version_from, '3.5.0', '<')) { + $this->upgrade350(); + } psm_update_conf('version', $version_to); } @@ -656,4 +659,20 @@ class Installer $queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers` CHANGE `last_output` `last_output` TEXT;"; $this->execSQL($queries); } + + /** + * Upgrade for v3.5.0 release + */ + protected function upgrade350() + { + /** + * Adds a protocol column which defaults to TCP + * This sets the field to TCP on older installations + * ensuring they do not break + */ + $queries = array(); + $queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers` ADD COLUMN `protocol` ENUM( 'tcp','udp' ) + NOT NULL DEFAULT 'tcp' AFTER `port`;"; + $this->execSQL($queries); + } } diff --git a/src/psm/Util/Server/Updater/StatusUpdater.php b/src/psm/Util/Server/Updater/StatusUpdater.php index e6853d08..dd700332 100644 --- a/src/psm/Util/Server/Updater/StatusUpdater.php +++ b/src/psm/Util/Server/Updater/StatusUpdater.php @@ -222,7 +222,13 @@ class StatusUpdater // save response time $starttime = microtime(true); - $fp = @fsockopen($this->server['protocol'] . '://' . $this->server['ip'], $this->server['port'], $errno, $this->error, $timeout); + $fp = @fsockopen( + $this->server['protocol'] . '://' . $this->server['ip'], + $this->server['port'], + $errno, + $this->error, + $timeout + ); $status = ($fp === false) ? false : true; $this->rtime = (microtime(true) - $starttime);