diff options
author | David M <davidmj@users.sourceforge.net> | 2007-04-01 12:39:34 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2007-04-01 12:39:34 +0000 |
commit | e7fcb3625ed5763c50861a64e3a00ee6f86f41e5 (patch) | |
tree | 89749d327eb9f17f93fb026d03bcd0e612e57d29 | |
parent | 060a00a8244f59b6169a0252206f07ee8c03c7ae (diff) | |
download | forums-e7fcb3625ed5763c50861a64e3a00ee6f86f41e5.tar forums-e7fcb3625ed5763c50861a64e3a00ee6f86f41e5.tar.gz forums-e7fcb3625ed5763c50861a64e3a00ee6f86f41e5.tar.bz2 forums-e7fcb3625ed5763c50861a64e3a00ee6f86f41e5.tar.xz forums-e7fcb3625ed5763c50861a64e3a00ee6f86f41e5.zip |
- 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
-rw-r--r-- | phpBB/includes/acp/acp_database.php | 2 | ||||
-rw-r--r-- | phpBB/includes/db/postgres.php | 19 | ||||
-rw-r--r-- | phpBB/includes/utf/utf_tools.php | 2 | ||||
-rwxr-xr-x | phpBB/install/index.php | 4 | ||||
-rwxr-xr-x | phpBB/install/install_install.php | 2 |
5 files changed, 22 insertions, 7 deletions
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 9361b00f5b..56235d8e88 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -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) diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index 3f0c97ce00..bdaab439ea 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -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'] : ''); diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index 4f1cfcb5b5..1b715014bd 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -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 diff --git a/phpBB/install/index.php b/phpBB/install/index.php index e721e90bf6..26f8008f4c 100755 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -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 diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index eeb0bd8491..06c360d20c 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -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) { |