Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
search_backend_update
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 2
42
0.00% covered (danger)
0.00%
0 / 1
 depends_on
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 update_data
0.00% covered (danger)
0.00%
0 / 14
0.00% covered (danger)
0.00%
0 / 1
30
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14namespace phpbb\db\migration\data\v400;
15
16use phpbb\search\backend\fulltext_mysql;
17use phpbb\search\backend\fulltext_postgres;
18use phpbb\search\backend\fulltext_sphinx;
19use phpbb\search\backend\fulltext_native;
20
21class search_backend_update extends \phpbb\db\migration\migration
22{
23    public static function depends_on()
24    {
25        return [
26            '\phpbb\db\migration\data\v400\dev',
27        ];
28    }
29
30    public function update_data()
31    {
32        switch ($this->config['search_type'])
33        {
34            case '\\phpbb\\search\\fulltext_mysql':
35                $new_search_type = fulltext_mysql::class;
36            break;
37            case '\\phpbb\\search\\fulltext_postgres':
38                $new_search_type = fulltext_postgres::class;
39            break;
40            case '\\phpbb\\search\\fulltext_sphinx':
41                $new_search_type = fulltext_sphinx::class;
42            break;
43            default:
44                $new_search_type = fulltext_native::class;
45        }
46
47        return [
48            ['config.update', ['search_type', $new_search_type]],
49        ];
50    }
51}