1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 04:04:12 +02:00

Merge pull request #5440 from rubencm/ticket/15540

[ticket/15540] Refactor search backend classes to Symfony services
This commit is contained in:
Marc Alexander
2021-03-24 09:58:52 +01:00
committed by GitHub
44 changed files with 2065 additions and 2125 deletions

View File

@@ -0,0 +1,51 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\migration\data\v400;
use phpbb\search\backend\fulltext_mysql;
use phpbb\search\backend\fulltext_postgres;
use phpbb\search\backend\fulltext_sphinx;
use phpbb\search\backend\fulltext_native;
class search_backend_update extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return [
'\phpbb\db\migration\data\v400\dev',
];
}
public function update_data()
{
switch ($this->config['search_type'])
{
case '\\phpbb\\search\\fulltext_mysql':
$new_search_type = fulltext_mysql::class;
break;
case '\\phpbb\\search\\fulltext_postgres':
$new_search_type = fulltext_postgres::class;
break;
case '\\phpbb\\search\\fulltext_sphinx':
$new_search_type = fulltext_sphinx::class;
break;
default:
$new_search_type = fulltext_native::class;
}
return [
['config.update', ['search_type', $new_search_type]],
];
}
}