1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-21 10:40:58 +02:00

- PostgreSQL can now use schemas. During install, under database name, enter databasename.schema

- phpversion() to PHP_VERSION


git-svn-id: file:///svn/phpbb/trunk@7255 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M
2007-04-01 12:39:34 +00:00
parent 060a00a824
commit e7fcb3625e
5 changed files with 22 additions and 7 deletions

View File

@ -950,7 +950,7 @@ class sqlite_extractor extends base_extractor
if (is_null($proper))
{
$proper = version_compare(phpversion(), '5.1.3', '>=');
$proper = version_compare(PHP_VERSION, '5.1.3', '>=');
}
if ($proper)

View File

@ -62,9 +62,15 @@ class dbal_postgres extends dbal
}
}
$schema = '';
if ($database)
{
$this->dbname = $database;
if (strpos($database, '.') !== false)
{
list($database, $schema) = explode('.', $database);
}
$connect_string .= "dbname=$database";
}
@ -72,7 +78,16 @@ class dbal_postgres extends dbal
$this->db_connect_id = ($this->persistency) ? @pg_pconnect($connect_string, $new_link) : @pg_connect($connect_string, $new_link);
return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
if ($this->db_connect_id)
{
if ($schema !== '')
{
@pg_query($this->db_connect_id, 'SET search_path TO ' . $schema);
}
return $this->db_connect_id;
}
return $this->sql_error('');
}
/**
@ -80,7 +95,7 @@ class dbal_postgres extends dbal
*/
function sql_server_info()
{
if (version_compare(phpversion(), '5.0.0', '>='))
if (version_compare(PHP_VERSION, '5.0.0', '>='))
{
$version = @pg_version($this->db_connect_id);
return 'PostgreSQL' . ((!empty($version)) ? ' ' . $version['client'] : '');

View File

@ -116,7 +116,7 @@ if (extension_loaded('mbstring'))
* Notes:
* - offset for mb_strrpos was added in 5.2.0, we emulate if it is lower
*/
if (version_compare(phpversion(), '5.2.0', '>='))
if (version_compare(PHP_VERSION, '5.2.0', '>='))
{
/**
* UTF-8 aware alternative to strrpos

View File

@ -22,7 +22,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
error_reporting(E_ALL ^ E_NOTICE);
// @todo Review this test and see if we can find out what it is which prevents PHP 4.2.x from even displaying the page with requirements on it
if (version_compare(phpversion(), '4.3.3') < 0)
if (version_compare(PHP_VERSION, '4.3.3') < 0)
{
die('You are running an unsupported PHP version. Please upgrade to PHP 4.3.3 or higher before trying to install phpBB 3.0');
}
@ -82,7 +82,7 @@ function deregister_globals()
}
// If we are on PHP >= 6.0.0 we do not need some code
if (version_compare(phpversion(), '6.0.0-dev', '>='))
if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
{
/**
* @ignore

View File

@ -138,7 +138,7 @@ class install_install extends module
));
// Test the minimum PHP version
$php_version = phpversion();
$php_version = PHP_VERSION;
if (version_compare($php_version, '4.3.3') < 0)
{