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 |
release_3_0_9_rc1.php
001 <?php
002 /**
003 *
004 * This file is part of the phpBB Forum Software package.
005 *
006 * @copyright (c) phpBB Limited <https://www.phpbb.com>
007 * @license GNU General Public License, version 2 (GPL-2.0)
008 *
009 * For full copyright and license information, please see
010 * the docs/CREDITS.txt file.
011 *
012 */
013
014 namespace phpbb\db\migration\data\v30x;
015
016 class release_3_0_9_rc1 extends \phpbb\db\migration\migration
017 {
018 public function effectively_installed()
019 {
020 return phpbb_version_compare($this->config['version'], '3.0.9-RC1', '>=');
021 }
022
023 static public function depends_on()
024 {
025 return array('\phpbb\db\migration\data\v30x\release_3_0_8');
026 }
027
028 public function update_schema()
029 {
030 return array(
031 'add_tables' => array(
032 $this->table_prefix . 'login_attempts' => array(
033 'COLUMNS' => array(
034 // this column was removed from the database updater
035 // after 3.0.9-RC3 was released. It might still exist
036 // in 3.0.9-RCX installations and has to be dropped as
037 // soon as the \phpbb\db\tools\tools class is capable of properly
038 // removing a primary key.
039 // 'attempt_id' => array('UINT', NULL, 'auto_increment'),
040 'attempt_ip' => array('VCHAR:40', ''),
041 'attempt_browser' => array('VCHAR:150', ''),
042 'attempt_forwarded_for' => array('VCHAR:255', ''),
043 'attempt_time' => array('TIMESTAMP', 0),
044 'user_id' => array('UINT', 0),
045 'username' => array('VCHAR_UNI:255', 0),
046 'username_clean' => array('VCHAR_CI', 0),
047 ),
048 //'PRIMARY_KEY' => 'attempt_id',
049 'KEYS' => array(
050 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')),
051 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')),
052 'att_time' => array('INDEX', array('attempt_time')),
053 'user_id' => array('INDEX', 'user_id'),
054 ),
055 ),
056 ),
057 'change_columns' => array(
058 $this->table_prefix . 'bbcodes' => array(
059 'bbcode_id' => array('USINT', 0),
060 ),
061 ),
062 );
063 }
064
065 public function revert_schema()
066 {
067 return array(
068 'drop_tables' => array(
069 $this->table_prefix . 'login_attempts',
070 ),
071 );
072 }
073
074 public function update_data()
075 {
076 return array(
077 array('config.add', array('ip_login_limit_max', 50)),
078 array('config.add', array('ip_login_limit_time', 21600)),
079 array('config.add', array('ip_login_limit_use_forwarded', 0)),
080 array('custom', array(array(&$this, 'update_file_extension_group_names'))),
081 array('custom', array(array(&$this, 'fix_firebird_qa_captcha'))),
082
083 array('config.update', array('version', '3.0.9-RC1')),
084 );
085 }
086
087 public function update_file_extension_group_names()
088 {
089 // Update file extension group names to use language strings, again.
090 $sql = 'SELECT group_id, group_name
091 FROM ' . EXTENSION_GROUPS_TABLE . '
092 WHERE group_name ' . $this->db->sql_like_expression('EXT_GROUP_' . $this->db->get_any_char());
093 $result = $this->db->sql_query($sql);
094
095 while ($row = $this->db->sql_fetchrow($result))
096 {
097 $sql_ary = array(
098 'group_name' => substr($row['group_name'], 10), // Strip off 'EXT_GROUP_'
099 );
100
101 $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
102 SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
103 WHERE group_id = ' . $row['group_id'];
104 $this->sql_query($sql);
105 }
106 $this->db->sql_freeresult($result);
107 }
108
109 public function fix_firebird_qa_captcha()
110 {
111 // Recover from potentially broken Q&A CAPTCHA table on firebird
112 // Q&A CAPTCHA was uninstallable, so it's safe to remove these
113 // without data loss
114 if ($this->db_tools->sql_layer == 'firebird')
115 {
116 $tables = array(
117 $this->table_prefix . 'captcha_questions',
118 $this->table_prefix . 'captcha_answers',
119 $this->table_prefix . 'qa_confirm',
120 );
121 foreach ($tables as $table)
122 {
123 if ($this->db_tools->sql_table_exists($table))
124 {
125 $this->db_tools->sql_table_drop($table);
126 }
127 }
128 }
129 }
130 }
131