Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
mysql_fulltext_drop.php
01 <?php
02 /**
03 *
04 * This file is part of the phpBB Forum Software package.
05 *
06 * @copyright (c) phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14 namespace phpbb\db\migration\data\v310;
15
16 class mysql_fulltext_drop extends \phpbb\db\migration\migration
17 {
18 protected $indexes;
19
20 public function effectively_installed()
21 {
22 // This migration is irrelevant for all non-MySQL DBMSes.
23 if (strpos($this->db->get_sql_layer(), 'mysql') === false)
24 {
25 return true;
26 }
27
28 $this->find_indexes_to_drop();
29 return empty($this->indexes);
30 }
31
32 static public function depends_on()
33 {
34 return array(
35 '\phpbb\db\migration\data\v310\dev',
36 );
37 }
38
39 public function update_schema()
40 {
41 if (empty($this->indexes))
42 {
43 return array();
44 }
45
46 /*
47 * Drop FULLTEXT indexes related to MySQL fulltext search.
48 * Doing so is equivalent to dropping the search index from the ACP.
49 * Possibly time-consuming recreation of the search index (i.e.
50 * FULLTEXT indexes) is left as a task to the admin to not
51 * unnecessarily stall the upgrade process. The new search index will
52 * then require about 40% less table space (also see PHPBB3-11621).
53 */
54 return array(
55 'drop_keys' => array(
56 $this->table_prefix . 'posts' => $this->indexes,
57 ),
58 );
59 }
60
61 public function find_indexes_to_drop()
62 {
63 if ($this->indexes !== null)
64 {
65 return $this->indexes;
66 }
67
68 $this->indexes = array();
69 $potential_keys = array('post_subject', 'post_text', 'post_content');
70 foreach ($potential_keys as $key)
71 {
72 if ($this->db_tools->sql_index_exists($this->table_prefix . 'posts', $key))
73 {
74 $this->indexes[] = $key;
75 }
76 }
77
78 return $this->indexes;
79 }
80 }
81