aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorDhruv Goel <dhruv.goel92@gmail.com>2012-06-16 03:05:40 +0530
committerDhruv Goel <dhruv.goel92@gmail.com>2012-07-05 21:17:20 +0530
commitebc4c20199f22071f2dcc3489f94422658d27ac2 (patch)
treef4fdb068a70a9624deab4550e7ded7c24cb71bd8 /phpBB/includes
parent8ba510a99df3b26333367347a7c2c22664ae400f (diff)
downloadforums-ebc4c20199f22071f2dcc3489f94422658d27ac2.tar
forums-ebc4c20199f22071f2dcc3489f94422658d27ac2.tar.gz
forums-ebc4c20199f22071f2dcc3489f94422658d27ac2.tar.bz2
forums-ebc4c20199f22071f2dcc3489f94422658d27ac2.tar.xz
forums-ebc4c20199f22071f2dcc3489f94422658d27ac2.zip
[feature/postgresql-fulltext-search] use version_compare
version_compare is used for version comparision and pgsql version is now a global variable that is displayed in the acp too. PHPBB3-9730
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/search/fulltext_postgres.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php
index 1595a38916..279706449a 100644
--- a/phpBB/includes/search/fulltext_postgres.php
+++ b/phpBB/includes/search/fulltext_postgres.php
@@ -29,6 +29,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
var $tsearch_query;
var $common_words = array();
var $tsearch_usable = false;
+ var $version;
public function __construct(&$error)
{
@@ -39,8 +40,9 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
if ($db->sql_layer == 'postgres')
{
- $pgsql_version = explode('.', substr($db->sql_server_info(), 10));
- if ($pgsql_version[0] >= 9 || $pgsql_version[0] == 8 && $pgsql_version[1] >= 3)
+ $pgsql_version = explode(',', substr($db->sql_server_info(), 10));
+ $this->version = trim($pgsql_version[0]);
+ if(version_compare($this->version, '8.3', '>='))
{
$this->tsearch_usable = true;
}
@@ -778,12 +780,10 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
{
global $user, $config, $db;
- $pgsql_version = explode(',', substr($db->sql_server_info(), 10));
-
$tpl = '
<dl>
<dt><label>' . $user->lang['FULLTEXT_POSTGRES_VERSION_CHECK'] . '</label><br /><span>' . $user->lang['FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN'] . '</span></dt>
- <dd>' . (($this->tsearch_usable) ? $user->lang['YES'] : $user->lang['NO']) . ' (PostgreSQL ' . $pgsql_version[0] . ')</dd>
+ <dd>' . (($this->tsearch_usable) ? $user->lang['YES'] : $user->lang['NO']) . ' (PostgreSQL ' . $this->version . ')</dd>
</dl>
<dl>
<dt><label>' . $user->lang['FULLTEXT_POSTGRES_TS_NAME'] . '</label><br /><span>' . $user->lang['FULLTEXT_POSTGRES_TS_NAME_EXPLAIN'] . '</span></dt>