- 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)) if (is_null($proper))
{ {
$proper = version_compare(phpversion(), '5.1.3', '>='); $proper = version_compare(PHP_VERSION, '5.1.3', '>=');
} }
if ($proper) if ($proper)

View file

@ -62,9 +62,15 @@ class dbal_postgres extends dbal
} }
} }
$schema = '';
if ($database) if ($database)
{ {
$this->dbname = $database; $this->dbname = $database;
if (strpos($database, '.') !== false)
{
list($database, $schema) = explode('.', $database);
}
$connect_string .= "dbname=$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); $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() 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); $version = @pg_version($this->db_connect_id);
return 'PostgreSQL' . ((!empty($version)) ? ' ' . $version['client'] : ''); return 'PostgreSQL' . ((!empty($version)) ? ' ' . $version['client'] : '');

View file

@ -116,7 +116,7 @@ if (extension_loaded('mbstring'))
* Notes: * Notes:
* - offset for mb_strrpos was added in 5.2.0, we emulate if it is lower * - 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 * UTF-8 aware alternative to strrpos

View file

@ -22,7 +22,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
error_reporting(E_ALL ^ E_NOTICE); 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 // @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'); 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 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 * @ignore

View file

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