check versions

This commit is contained in:
Brian Quinion 2013-03-06 13:31:39 +00:00
parent 9320dbfd4b
commit f397e29ae5

View File

@ -62,7 +62,6 @@
}
}
// This is a pretty hard core default - the number of processors in the box - 1
$iInstances = isset($aCMDResult['threads'])?$aCMDResult['threads']:(getProcessorCount()-1);
if ($iInstances < 1)
@ -106,6 +105,15 @@
// TODO: path detection, detection memory, etc.
$oDB =& getDB();
$sVersionString = $oDB->getOne('select version()');
preg_match('#PostgreSQL ([0-9]+)[.]([0-9]+)[.]([0-9]+) #', $sVersionString, $aMatches);
if (((float)($aMatches[1].'.'.$aMatches[2])) > 9.1)
{
echo "ERROR: PostgreSQL versions > 9.1 not supported. Please use the latest development version from github.\n";
exit;
}
passthru('createlang plpgsql '.$aDSNInfo['database']);
$pgver = (float) CONST_Postgresql_Version;
if ($pgver < 9.1) {
@ -115,6 +123,15 @@
}
pgsqlRunScriptFile(CONST_Path_Postgresql_Postgis.'/postgis.sql');
pgsqlRunScriptFile(CONST_Path_Postgresql_Postgis.'/spatial_ref_sys.sql');
$sVersionString = $oDB->getOne('select postgis_full_version()');
preg_match('#POSTGIS="([0-9]+)[.]([0-9]+)[.]([0-9]+)( r([0-9]+))?"#', $sVersionString, $aMatches);
if (((float)($aMatches[1].'.'.$aMatches[2])) >= 2.0)
{
echo "ERROR: PostGIS version >= 2 is not supported. Please use the latest development version from github.\n";
exit;
}
pgsqlRunScriptFile(CONST_BasePath.'/data/country_name.sql');
pgsqlRunScriptFile(CONST_BasePath.'/data/country_naturalearthdata.sql');
pgsqlRunScriptFile(CONST_BasePath.'/data/country_osm_grid.sql');