mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/15540] Display only available search backends
PHPBB3-15540
This commit is contained in:
@@ -56,7 +56,7 @@ class fulltext_postgres extends base implements search_backend_interface
|
||||
|
||||
/**
|
||||
* Database connection
|
||||
* @var \phpbb\db\driver\driver_interface
|
||||
* @var driver_interface
|
||||
*/
|
||||
protected $db;
|
||||
|
||||
@@ -129,6 +129,14 @@ class fulltext_postgres extends base implements search_backend_interface
|
||||
return 'PostgreSQL Fulltext';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function is_available(): bool
|
||||
{
|
||||
return $this->db->get_sql_layer() == 'postgres';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -170,7 +178,7 @@ class fulltext_postgres extends base implements search_backend_interface
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
if ($this->db->get_sql_layer() != 'postgres')
|
||||
if (!$this->is_available())
|
||||
{
|
||||
return $this->user->lang['FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE'];
|
||||
}
|
||||
@@ -1047,7 +1055,7 @@ class fulltext_postgres extends base implements search_backend_interface
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes the stats and store them in the $this->stats associative array
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function get_stats()
|
||||
{
|
||||
|
Reference in New Issue
Block a user