Added upgrader & changed version
Upgrades the install to include a protocol field. Defined the upgrade version as 3.5.0pull/834/head
parent
1bd8e821f0
commit
d0680834fd
|
@ -30,7 +30,7 @@
|
||||||
/**
|
/**
|
||||||
* Current PSM version
|
* 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.
|
* URL to check for updates. Will not be checked if turned off on config page.
|
||||||
|
|
|
@ -342,6 +342,9 @@ class Installer
|
||||||
if (version_compare($version_from, '3.4.2', '<')) {
|
if (version_compare($version_from, '3.4.2', '<')) {
|
||||||
$this->upgrade342();
|
$this->upgrade342();
|
||||||
}
|
}
|
||||||
|
if (version_compare($version_from, '3.5.0', '<')) {
|
||||||
|
$this->upgrade350();
|
||||||
|
}
|
||||||
psm_update_conf('version', $version_to);
|
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;";
|
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers` CHANGE `last_output` `last_output` TEXT;";
|
||||||
$this->execSQL($queries);
|
$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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,7 +222,13 @@ class StatusUpdater
|
||||||
// save response time
|
// save response time
|
||||||
$starttime = microtime(true);
|
$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;
|
$status = ($fp === false) ? false : true;
|
||||||
$this->rtime = (microtime(true) - $starttime);
|
$this->rtime = (microtime(true) - $starttime);
|
||||||
|
|
Loading…
Reference in New Issue