PDF rausgenommen
This commit is contained in:
33
msd2/phpBB3/phpbb/db/migration/data/v32x/.htaccess
Normal file
33
msd2/phpBB3/phpbb/db/migration/data/v32x/.htaccess
Normal 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>
|
@ -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\v32x;
|
||||
|
||||
class cookie_notice_p2 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v320\v320',
|
||||
);
|
||||
}
|
||||
|
||||
public function effectively_installed()
|
||||
{
|
||||
return isset($this->config['cookie_notice']);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.add', array('cookie_notice', '0')),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
<?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\v32x;
|
||||
|
||||
class email_force_sender extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v321',
|
||||
);
|
||||
}
|
||||
|
||||
public function effectively_installed()
|
||||
{
|
||||
return isset($this->config['email_force_sender']);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.add', array('email_force_sender', '0')),
|
||||
array('config.remove', array('email_function_name')),
|
||||
);
|
||||
}
|
||||
}
|
@ -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\v32x;
|
||||
|
||||
class enable_accurate_pm_button extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v322',
|
||||
);
|
||||
}
|
||||
|
||||
public function effectively_installed()
|
||||
{
|
||||
return isset($this->config['enable_accurate_pm_button']);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.add', array('enable_accurate_pm_button', '1')),
|
||||
);
|
||||
}
|
||||
}
|
@ -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\v32x;
|
||||
|
||||
class f_list_topics_permission_add extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v321',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('permission.add', array('f_list_topics', false, 'f_read')),
|
||||
);
|
||||
}
|
||||
}
|
54
msd2/phpBB3/phpbb/db/migration/data/v32x/fix_user_styles.php
Normal file
54
msd2/phpBB3/phpbb/db/migration/data/v32x/fix_user_styles.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?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\v32x;
|
||||
|
||||
class fix_user_styles extends \phpbb\db\migration\migration
|
||||
{
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v320\v320',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('custom', array(array($this, 'styles_fix'))),
|
||||
);
|
||||
}
|
||||
|
||||
public function styles_fix()
|
||||
{
|
||||
$default_style = (int) $this->config['default_style'];
|
||||
$enabled_styles = array();
|
||||
|
||||
// Get enabled styles
|
||||
$sql = 'SELECT style_id
|
||||
FROM ' . STYLES_TABLE . '
|
||||
WHERE style_active = 1';
|
||||
$result = $this->db->sql_query($sql);
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$enabled_styles[] = (int) $row['style_id'];
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
// Set the default style to users who have an invalid style
|
||||
$this->sql_query('UPDATE ' . USERS_TABLE . '
|
||||
SET user_style = ' . (int) $default_style . '
|
||||
WHERE ' . $this->db->sql_in_set('user_style', $enabled_styles, true));
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
<?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\v32x;
|
||||
|
||||
class forum_topics_per_page_type extends \phpbb\db\migration\migration
|
||||
{
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v323',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
return array(
|
||||
'change_columns' => array(
|
||||
$this->table_prefix . 'forums' => array(
|
||||
'forum_topics_per_page' => array('USINT', 0),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
37
msd2/phpBB3/phpbb/db/migration/data/v32x/jquery_update.php
Normal file
37
msd2/phpBB3/phpbb/db/migration/data/v32x/jquery_update.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?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\v32x;
|
||||
|
||||
class jquery_update extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return $this->config['load_jquery_url'] === '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js';
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v325rc1',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js')),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@ -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\v32x;
|
||||
|
||||
class load_user_activity_limit extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v320\v320',
|
||||
);
|
||||
}
|
||||
|
||||
public function effectively_installed()
|
||||
{
|
||||
return isset($this->config['load_user_activity_limit']);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.add', array('load_user_activity_limit', '5000')),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
<?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\v32x;
|
||||
|
||||
class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migration
|
||||
{
|
||||
public function update_data()
|
||||
{
|
||||
return [
|
||||
['custom', [[$this, 'update_bbcodes_table']]],
|
||||
];
|
||||
}
|
||||
|
||||
public function update_bbcodes_table()
|
||||
{
|
||||
$sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline, bbcode_match, bbcode_tpl FROM ' . BBCODES_TABLE;
|
||||
$result = $this->sql_query($sql);
|
||||
$bbcodes = [];
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$variant = (substr($row['bbcode_tag'], -1) === '=') ? 'with': 'without';
|
||||
$bbcode_name = strtolower(rtrim($row['bbcode_tag'], '='));
|
||||
$bbcodes[$bbcode_name][$variant] = $row;
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
foreach ($bbcodes as $bbcode_name => $variants)
|
||||
{
|
||||
if (count($variants) === 2)
|
||||
{
|
||||
$this->merge_bbcodes($variants['without'], $variants['with']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function merge_bbcodes(array $without, array $with)
|
||||
{
|
||||
try
|
||||
{
|
||||
$merged = $this->container->get('text_formatter.s9e.bbcode_merger')->merge_bbcodes(
|
||||
[
|
||||
'usage' => $without['bbcode_match'],
|
||||
'template' => $without['bbcode_tpl']
|
||||
],
|
||||
[
|
||||
'usage' => $with['bbcode_match'],
|
||||
'template' => $with['bbcode_tpl']
|
||||
]
|
||||
);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
// Ignore the pair and move on. The BBCodes would have to be fixed manually
|
||||
return;
|
||||
}
|
||||
|
||||
$bbcode_data = [
|
||||
'bbcode_tag' => $without['bbcode_tag'],
|
||||
'bbcode_helpline' => $without['bbcode_helpline'] . ' | ' . $with['bbcode_helpline'],
|
||||
'bbcode_match' => $merged['usage'],
|
||||
'bbcode_tpl' => $merged['template']
|
||||
];
|
||||
|
||||
$sql = 'UPDATE ' . BBCODES_TABLE . '
|
||||
SET ' . $this->db->sql_build_array('UPDATE', $bbcode_data) . '
|
||||
WHERE bbcode_id = ' . (int) $without['bbcode_id'];
|
||||
$this->sql_query($sql);
|
||||
|
||||
$sql = 'DELETE FROM ' . BBCODES_TABLE . '
|
||||
WHERE bbcode_id = ' . (int) $with['bbcode_id'];
|
||||
$this->sql_query($sql);
|
||||
}
|
||||
}
|
31
msd2/phpBB3/phpbb/db/migration/data/v32x/remove_imagick.php
Normal file
31
msd2/phpBB3/phpbb/db/migration/data/v32x/remove_imagick.php
Normal 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\v32x;
|
||||
|
||||
class remove_imagick extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v324rc1',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.remove', array('img_imagick')),
|
||||
);
|
||||
}
|
||||
}
|
@ -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\v32x;
|
||||
|
||||
class update_prosilver_bitfield extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v321',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('custom', array(array($this, 'update_bbcode_bitfield'))),
|
||||
);
|
||||
}
|
||||
|
||||
public function update_bbcode_bitfield()
|
||||
{
|
||||
$sql = 'UPDATE ' . STYLES_TABLE . "
|
||||
SET bbcode_bitfield = '//g='
|
||||
WHERE style_path = 'prosilver'";
|
||||
$this->sql_query($sql);
|
||||
}
|
||||
}
|
@ -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\v32x;
|
||||
|
||||
class user_notifications_table_index_p1 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\cookie_notice_p2',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
return array(
|
||||
'add_index' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'user_id' => array('user_id'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
return array(
|
||||
'drop_keys' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'user_id',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -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\v32x;
|
||||
|
||||
class user_notifications_table_index_p2 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\user_notifications_table_index_p1',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
return array(
|
||||
'add_index' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'uid_itm_id' => array('user_id', 'item_id'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
return array(
|
||||
'drop_keys' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'uid_itm_id',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -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\v32x;
|
||||
|
||||
class user_notifications_table_index_p3 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\user_notifications_table_index_p2',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
return array(
|
||||
'add_index' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'usr_itm_tpe' => array('user_id', 'item_type', 'item_id'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
return array(
|
||||
'drop_keys' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'usr_itm_tpe',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -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\v32x;
|
||||
|
||||
class user_notifications_table_reduce_column_sizes extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\user_notifications_table_index_p3',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
return array(
|
||||
'change_columns' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'item_type' => array('VCHAR:165', ''),
|
||||
'method' => array('VCHAR:165', ''),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
return array(
|
||||
'change_columns' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'item_type' => array('VCHAR:255', ''),
|
||||
'method' => array('VCHAR:255', ''),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
<?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\v32x;
|
||||
|
||||
class user_notifications_table_remove_duplicates extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\user_notifications_table_temp_index',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('custom', array(array($this, 'remove_duplicates'))),
|
||||
);
|
||||
}
|
||||
|
||||
public function remove_duplicates()
|
||||
{
|
||||
$insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->table_prefix . 'user_notifications');
|
||||
|
||||
$sql = "SELECT item_type, item_id, user_id, method, MAX(notify) AS notify
|
||||
FROM {$this->table_prefix}user_notifications
|
||||
GROUP BY item_type, item_id, user_id, method
|
||||
HAVING COUNT(item_type) > 1";
|
||||
|
||||
$result = $this->sql_query($sql);
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
// Delete the duplicate entries
|
||||
$this->sql_query("DELETE FROM {$this->table_prefix}user_notifications
|
||||
WHERE user_id = {$row['user_id']}
|
||||
AND item_type = '{$row['item_type']}'
|
||||
AND method = '{$row['method']}'");
|
||||
|
||||
// And re-insert as a single one
|
||||
$insert_buffer->insert($row);
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
}
|
||||
}
|
@ -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\v32x;
|
||||
|
||||
class user_notifications_table_temp_index extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\user_notifications_table_reduce_column_sizes',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
return array(
|
||||
'add_index' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'itm_usr_mthd' => array('item_type', 'item_id', 'user_id', 'method'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
return array(
|
||||
'drop_keys' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'itm_usr_mthd',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -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\v32x;
|
||||
|
||||
class user_notifications_table_unique_index extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\user_notifications_table_remove_duplicates',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
return array(
|
||||
'drop_keys' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'itm_usr_mthd',
|
||||
),
|
||||
),
|
||||
'add_unique_index' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'itm_usr_mthd' => array('item_type', 'item_id', 'user_id', 'method'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
return array(
|
||||
'drop_keys' => array(
|
||||
$this->table_prefix . 'user_notifications' => array(
|
||||
'itm_usr_mthd',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
38
msd2/phpBB3/phpbb/db/migration/data/v32x/v321.php
Normal file
38
msd2/phpBB3/phpbb/db/migration/data/v32x/v321.php
Normal 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\v32x;
|
||||
|
||||
class v321 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return phpbb_version_compare($this->config['version'], '3.2.1', '>=');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v31x\v3111',
|
||||
'\phpbb\db\migration\data\v32x\v321rc1',
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.2.1')),
|
||||
);
|
||||
}
|
||||
}
|
39
msd2/phpBB3/phpbb/db/migration/data/v32x/v321rc1.php
Normal file
39
msd2/phpBB3/phpbb/db/migration/data/v32x/v321rc1.php
Normal 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\v32x;
|
||||
|
||||
class v321rc1 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return phpbb_version_compare($this->config['version'], '3.2.1-RC1', '>=');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v320\v320',
|
||||
'\phpbb\db\migration\data\v31x\v3111rc1',
|
||||
'\phpbb\db\migration\data\v32x\load_user_activity_limit',
|
||||
'\phpbb\db\migration\data\v32x\user_notifications_table_unique_index',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.2.1-RC1')),
|
||||
);
|
||||
}
|
||||
}
|
37
msd2/phpBB3/phpbb/db/migration/data/v32x/v322.php
Normal file
37
msd2/phpBB3/phpbb/db/migration/data/v32x/v322.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?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\v32x;
|
||||
|
||||
class v322 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return phpbb_version_compare($this->config['version'], '3.2.2', '>=');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v31x\v3112',
|
||||
'\phpbb\db\migration\data\v32x\v322rc1',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.2.2')),
|
||||
);
|
||||
}
|
||||
}
|
41
msd2/phpBB3/phpbb/db/migration/data/v32x/v322rc1.php
Normal file
41
msd2/phpBB3/phpbb/db/migration/data/v32x/v322rc1.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?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\v32x;
|
||||
|
||||
class v322rc1 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return phpbb_version_compare($this->config['version'], '3.2.2-RC1', '>=');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v321',
|
||||
'\phpbb\db\migration\data\v32x\fix_user_styles',
|
||||
'\phpbb\db\migration\data\v32x\update_prosilver_bitfield',
|
||||
'\phpbb\db\migration\data\v32x\email_force_sender',
|
||||
'\phpbb\db\migration\data\v32x\f_list_topics_permission_add',
|
||||
'\phpbb\db\migration\data\v32x\merge_duplicate_bbcodes',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.2.2-RC1')),
|
||||
);
|
||||
}
|
||||
}
|
37
msd2/phpBB3/phpbb/db/migration/data/v32x/v323.php
Normal file
37
msd2/phpBB3/phpbb/db/migration/data/v32x/v323.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?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\v32x;
|
||||
|
||||
class v323 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return phpbb_version_compare($this->config['version'], '3.2.3', '>=');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v323rc2',
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.2.3')),
|
||||
);
|
||||
}
|
||||
}
|
37
msd2/phpBB3/phpbb/db/migration/data/v32x/v323rc1.php
Normal file
37
msd2/phpBB3/phpbb/db/migration/data/v32x/v323rc1.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?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\v32x;
|
||||
|
||||
class v323rc1 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return phpbb_version_compare($this->config['version'], '3.2.3-RC1', '>=');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v322',
|
||||
'\phpbb\db\migration\data\v32x\enable_accurate_pm_button',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.2.3-RC1')),
|
||||
);
|
||||
}
|
||||
}
|
36
msd2/phpBB3/phpbb/db/migration/data/v32x/v323rc2.php
Normal file
36
msd2/phpBB3/phpbb/db/migration/data/v32x/v323rc2.php
Normal 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\v32x;
|
||||
|
||||
class v323rc2 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return phpbb_version_compare($this->config['version'], '3.2.3-RC2', '>=');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v323rc1',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.2.3-RC2')),
|
||||
);
|
||||
}
|
||||
}
|
38
msd2/phpBB3/phpbb/db/migration/data/v32x/v324.php
Normal file
38
msd2/phpBB3/phpbb/db/migration/data/v32x/v324.php
Normal 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\v32x;
|
||||
|
||||
class v324 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return phpbb_version_compare($this->config['version'], '3.2.4', '>=');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v324rc1',
|
||||
'\phpbb\db\migration\data\v32x\remove_imagick',
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.2.4')),
|
||||
);
|
||||
}
|
||||
}
|
37
msd2/phpBB3/phpbb/db/migration/data/v32x/v324rc1.php
Normal file
37
msd2/phpBB3/phpbb/db/migration/data/v32x/v324rc1.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?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\v32x;
|
||||
|
||||
class v324rc1 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return phpbb_version_compare($this->config['version'], '3.2.4-RC1', '>=');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v323',
|
||||
'\phpbb\db\migration\data\v32x\forum_topics_per_page_type',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.2.4-RC1')),
|
||||
);
|
||||
}
|
||||
}
|
38
msd2/phpBB3/phpbb/db/migration/data/v32x/v325.php
Normal file
38
msd2/phpBB3/phpbb/db/migration/data/v32x/v325.php
Normal 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\v32x;
|
||||
|
||||
class v325 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return phpbb_version_compare($this->config['version'], '3.2.5', '>=');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v325rc1',
|
||||
'\phpbb\db\migration\data\v32x\jquery_update',
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.2.5')),
|
||||
);
|
||||
}
|
||||
}
|
36
msd2/phpBB3/phpbb/db/migration/data/v32x/v325rc1.php
Normal file
36
msd2/phpBB3/phpbb/db/migration/data/v32x/v325rc1.php
Normal 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\v32x;
|
||||
|
||||
class v325rc1 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return phpbb_version_compare($this->config['version'], '3.2.5-RC1', '>=');
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array(
|
||||
'\phpbb\db\migration\data\v32x\v324',
|
||||
);
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
array('config.update', array('version', '3.2.5-RC1')),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user