PDF rausgenommen

This commit is contained in:
aschwarz
2023-01-23 11:03:31 +01:00
parent 82d562a322
commit a6523903eb
28078 changed files with 4247552 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
# module mod_authz_host to a new module called mod_access_compat (which may be
# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
# We could just conditionally provide both versions, but unfortunately Apache
# does not explicitly tell us its version if the module mod_version is not
# available. In this case, we check for the availability of module
# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
<IfModule mod_version.c>
<IfVersion < 2.4>
<Files "*">
Order Allow,Deny
Deny from All
</Files>
</IfVersion>
<IfVersion >= 2.4>
<Files "*">
Require all denied
</Files>
</IfVersion>
</IfModule>
<IfModule !mod_version.c>
<IfModule !mod_authz_core.c>
<Files "*">
Order Allow,Deny
Deny from All
</Files>
</IfModule>
<IfModule mod_authz_core.c>
<Files "*">
Require all denied
</Files>
</IfModule>
</IfModule>

View File

@@ -0,0 +1,48 @@
<?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\v320;
class add_help_phpbb extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\v320rc1',
);
}
public function effectively_installed()
{
return isset($this->config['help_send_statistics']);
}
public function update_data()
{
return array(
array('config.add', array('help_send_statistics', true)),
array('config.add', array('help_send_statistics_time', 0)),
array('module.remove', array('acp', false, 'ACP_SEND_STATISTICS')),
array('module.add', array(
'acp',
'ACP_SERVER_CONFIGURATION',
array(
'module_basename' => 'acp_help_phpbb',
'module_langname' => 'ACP_HELP_PHPBB',
'module_mode' => 'help_phpbb',
'module_auth' => 'acl_a_server',
),
)),
);
}
}

View File

@@ -0,0 +1,31 @@
<?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\v320;
class allowed_schemes_links extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\dev',
);
}
public function update_data()
{
return array(
array('config.add', array('allowed_schemes_links', 'http,https,ftp')),
);
}
}

View File

@@ -0,0 +1,43 @@
<?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\v320;
class announce_global_permission extends \phpbb\db\migration\migration
{
public function effectively_installed()
{
$sql = 'SELECT auth_option_id
FROM ' . ACL_OPTIONS_TABLE . "
WHERE auth_option = 'f_announce_global'";
$result = $this->db->sql_query($sql);
$auth_option_id = $this->db->sql_fetchfield('auth_option_id');
$this->db->sql_freeresult($result);
return $auth_option_id !== false;
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\dev',
);
}
public function update_data()
{
return array(
array('permission.add', array('f_announce_global', false, 'f_announce')),
);
}
}

View File

@@ -0,0 +1,31 @@
<?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\v320;
class cookie_notice extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\v320rc2',
);
}
public function update_data()
{
return array(
array('config.add', array('cookie_notice', false)),
);
}
}

View File

@@ -0,0 +1,361 @@
<?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\v320;
class default_data_type_ids extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\v320a2',
'\phpbb\db\migration\data\v320\oauth_states',
);
}
public function update_schema()
{
return array(
'change_columns' => array(
$this->table_prefix . 'acl_users' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'attachments' => array(
'attach_id' => array('ULINT', null, 'auto_increment'),
'post_msg_id' => array('ULINT', 0),
'poster_id' => array('ULINT', 0),
'topic_id' => array('ULINT', 0),
),
$this->table_prefix . 'banlist' => array(
'ban_id' => array('ULINT', null, 'auto_increment'),
'ban_userid' => array('ULINT', 0),
),
$this->table_prefix . 'bookmarks' => array(
'topic_id' => array('ULINT', 0),
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'bots' => array(
'bot_id' => array('ULINT', null, 'auto_increment'),
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'drafts' => array(
'draft_id' => array('ULINT', null, 'auto_increment'),
'user_id' => array('ULINT', 0),
'topic_id' => array('ULINT', 0),
),
$this->table_prefix . 'forums' => array(
'forum_last_post_id' => array('ULINT', 0),
'forum_last_poster_id' => array('ULINT', 0),
),
$this->table_prefix . 'forums_access' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'forums_track' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'forums_watch' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'log' => array(
'log_id' => array('ULINT', null, 'auto_increment'),
'post_id' => array('ULINT', 0),
'reportee_id' => array('ULINT', 0),
'user_id' => array('ULINT', 0),
'topic_id' => array('ULINT', 0),
),
$this->table_prefix . 'login_attempts' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'moderator_cache' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'notifications' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'oauth_accounts' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'oauth_states' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'oauth_tokens' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'poll_options' => array(
'topic_id' => array('ULINT', 0),
),
$this->table_prefix . 'poll_votes' => array(
'topic_id' => array('ULINT', 0),
'vote_user_id' => array('ULINT', 0),
),
$this->table_prefix . 'posts' => array(
'post_id' => array('ULINT', null, 'auto_increment'),
'poster_id' => array('ULINT', 0),
'post_delete_user' => array('ULINT', 0),
'post_edit_user' => array('ULINT', 0),
'topic_id' => array('ULINT', 0),
),
$this->table_prefix . 'privmsgs' => array(
'author_id' => array('ULINT', 0),
'message_edit_user' => array('ULINT', 0),
'msg_id' => array('ULINT', null, 'auto_increment'),
),
$this->table_prefix . 'privmsgs_folder' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'privmsgs_rules' => array(
'rule_user_id' => array('ULINT', 0),
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'privmsgs_to' => array(
'author_id' => array('ULINT', 0),
'msg_id' => array('ULINT', 0),
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'profile_fields_data' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'reports' => array(
'report_id' => array('ULINT', 0),
'pm_id' => array('ULINT', 0),
'post_id' => array('ULINT', 0),
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'search_wordlist' => array(
'word_id' => array('ULINT', null, 'auto_increment'),
),
$this->table_prefix . 'search_wordmatch' => array(
'post_id' => array('ULINT', 0),
'word_id' => array('ULINT', 0),
),
$this->table_prefix . 'sessions' => array(
'session_user_id' => array('ULINT', 0),
),
$this->table_prefix . 'sessions_keys' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'topics' => array(
'topic_id' => array('ULINT', null, 'auto_increment'),
'topic_poster' => array('ULINT', 0),
'topic_first_post_id' => array('ULINT', 0),
'topic_last_post_id' => array('ULINT', 0),
'topic_last_poster_id' => array('ULINT', 0),
'topic_moved_id' => array('ULINT', 0),
'topic_delete_user' => array('ULINT', 0),
),
$this->table_prefix . 'topics_track' => array(
'user_id' => array('ULINT', 0),
'topic_id' => array('ULINT', 0),
),
$this->table_prefix . 'topics_posted' => array(
'user_id' => array('ULINT', 0),
'topic_id' => array('ULINT', 0),
),
$this->table_prefix . 'topics_watch' => array(
'user_id' => array('ULINT', 0),
'topic_id' => array('ULINT', 0),
),
$this->table_prefix . 'user_notifications' => array(
'item_id' => array('ULINT', 0),
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'user_group' => array(
'user_id' => array('ULINT', 0),
),
$this->table_prefix . 'users' => array(
'user_id' => array('ULINT', null, 'auto_increment'),
),
$this->table_prefix . 'warnings' => array(
'log_id' => array('ULINT', 0),
'user_id' => array('ULINT', 0),
'post_id' => array('ULINT', 0),
),
$this->table_prefix . 'words' => array(
'word_id' => array('ULINT', null, 'auto_increment'),
),
$this->table_prefix . 'zebra' => array(
'user_id' => array('ULINT', 0),
'zebra_id' => array('ULINT', 0),
),
),
);
}
public function revert_schema()
{
return array(
'change_columns' => array(
$this->table_prefix . 'acl_users' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'attachments' => array(
'attach_id' => array('UINT', null, 'auto_increment'),
'post_msg_id' => array('UINT', 0),
'poster_id' => array('UINT', 0),
'topic_id' => array('UINT', 0),
),
$this->table_prefix . 'banlist' => array(
'ban_id' => array('UINT', null, 'auto_increment'),
'ban_userid' => array('UINT', 0),
),
$this->table_prefix . 'bookmarks' => array(
'topic_id' => array('UINT', 0),
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'bots' => array(
'bot_id' => array('UINT', null, 'auto_increment'),
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'drafts' => array(
'draft_id' => array('UINT', null, 'auto_increment'),
'user_id' => array('UINT', 0),
'topic_id' => array('UINT', 0),
),
$this->table_prefix . 'forums' => array(
'forum_last_post_id' => array('UINT', 0),
'forum_last_poster_id' => array('UINT', 0),
),
$this->table_prefix . 'forums_access' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'forums_track' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'forums_watch' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'log' => array(
'log_id' => array('UINT', null, 'auto_increment'),
'post_id' => array('UINT', 0),
'reportee_id' => array('UINT', 0),
'user_id' => array('UINT', 0),
'topic_id' => array('UINT', 0),
),
$this->table_prefix . 'login_attempts' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'moderator_cache' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'notifications' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'oauth_accounts' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'oauth_states' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'oauth_tokens' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'poll_options' => array(
'topic_id' => array('UINT', 0),
),
$this->table_prefix . 'poll_votes' => array(
'topic_id' => array('UINT', 0),
'vote_user_id' => array('UINT', 0),
),
$this->table_prefix . 'posts' => array(
'post_id' => array('UINT', null, 'auto_increment'),
'poster_id' => array('UINT', 0),
'post_delete_user' => array('UINT', 0),
'post_edit_user' => array('UINT', 0),
'topic_id' => array('UINT', 0),
),
$this->table_prefix . 'privmsgs' => array(
'author_id' => array('UINT', 0),
'message_edit_user' => array('UINT', 0),
'msg_id' => array('UINT', null, 'auto_increment'),
),
$this->table_prefix . 'privmsgs_folder' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'privmsgs_rules' => array(
'rule_user_id' => array('UINT', 0),
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'privmsgs_to' => array(
'author_id' => array('UINT', 0),
'msg_id' => array('UINT', 0),
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'profile_fields_data' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'reports' => array(
'report_id' => array('UINT', 0),
'pm_id' => array('UINT', 0),
'post_id' => array('UINT', 0),
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'search_wordlist' => array(
'word_id' => array('UINT', null, 'auto_increment'),
),
$this->table_prefix . 'search_wordmatch' => array(
'post_id' => array('UINT', 0),
'word_id' => array('UINT', 0),
),
$this->table_prefix . 'sessions' => array(
'session_user_id' => array('UINT', 0),
),
$this->table_prefix . 'sessions_keys' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'topics' => array(
'topic_id' => array('UINT', null, 'auto_increment'),
'topic_poster' => array('UINT', 0),
'topic_first_post_id' => array('UINT', 0),
'topic_last_post_id' => array('UINT', 0),
'topic_last_poster_id' => array('UINT', 0),
'topic_moved_id' => array('UINT', 0),
'topic_delete_user' => array('UINT', 0),
),
$this->table_prefix . 'topics_track' => array(
'user_id' => array('UINT', 0),
'topic_id' => array('UINT', 0),
),
$this->table_prefix . 'topics_posted' => array(
'user_id' => array('UINT', 0),
'topic_id' => array('UINT', 0),
),
$this->table_prefix . 'topics_watch' => array(
'user_id' => array('UINT', 0),
'topic_id' => array('UINT', 0),
),
$this->table_prefix . 'user_notifications' => array(
'item_id' => array('UINT', 0),
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'user_group' => array(
'user_id' => array('UINT', 0),
),
$this->table_prefix . 'users' => array(
'user_id' => array('UINT', null, 'auto_increment'),
),
$this->table_prefix . 'warnings' => array(
'log_id' => array('UINT', 0),
'user_id' => array('UINT', 0),
'post_id' => array('UINT', 0),
),
$this->table_prefix . 'words' => array(
'word_id' => array('UINT', null, 'auto_increment'),
),
$this->table_prefix . 'zebra' => array(
'user_id' => array('UINT', 0),
'zebra_id' => array('UINT', 0),
),
),
);
}
}

View File

@@ -0,0 +1,36 @@
<?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\v320;
class dev extends \phpbb\db\migration\container_aware_migration
{
public function effectively_installed()
{
return version_compare($this->config['version'], '3.2.0-dev', '>=');
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v31x\v316',
);
}
public function update_data()
{
return array(
array('config.update', array('version', '3.2.0-dev')),
);
}
}

View File

@@ -0,0 +1,36 @@
<?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\v320;
class font_awesome_update extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\dev',
);
}
public function effectively_installed()
{
return isset($this->config['load_font_awesome_url']);
}
public function update_data()
{
return array(
array('config.add', array('load_font_awesome_url', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css')),
);
}
}

View File

@@ -0,0 +1,46 @@
<?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\v320;
class icons_alt extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\dev',
);
}
public function update_schema()
{
return array(
'add_columns' => array(
$this->table_prefix . 'icons' => array(
'icons_alt' => array('VCHAR', '', 'after' => 'icons_height'),
),
),
);
}
public function revert_schema()
{
return array(
'drop_columns' => array(
$this->table_prefix . 'icons' => array(
'icons_alt',
),
),
);
}
}

View File

@@ -0,0 +1,46 @@
<?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\v320;
class log_post_id extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\dev',
);
}
public function update_schema()
{
return array(
'add_columns' => array(
$this->table_prefix . 'log' => array(
'post_id' => array('UINT', 0, 'after' => 'topic_id'),
),
),
);
}
public function revert_schema()
{
return array(
'drop_columns' => array(
$this->table_prefix . 'log' => array(
'post_id',
),
),
);
}
}

View File

@@ -0,0 +1,75 @@
<?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\v320;
class notifications_board extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\dev',
);
}
public function update_data()
{
return array(
array('config.add', array('allow_board_notifications', 1)),
array('custom', array(array($this, 'update_user_subscriptions'))),
array('custom', array(array($this, 'update_module'))),
);
}
public function update_module()
{
$sql = 'UPDATE ' . MODULES_TABLE . "
SET module_auth = 'cfg_allow_board_notifications'
WHERE module_basename = 'ucp_notifications'
AND module_mode = 'notification_list'";
$this->sql_query($sql);
}
public function update_user_subscriptions()
{
$sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . "
SET method = 'notification.method.board'
WHERE method = ''";
$this->sql_query($sql);
}
public function revert_data()
{
return array(
array('custom', array(array($this, 'revert_user_subscriptions'))),
array('custom', array(array($this, 'revert_module'))),
);
}
public function revert_user_subscriptions()
{
$sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . "
SET method = ''
WHERE method = 'notification.method.board'";
$this->sql_query($sql);
}
public function revert_module()
{
$sql = 'UPDATE ' . MODULES_TABLE . "
SET auth = ''
WHERE module_basename = 'ucp_notifications'
AND module_mode = 'notification_list'";
$this->sql_query($sql);
}
}

View File

@@ -0,0 +1,56 @@
<?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\v320;
class oauth_states extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array('\phpbb\db\migration\data\v310\auth_provider_oauth');
}
public function effectively_installed()
{
return $this->db_tools->sql_table_exists($this->table_prefix . 'oauth_states');
}
public function update_schema()
{
return array(
'add_tables' => array(
$this->table_prefix . 'oauth_states' => array(
'COLUMNS' => array(
'user_id' => array('UINT', 0),
'session_id' => array('CHAR:32', ''),
'provider' => array('VCHAR', ''),
'oauth_state' => array('VCHAR', ''),
),
'KEYS' => array(
'user_id' => array('INDEX', 'user_id'),
'provider' => array('INDEX', 'provider'),
),
),
),
);
}
public function revert_schema()
{
return array(
'drop_tables' => array(
$this->table_prefix . 'oauth_states',
),
);
}
}

View File

@@ -0,0 +1,31 @@
<?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\v320;
class remote_upload_validation extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\v320a2',
);
}
public function update_data()
{
return array(
array('config.add', array('remote_upload_verify', '0')),
);
}
}

View File

@@ -0,0 +1,95 @@
<?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\v320;
class remove_outdated_media extends \phpbb\db\migration\migration
{
// Following constants were deprecated in 3.2
// and moved from constants.php to compatibility_globals.php,
// thus define them as class constants
const ATTACHMENT_CATEGORY_WM = 2;
const ATTACHMENT_CATEGORY_RM = 3;
const ATTACHMENT_CATEGORY_QUICKTIME = 6;
protected $cat_id = array(
self::ATTACHMENT_CATEGORY_WM,
self::ATTACHMENT_CATEGORY_RM,
self::ATTACHMENT_CATEGORY_QUICKTIME,
);
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\dev',
);
}
public function update_data()
{
return array(
array('custom', array(array($this, 'change_extension_group'))),
);
}
public function change_extension_group()
{
// select group ids of outdated media
$sql = 'SELECT group_id
FROM ' . EXTENSION_GROUPS_TABLE . '
WHERE ' . $this->db->sql_in_set('cat_id', $this->cat_id);
$result = $this->db->sql_query($sql);
$group_ids = array();
while ($group_id = (int) $this->db->sql_fetchfield('group_id'))
{
$group_ids[] = $group_id;
}
$this->db->sql_freeresult($result);
// nothing to do, admin has removed all the outdated media extension groups
if (empty($group_ids))
{
return true;
}
// get the group id of downloadable files
$sql = 'SELECT group_id
FROM ' . EXTENSION_GROUPS_TABLE . "
WHERE group_name = 'DOWNLOADABLE_FILES'";
$result = $this->db->sql_query($sql);
$download_id = (int) $this->db->sql_fetchfield('group_id');
$this->db->sql_freeresult($result);
if (empty($download_id))
{
$sql = 'UPDATE ' . EXTENSIONS_TABLE . '
SET group_id = 0
WHERE ' . $this->db->sql_in_set('group_id', $group_ids);
}
else
{
// move outdated media extensions to downloadable files
$sql = 'UPDATE ' . EXTENSIONS_TABLE . "
SET group_id = $download_id" . '
WHERE ' . $this->db->sql_in_set('group_id', $group_ids);
}
$this->db->sql_query($sql);
// delete the now empty, outdated media extension groups
$sql = 'DELETE FROM ' . EXTENSION_GROUPS_TABLE . '
WHERE ' . $this->db->sql_in_set('group_id', $group_ids);
$this->db->sql_query($sql);
}
}

View File

@@ -0,0 +1,152 @@
<?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\v320;
class remove_profilefield_wlm extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\dev',
);
}
public function update_schema()
{
return array(
'drop_columns' => array(
$this->table_prefix . 'profile_fields_data' => array(
'pf_phpbb_wlm',
),
),
);
}
public function revert_schema()
{
return array(
'add_columns' => array(
$this->table_prefix . 'profile_fields_data' => array(
'pf_phpbb_wlm' => array('VCHAR', ''),
),
),
);
}
public function update_data()
{
return array(
array('custom', array(array($this, 'delete_custom_profile_field_data'))),
);
}
public function revert_data()
{
return array(
array('custom', array(array($this, 'create_custom_field'))),
);
}
public function delete_custom_profile_field_data()
{
$field_id = $this->get_custom_profile_field_id();
$sql = 'DELETE FROM ' . PROFILE_FIELDS_TABLE . '
WHERE field_id = ' . (int) $field_id;
$this->db->sql_query($sql);
$sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . '
WHERE field_id = ' . (int) $field_id;
$this->db->sql_query($sql);
$sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . '
WHERE field_id = ' . (int) $field_id;
$this->db->sql_query($sql);
}
/**
* Get custom profile field id
* @return int custom profile filed id
*/
public function get_custom_profile_field_id()
{
$sql = 'SELECT field_id
FROM ' . PROFILE_FIELDS_TABLE . "
WHERE field_name = 'phpbb_wlm'";
$result = $this->db->sql_query($sql);
$field_id = (int) $this->db->sql_fetchfield('field_id');
$this->db->sql_freeresult($result);
return $field_id;
}
public function create_custom_field()
{
$sql = 'SELECT MAX(field_order) as max_field_order
FROM ' . PROFILE_FIELDS_TABLE;
$result = $this->db->sql_query($sql);
$max_field_order = (int) $this->db->sql_fetchfield('max_field_order');
$this->db->sql_freeresult($result);
$sql_ary = array(
'field_name' => 'phpbb_wlm',
'field_type' => 'profilefields.type.string',
'field_ident' => 'phpbb_wlm',
'field_length' => '40',
'field_minlen' => '5',
'field_maxlen' => '255',
'field_novalue' => '',
'field_default_value' => '',
'field_validation' => '.*',
'field_required' => 0,
'field_show_novalue' => 0,
'field_show_on_reg' => 0,
'field_show_on_pm' => 1,
'field_show_on_vt' => 1,
'field_show_on_ml' => 0,
'field_show_profile' => 1,
'field_hide' => 0,
'field_no_view' => 0,
'field_active' => 1,
'field_is_contact' => 1,
'field_contact_desc' => '',
'field_contact_url' => '',
'field_order' => $max_field_order + 1,
);
$sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
$this->db->sql_query($sql);
$field_id = (int) $this->db->sql_nextid();
$insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_LANG_TABLE);
$sql = 'SELECT lang_id
FROM ' . LANG_TABLE;
$result = $this->db->sql_query($sql);
$lang_name = 'WLM';
while ($lang_id = (int) $this->db->sql_fetchfield('lang_id'))
{
$insert_buffer->insert(array(
'field_id' => (int) $field_id,
'lang_id' => (int) $lang_id,
'lang_name' => $lang_name,
'lang_explain' => '',
'lang_default_value' => '',
));
}
$this->db->sql_freeresult($result);
$insert_buffer->flush();
}
}

View File

@@ -0,0 +1,46 @@
<?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\v320;
class report_id_auto_increment extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\default_data_type_ids',
);
}
public function update_schema()
{
return array(
'change_columns' => array(
$this->table_prefix . 'reports' => array(
'report_id' => array('ULINT', null, 'auto_increment'),
),
),
);
}
public function revert_schema()
{
return array(
'change_columns' => array(
$this->table_prefix . 'reports' => array(
'report_id' => array('ULINT', 0),
),
),
);
}
}

View File

@@ -0,0 +1,121 @@
<?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\v320;
use phpbb\textreparser\manager;
use phpbb\textreparser\reparser_interface;
class text_reparser extends \phpbb\db\migration\container_aware_migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v310\contact_admin_form',
'\phpbb\db\migration\data\v320\allowed_schemes_links',
);
}
public function effectively_installed()
{
return isset($this->config['reparse_lock']);
}
public function update_data()
{
return array(
array('config.add', array('reparse_lock', 0, true)),
array('config.add', array('text_reparser.pm_text_cron_interval', 10)),
array('config.add', array('text_reparser.pm_text_last_cron', 0)),
array('config.add', array('text_reparser.poll_option_cron_interval', 10)),
array('config.add', array('text_reparser.poll_option_last_cron', 0)),
array('config.add', array('text_reparser.poll_title_cron_interval', 10)),
array('config.add', array('text_reparser.poll_title_last_cron', 0)),
array('config.add', array('text_reparser.post_text_cron_interval', 10)),
array('config.add', array('text_reparser.post_text_last_cron', 0)),
array('config.add', array('text_reparser.user_signature_cron_interval', 10)),
array('config.add', array('text_reparser.user_signature_last_cron', 0)),
array('custom', array(array($this, 'reparse'))),
);
}
public function reparse($resume_data)
{
/** @var manager $reparser_manager */
$reparser_manager = $this->container->get('text_reparser.manager');
if (!is_array($resume_data))
{
/** @var reparser_interface[] $reparsers */
$reparsers = $this->container->get('text_reparser_collection');
// Initialize all reparsers
foreach ($reparsers as $name => $reparser)
{
$reparser_manager->update_resume_data($name, 1, $reparser->get_max_id(), 100);
}
}
// Sometimes a cron job is too much
$limit = 100;
$fast_reparsers = array(
'text_reparser.contact_admin_info',
'text_reparser.forum_description',
'text_reparser.forum_rules',
'text_reparser.group_description',
);
if (!is_array($resume_data))
{
$resume_data = array(
'reparser' => 0,
'current' => $this->container->get($fast_reparsers[0])->get_max_id(),
);
}
$fast_reparsers_size = count($fast_reparsers);
$processed_records = 0;
while ($processed_records < $limit && $resume_data['reparser'] < $fast_reparsers_size)
{
$reparser = $this->container->get($fast_reparsers[$resume_data['reparser']]);
// New reparser
if ($resume_data['current'] === 0)
{
$resume_data['current'] = $reparser->get_max_id();
}
$start = max(1, $resume_data['current'] + 1 - ($limit - $processed_records));
$end = max(1, $resume_data['current']);
$reparser->reparse_range($start, $end);
$processed_records += $end - $start + 1;
$resume_data['current'] = $start - 1;
if ($start === 1)
{
// Prevent CLI command from running these reparsers again
$reparser_manager->update_resume_data($fast_reparsers[$resume_data['reparser']], 1, 0, $limit);
$resume_data['reparser']++;
}
}
if ($resume_data['reparser'] === $fast_reparsers_size)
{
return true;
}
return $resume_data;
}
}

View File

@@ -0,0 +1,40 @@
<?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\v320;
use phpbb\db\migration\migration;
class v320 extends migration
{
public function effectively_installed()
{
return version_compare($this->config['version'], '3.2.0', '>=');
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v31x\increase_size_of_emotion',
'\phpbb\db\migration\data\v320\cookie_notice',
);
}
public function update_data()
{
return array(
array('config.update', array('version', '3.2.0')),
);
}
}

View File

@@ -0,0 +1,44 @@
<?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\v320;
class v320a1 extends \phpbb\db\migration\container_aware_migration
{
public function effectively_installed()
{
return version_compare($this->config['version'], '3.2.0-a1', '>=');
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v320\dev',
'\phpbb\db\migration\data\v320\allowed_schemes_links',
'\phpbb\db\migration\data\v320\announce_global_permission',
'\phpbb\db\migration\data\v320\remove_profilefield_wlm',
'\phpbb\db\migration\data\v320\font_awesome_update',
'\phpbb\db\migration\data\v320\icons_alt',
'\phpbb\db\migration\data\v320\log_post_id',
'\phpbb\db\migration\data\v320\remove_outdated_media',
'\phpbb\db\migration\data\v320\notifications_board',
);
}
public function update_data()
{
return array(
array('config.update', array('version', '3.2.0-dev')),
);
}
}

View File

@@ -0,0 +1,38 @@
<?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\v320;
class v320a2 extends \phpbb\db\migration\container_aware_migration
{
public function effectively_installed()
{
return version_compare($this->config['version'], '3.2.0-a2', '>=');
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v31x\v317rc1',
'\phpbb\db\migration\data\v320\text_reparser',
'\phpbb\db\migration\data\v320\v320a1',
);
}
public function update_data()
{
return array(
array('config.update', array('version', '3.2.0-a2')),
);
}
}

View File

@@ -0,0 +1,39 @@
<?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\v320;
class v320b1 extends \phpbb\db\migration\container_aware_migration
{
public function effectively_installed()
{
return version_compare($this->config['version'], '3.2.0-b1', '>=');
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v31x\v317pl1',
'\phpbb\db\migration\data\v320\v320a2',
'\phpbb\db\migration\data\v31x\increase_size_of_dateformat',
'\phpbb\db\migration\data\v320\default_data_type_ids',
);
}
public function update_data()
{
return array(
array('config.update', array('version', '3.2.0-b1')),
);
}
}

View File

@@ -0,0 +1,40 @@
<?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\v320;
use phpbb\db\migration\migration;
class v320b2 extends migration
{
public function effectively_installed()
{
return version_compare($this->config['version'], '3.2.0-b2', '>=');
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v31x\v318',
'\phpbb\db\migration\data\v320\v320b1',
'\phpbb\db\migration\data\v320\remote_upload_validation',
);
}
public function update_data()
{
return array(
array('config.update', array('version', '3.2.0-b2')),
);
}
}

View File

@@ -0,0 +1,40 @@
<?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\v320;
use phpbb\db\migration\migration;
class v320rc1 extends migration
{
public function effectively_installed()
{
return version_compare($this->config['version'], '3.2.0-RC1', '>=');
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v31x\v319',
'\phpbb\db\migration\data\v320\report_id_auto_increment',
'\phpbb\db\migration\data\v320\v320b2',
);
}
public function update_data()
{
return array(
array('config.update', array('version', '3.2.0-RC1')),
);
}
}

View File

@@ -0,0 +1,40 @@
<?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\v320;
use phpbb\db\migration\migration;
class v320rc2 extends migration
{
public function effectively_installed()
{
return version_compare($this->config['version'], '3.2.0-RC2', '>=');
}
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v31x\remove_duplicate_migrations',
'\phpbb\db\migration\data\v31x\add_log_time_index',
'\phpbb\db\migration\data\v320\add_help_phpbb',
);
}
public function update_data()
{
return array(
array('config.update', array('version', '3.2.0-RC2')),
);
}
}