From b81613e5e57fd208e832637b6886abf9ec806c4b Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 14 Jul 2013 12:25:28 -0400 Subject: [ticket/11700] With namespaces interface will no longer be a valid classname PHPBB3-11700 --- phpBB/phpbb/db/migration/tool/interface.php | 33 ------------------------ phpBB/phpbb/db/migration/tool/tool_interface.php | 33 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/tool/interface.php create mode 100644 phpBB/phpbb/db/migration/tool/tool_interface.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/tool/interface.php b/phpBB/phpbb/db/migration/tool/interface.php deleted file mode 100644 index ced53b2023..0000000000 --- a/phpBB/phpbb/db/migration/tool/interface.php +++ /dev/null @@ -1,33 +0,0 @@ - Date: Sun, 14 Jul 2013 13:30:52 -0400 Subject: [ticket/11700] Modify all code to use the new interface names PHPBB3-11700 --- phpBB/phpbb/db/migration/tool/config.php | 2 +- phpBB/phpbb/db/migration/tool/module.php | 2 +- phpBB/phpbb/db/migration/tool/permission.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/tool/config.php b/phpBB/phpbb/db/migration/tool/config.php index 0b626bf455..5dd47cfa60 100644 --- a/phpBB/phpbb/db/migration/tool/config.php +++ b/phpBB/phpbb/db/migration/tool/config.php @@ -12,7 +12,7 @@ * * @package db */ -class phpbb_db_migration_tool_config implements phpbb_db_migration_tool_interface +class phpbb_db_migration_tool_config implements phpbb_db_migration_tool_tool_interface { /** @var phpbb_config */ protected $config; diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index ac4d2c9bd7..8ed2a933ff 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -12,7 +12,7 @@ * * @package db */ -class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_interface +class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_interface { /** @var phpbb_cache_service */ protected $cache; diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index 2f09c0ac72..f1140d0759 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -12,7 +12,7 @@ * * @package db */ -class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_interface +class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool_interface { /** @var phpbb_auth */ protected $auth; -- cgit v1.2.1 From b95fdacdd378877d277e261465da73deb06e50da Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 14:01:09 +0200 Subject: [ticket/11700] Move all recent code to namespaces PHPBB3-11700 --- phpBB/phpbb/db/driver/driver.php | 8 +++-- phpBB/phpbb/db/driver/firebird.php | 4 ++- phpBB/phpbb/db/driver/mssql.php | 4 ++- phpBB/phpbb/db/driver/mssql_base.php | 4 ++- phpBB/phpbb/db/driver/mssql_odbc.php | 4 ++- phpBB/phpbb/db/driver/mssqlnative.php | 6 ++-- phpBB/phpbb/db/driver/mysql.php | 4 ++- phpBB/phpbb/db/driver/mysql_base.php | 4 ++- phpBB/phpbb/db/driver/mysqli.php | 4 ++- phpBB/phpbb/db/driver/oracle.php | 4 ++- phpBB/phpbb/db/driver/postgres.php | 8 +++-- phpBB/phpbb/db/driver/sqlite.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_1.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_10.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_10_rc1.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_10_rc2.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_10_rc3.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_11.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_11_rc1.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_11_rc2.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_12_rc1.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_1_rc1.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_2.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_2_rc1.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_2_rc2.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_3.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_3_rc1.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_4.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_4_rc1.php | 6 ++-- phpBB/phpbb/db/migration/data/30x/3_0_5.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_5_rc1.php | 4 ++- .../phpbb/db/migration/data/30x/3_0_5_rc1part2.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_6.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_6_rc1.php | 14 ++++---- phpBB/phpbb/db/migration/data/30x/3_0_6_rc2.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_6_rc3.php | 6 ++-- phpBB/phpbb/db/migration/data/30x/3_0_6_rc4.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_7.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_7_pl1.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_7_rc1.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_7_rc2.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_8.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_8_rc1.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_9.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_9_rc1.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_9_rc2.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_9_rc3.php | 4 ++- phpBB/phpbb/db/migration/data/30x/3_0_9_rc4.php | 4 ++- .../db/migration/data/30x/local_url_bbcode.php | 6 ++-- phpBB/phpbb/db/migration/data/310/avatars.php | 4 ++- phpBB/phpbb/db/migration/data/310/boardindex.php | 4 ++- .../phpbb/db/migration/data/310/config_db_text.php | 4 ++- phpBB/phpbb/db/migration/data/310/dev.php | 16 +++++---- phpBB/phpbb/db/migration/data/310/extensions.php | 4 ++- .../db/migration/data/310/forgot_password.php | 4 ++- .../phpbb/db/migration/data/310/jquery_update.php | 6 ++-- .../data/310/notification_options_reconvert.php | 16 +++++---- .../phpbb/db/migration/data/310/notifications.php | 6 ++-- .../data/310/notifications_schema_fix.php | 6 ++-- .../migration/data/310/reported_posts_display.php | 4 ++- .../migration/data/310/signature_module_auth.php | 4 ++- .../phpbb/db/migration/data/310/softdelete_p1.php | 6 ++-- .../phpbb/db/migration/data/310/softdelete_p2.php | 8 +++-- .../db/migration/data/310/style_update_p1.php | 6 ++-- .../db/migration/data/310/style_update_p2.php | 6 ++-- phpBB/phpbb/db/migration/data/310/teampage.php | 6 ++-- phpBB/phpbb/db/migration/data/310/timezone.php | 8 +++-- phpBB/phpbb/db/migration/data/310/timezone_p2.php | 6 ++-- phpBB/phpbb/db/migration/exception.php | 12 ++++--- phpBB/phpbb/db/migration/migration.php | 18 +++++----- phpBB/phpbb/db/migration/tool/config.php | 16 +++++---- phpBB/phpbb/db/migration/tool/module.php | 36 ++++++++++--------- phpBB/phpbb/db/migration/tool/permission.php | 32 +++++++++-------- phpBB/phpbb/db/migration/tool/tool_interface.php | 4 ++- phpBB/phpbb/db/migrator.php | 40 ++++++++++++---------- phpBB/phpbb/db/sql_insert_buffer.php | 12 ++++--- phpBB/phpbb/db/tools.php | 26 +++++++------- 77 files changed, 348 insertions(+), 194 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 08c966c07a..a266b2aa48 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB')) * Database Abstraction Layer * @package dbal */ -class phpbb_db_driver +class driver { var $db_connect_id; var $query_result; @@ -272,7 +274,7 @@ class phpbb_db_driver * Correctly adjust LIKE expression for special characters * Some DBMS are handling them in a different way * - * @param string $expression The expression to use. Every wildcard is escaped, except $this->any_char and $this->one_char + * @param string $expression The expression to use. Every wildcard is escaped, \except $this->any_char and $this->one_char * @return string LIKE expression including the keyword! */ function sql_like_expression($expression) @@ -450,7 +452,7 @@ class phpbb_db_driver * @param string $field name of the sql column that shall be compared * @param array $array array of values that are allowed (IN) or not allowed (NOT IN) * @param bool $negate true for NOT IN (), false for IN () (default) - * @param bool $allow_empty_set If true, allow $array to be empty, this function will return 1=1 or 1=0 then. Default to false. + * @param bool $allow_empty_set If true, \allow $array to be empty, this function will return 1=1 or 1=0 then. Default to false. */ function sql_in_set($field, $array, $negate = false, $allow_empty_set = false) { diff --git a/phpBB/phpbb/db/driver/firebird.php b/phpBB/phpbb/db/driver/firebird.php index 787c28b812..2df5eaf369 100644 --- a/phpBB/phpbb/db/driver/firebird.php +++ b/phpBB/phpbb/db/driver/firebird.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * Minimum Requirement is Firebird 2.1 * @package dbal */ -class phpbb_db_driver_firebird extends phpbb_db_driver +class firebird extends \phpbb\db\driver\driver { var $last_query_text = ''; var $service_handle = false; diff --git a/phpBB/phpbb/db/driver/mssql.php b/phpBB/phpbb/db/driver/mssql.php index 89c2c2351b..4d2cd287da 100644 --- a/phpBB/phpbb/db/driver/mssql.php +++ b/phpBB/phpbb/db/driver/mssql.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * Minimum Requirement is MSSQL 2000+ * @package dbal */ -class phpbb_db_driver_mssql extends phpbb_db_driver +class mssql extends \phpbb\db\driver\driver { var $connect_error = ''; diff --git a/phpBB/phpbb/db/driver/mssql_base.php b/phpBB/phpbb/db/driver/mssql_base.php index 56c111c871..57c4e0f1fd 100644 --- a/phpBB/phpbb/db/driver/mssql_base.php +++ b/phpBB/phpbb/db/driver/mssql_base.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB')) * MSSQL Database Base Abstraction Layer * @package dbal */ -abstract class phpbb_db_driver_mssql_base extends phpbb_db_driver +abstract class mssql_base extends \phpbb\db\driver\driver { /** * {@inheritDoc} diff --git a/phpBB/phpbb/db/driver/mssql_odbc.php b/phpBB/phpbb/db/driver/mssql_odbc.php index a1d1a5d5dd..9db34a69fb 100644 --- a/phpBB/phpbb/db/driver/mssql_odbc.php +++ b/phpBB/phpbb/db/driver/mssql_odbc.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -26,7 +28,7 @@ if (!defined('IN_PHPBB')) * * @package dbal */ -class phpbb_db_driver_mssql_odbc extends phpbb_db_driver_mssql_base +class mssql_odbc extends \phpbb\db\driver\mssql_base { var $last_query_text = ''; var $connect_error = ''; diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php index 28fc88298a..e6002fe1a3 100644 --- a/phpBB/phpbb/db/driver/mssqlnative.php +++ b/phpBB/phpbb/db/driver/mssqlnative.php @@ -11,6 +11,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -56,7 +58,7 @@ class result_mssqlnative { if (is_array($value)) { - $obj->$key = new stdClass(); + $obj->$key = new \stdClass(); array_to_obj($value, $obj->$key); } else @@ -191,7 +193,7 @@ class result_mssqlnative /** * @package dbal */ -class phpbb_db_driver_mssqlnative extends phpbb_db_driver_mssql_base +class mssqlnative extends \phpbb\db\driver\mssql_base { var $m_insert_id = NULL; var $last_query_text = ''; diff --git a/phpBB/phpbb/db/driver/mysql.php b/phpBB/phpbb/db/driver/mysql.php index f3744ac09d..c76126763d 100644 --- a/phpBB/phpbb/db/driver/mysql.php +++ b/phpBB/phpbb/db/driver/mysql.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -24,7 +26,7 @@ if (!defined('IN_PHPBB')) * MySQL 5.0+ * @package dbal */ -class phpbb_db_driver_mysql extends phpbb_db_driver_mysql_base +class mysql extends \phpbb\db\driver\mysql_base { var $multi_insert = true; var $connect_error = ''; diff --git a/phpBB/phpbb/db/driver/mysql_base.php b/phpBB/phpbb/db/driver/mysql_base.php index ba44ea61aa..8f2f66674b 100644 --- a/phpBB/phpbb/db/driver/mysql_base.php +++ b/phpBB/phpbb/db/driver/mysql_base.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB')) * Abstract MySQL Database Base Abstraction Layer * @package dbal */ -abstract class phpbb_db_driver_mysql_base extends phpbb_db_driver +abstract class mysql_base extends \phpbb\db\driver\driver { /** * {@inheritDoc} diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index 0f7a73ee6e..4d0e43b464 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -21,7 +23,7 @@ if (!defined('IN_PHPBB')) * MySQL 4.1+ or MySQL 5.0+ * @package dbal */ -class phpbb_db_driver_mysqli extends phpbb_db_driver_mysql_base +class mysqli extends \phpbb\db\driver\mysql_base { var $multi_insert = true; var $connect_error = ''; diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php index e21e07055d..5dfab21455 100644 --- a/phpBB/phpbb/db/driver/oracle.php +++ b/phpBB/phpbb/db/driver/oracle.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -19,7 +21,7 @@ if (!defined('IN_PHPBB')) * Oracle Database Abstraction Layer * @package dbal */ -class phpbb_db_driver_oracle extends phpbb_db_driver +class oracle extends \phpbb\db\driver\driver { var $last_query_text = ''; var $connect_error = ''; diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php index 14854d179d..7a98b90c73 100644 --- a/phpBB/phpbb/db/driver/postgres.php +++ b/phpBB/phpbb/db/driver/postgres.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * Minimum Requirement is Version 7.3+ * @package dbal */ -class phpbb_db_driver_postgres extends phpbb_db_driver +class postgres extends \phpbb\db\driver\driver { var $last_query_text = ''; var $connect_error = ''; @@ -84,7 +86,7 @@ class phpbb_db_driver_postgres extends phpbb_db_driver $this->connect_error = 'pg_pconnect function does not exist, is pgsql extension installed?'; return $this->sql_error(''); } - $collector = new phpbb_error_collector; + $collector = new \phpbb\error_collector; $collector->install(); $this->db_connect_id = (!$new_link) ? @pg_pconnect($connect_string) : @pg_pconnect($connect_string, PGSQL_CONNECT_FORCE_NEW); } @@ -95,7 +97,7 @@ class phpbb_db_driver_postgres extends phpbb_db_driver $this->connect_error = 'pg_connect function does not exist, is pgsql extension installed?'; return $this->sql_error(''); } - $collector = new phpbb_error_collector; + $collector = new \phpbb\error_collector; $collector->install(); $this->db_connect_id = (!$new_link) ? @pg_connect($connect_string) : @pg_connect($connect_string, PGSQL_CONNECT_FORCE_NEW); } diff --git a/phpBB/phpbb/db/driver/sqlite.php b/phpBB/phpbb/db/driver/sqlite.php index 7188f0daa2..a548fd2618 100644 --- a/phpBB/phpbb/db/driver/sqlite.php +++ b/phpBB/phpbb/db/driver/sqlite.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\driver; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * Minimum Requirement: 2.8.2+ * @package dbal */ -class phpbb_db_driver_sqlite extends phpbb_db_driver +class sqlite extends \phpbb\db\driver\driver { var $connect_error = ''; diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_1.php b/phpBB/phpbb/db/migration/data/30x/3_0_1.php index c996a0138a..2fe0addc06 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_10.php b/phpBB/phpbb/db/migration/data/30x/3_0_10.php index 122f93d6b4..cdf824a9ff 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_10.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_10.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_10 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_10 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_10_rc1.php index 0ed05812dc..ee05fcabaa 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_10_rc1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_10_rc1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_10_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_10_rc2.php index b14b3b00aa..f53a4b0d97 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc2.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_10_rc2.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_10_rc2 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_10_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc3.php b/phpBB/phpbb/db/migration/data/30x/3_0_10_rc3.php index 473057d65d..20456e0458 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc3.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_10_rc3.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_10_rc3 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_10_rc3 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_11.php b/phpBB/phpbb/db/migration/data/30x/3_0_11.php index e063c699cc..5b842cba4b 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_11.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_11.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_11 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_11 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_11_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_11_rc1.php index dddfc0e0e7..1d484a97ca 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_11_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_11_rc1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_11_rc1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_11_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_11_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_11_rc2.php index fac8523e8c..b7e475a87b 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_11_rc2.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_11_rc2.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_11_rc2 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_11_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_12_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_12_rc1.php index 6a31a51201..f1692f8ef7 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_12_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_12_rc1.php @@ -7,9 +7,11 @@ * */ +namespace phpbb\db\migration\datax; + /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 **/ -class phpbb_db_migration_data_30x_3_0_12_rc1 extends phpbb_db_migration +class 3_0_12_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_1_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_1_rc1.php index 562ccf077c..0444de4ac2 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_1_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_1_rc1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_1_rc1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_1_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_2.php b/phpBB/phpbb/db/migration/data/30x/3_0_2.php index eed5acef82..4f9278e2fa 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_2.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_2.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_2 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_2 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_2_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_2_rc1.php index a960e90765..8f709fb769 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_2_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_2_rc1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_2_rc1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_2_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_2_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_2_rc2.php index 8917dfea77..ecbe8bf808 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_2_rc2.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_2_rc2.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_2_rc2 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_2_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_3.php b/phpBB/phpbb/db/migration/data/30x/3_0_3.php index 8984cf7b76..5f94bd9018 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_3.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_3.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_3 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_3 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_3_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_3_rc1.php index 4b102e1a2e..631d382135 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_3_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_3_rc1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_3_rc1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_3_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_4.php b/phpBB/phpbb/db/migration/data/30x/3_0_4.php index 9a0c132e78..369f23f7e7 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_4.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_4.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_4 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_4 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_4_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_4_rc1.php index 8ad75a557b..f98d7a59d0 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_4_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_4_rc1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_4_rc1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_4_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -82,7 +84,7 @@ class phpbb_db_migration_data_30x_3_0_4_rc1 extends phpbb_db_migration public function update_custom_profile_fields() { - // Update the Custom Profile Fields based on previous settings to the new format + // Update the Custom Profile Fields based on previous settings to the new \format $sql = 'SELECT field_id, field_required, field_show_on_reg, field_hide FROM ' . PROFILE_FIELDS_TABLE; $result = $this->db->sql_query($sql); diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_5.php b/phpBB/phpbb/db/migration/data/30x/3_0_5.php index 16d2dee457..9265f09b39 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_5.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_5.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_5 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_5 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1.php index ea17cc1e31..b99313de5d 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_5_rc1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_5_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1part2.php b/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1part2.php index 8538347b1a..65787f9310 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1part2.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1part2.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_5_rc1part2 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_5_rc1part2 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_6.php b/phpBB/phpbb/db/migration/data/30x/3_0_6.php index bb651dc7cd..382fb6cde2 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_6.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_6.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_6 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_6 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc1.php index 38c282ebf0..0b54c3b195 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_6_rc1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_6_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -214,7 +216,7 @@ class phpbb_db_migration_data_30x_3_0_6_rc1 extends phpbb_db_migration $group_id = $this->db->sql_nextid(); } - // Insert new user role... at the end of the chain + // Insert new \user role... at the end of the chain $sql = 'SELECT role_id FROM ' . ACL_ROLES_TABLE . " WHERE role_name = 'ROLE_USER_NEW_MEMBER' @@ -239,7 +241,7 @@ class phpbb_db_migration_data_30x_3_0_6_rc1 extends phpbb_db_migration $u_role = $this->db->sql_nextid(); // Now add the correct data to the roles... - // The standard role says that new users are not able to send a PM, Mass PM, are not able to PM groups + // The standard role says that new \users are not able to send a PM, Mass PM, are not able to PM groups $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $u_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group')"; $this->sql_query($sql); @@ -248,7 +250,7 @@ class phpbb_db_migration_data_30x_3_0_6_rc1 extends phpbb_db_migration $this->sql_query($sql); } - // Insert new forum role + // Insert new \forum role $sql = 'SELECT role_id FROM ' . ACL_ROLES_TABLE . " WHERE role_name = 'ROLE_FORUM_NEW_MEMBER' @@ -276,7 +278,7 @@ class phpbb_db_migration_data_30x_3_0_6_rc1 extends phpbb_db_migration $this->sql_query($sql); } - // Set every members user_new column to 0 (old users) only if there is no one yet (this makes sure we do not execute this more than once) + // Set every members user_new \column to 0 (old users) only if there is no one yet (this makes sure we do not execute this more than once) $sql = 'SELECT 1 FROM ' . USERS_TABLE . ' WHERE user_new = 0'; @@ -318,7 +320,7 @@ class phpbb_db_migration_data_30x_3_0_6_rc1 extends phpbb_db_migration // Clear permissions... include_once($this->phpbb_root_path . 'includes/acp/auth.' . $this->php_ext); - $auth_admin = new auth_admin(); + $auth_admin = new \auth_admin(); $auth_admin->acl_clear_prefetch(); } } diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc2.php index a939dbd489..041224d19a 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc2.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc2.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_6_rc2 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_6_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc3.php b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc3.php index b3f09d8ab8..3183c16efd 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc3.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc3.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_6_rc3 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_6_rc3 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -30,7 +32,7 @@ class phpbb_db_migration_data_30x_3_0_6_rc3 extends phpbb_db_migration public function update_cp_fields() { - // Update the Custom Profile Fields based on previous settings to the new format + // Update the Custom Profile Fields based on previous settings to the new \format $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . ' SET field_show_on_vt = 1 WHERE field_hide = 0 diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc4.php b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc4.php index fc2923f99b..7d75b12130 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc4.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc4.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_6_rc4 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_6_rc4 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_7.php b/phpBB/phpbb/db/migration/data/30x/3_0_7.php index 9ff2e9e4ab..1b1e5d0373 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_7.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_7.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_7 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_7 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_7_pl1.php b/phpBB/phpbb/db/migration/data/30x/3_0_7_pl1.php index c9cc9d19ac..a45c9c3c14 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_7_pl1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_7_pl1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_7_pl1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_7_pl1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_7_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_7_rc1.php index ffebf66f2d..dab90512ab 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_7_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_7_rc1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_7_rc1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_7_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_7_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_7_rc2.php index 55bc2bc679..ea430740c6 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_7_rc2.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_7_rc2.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_7_rc2 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_7_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_8.php b/phpBB/phpbb/db/migration/data/30x/3_0_8.php index 8998ef9627..c08a74e5ee 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_8.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_8.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_8 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_8 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_8_rc1.php index aeff35333e..dce88e249e 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_8_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_8_rc1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_8_rc1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_8_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_9.php b/phpBB/phpbb/db/migration/data/30x/3_0_9.php index d5269ea6f0..8254ac8561 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_9.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_9.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_9 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_9 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc1.php index 4c345b429b..14e0fe6013 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc1.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_9_rc1 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_9_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc2.php index c0e662aa45..44fd789353 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc2.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc2.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_9_rc2 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_9_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc3.php b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc3.php index d6d1f14b2e..e4102fb193 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc3.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc3.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_9_rc3 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_9_rc3 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc4.php b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc4.php index e673249343..5896d11ba5 100644 --- a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc4.php +++ b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc4.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_3_0_9_rc4 extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class 3_0_9_rc4 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/30x/local_url_bbcode.php b/phpBB/phpbb/db/migration/data/30x/local_url_bbcode.php index f324b8880d..360daed437 100644 --- a/phpBB/phpbb/db/migration/data/30x/local_url_bbcode.php +++ b/phpBB/phpbb/db/migration/data/30x/local_url_bbcode.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_30x_local_url_bbcode extends phpbb_db_migration +namespace phpbb\db\migration\datax; + +class local_url_bbcode extends \phpbb\db\migration\migration { static public function depends_on() { @@ -44,7 +46,7 @@ class phpbb_db_migration_data_30x_local_url_bbcode extends phpbb_db_migration $bbcode_match = $row['bbcode_match']; $bbcode_tpl = $row['bbcode_tpl']; - $acp_bbcodes = new acp_bbcodes(); + $acp_bbcodes = new \acp_bbcodes(); $sql_ary = $acp_bbcodes->build_regexp($bbcode_match, $bbcode_tpl); $sql = 'UPDATE ' . BBCODES_TABLE . ' diff --git a/phpBB/phpbb/db/migration/data/310/avatars.php b/phpBB/phpbb/db/migration/data/310/avatars.php index 79547337f7..0d539d0c75 100644 --- a/phpBB/phpbb/db/migration/data/310/avatars.php +++ b/phpBB/phpbb/db/migration/data/310/avatars.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_avatars extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class avatars extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/310/boardindex.php b/phpBB/phpbb/db/migration/data/310/boardindex.php index 965e32c15c..ee403a7360 100644 --- a/phpBB/phpbb/db/migration/data/310/boardindex.php +++ b/phpBB/phpbb/db/migration/data/310/boardindex.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_boardindex extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class boardindex extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/310/config_db_text.php b/phpBB/phpbb/db/migration/data/310/config_db_text.php index 89f211adda..932edf39d7 100644 --- a/phpBB/phpbb/db/migration/data/310/config_db_text.php +++ b/phpBB/phpbb/db/migration/data/310/config_db_text.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_config_db_text extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class config_db_text extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/310/dev.php b/phpBB/phpbb/db/migration/data/310/dev.php index 0fc2950987..702073bcdd 100644 --- a/phpBB/phpbb/db/migration/data/310/dev.php +++ b/phpBB/phpbb/db/migration/data/310/dev.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_dev extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class dev extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -17,10 +19,10 @@ class phpbb_db_migration_data_310_dev extends phpbb_db_migration static public function depends_on() { return array( - 'phpbb_db_migration_data_310_extensions', - 'phpbb_db_migration_data_310_style_update_p2', - 'phpbb_db_migration_data_310_timezone_p2', - 'phpbb_db_migration_data_310_reported_posts_display', + '\phpbb\db\migration\data0\extensions', + '\phpbb\db\migration\data0\style_update_p2', + '\phpbb\db\migration\data0\timezone_p2', + '\phpbb\db\migration\data0\reported_posts_display', ); } @@ -183,7 +185,7 @@ class phpbb_db_migration_data_310_dev extends phpbb_db_migration public function move_customise_modules() { - // Move language management to new location in the Customise tab + // Move language management to new \location in the Customise tab // First get language module id $sql = 'SELECT module_id FROM ' . MODULES_TABLE . " WHERE module_basename = 'acp_language'"; @@ -206,7 +208,7 @@ class phpbb_db_migration_data_310_dev extends phpbb_db_migration { include($this->phpbb_root_path . 'includes/functions_acp.' . $this->php_ext); } - $module_manager = new acp_modules(); + $module_manager = new \acp_modules(); $module_manager->module_class = 'acp'; $module_manager->move_module($language_module_id, $language_management_module_id); } diff --git a/phpBB/phpbb/db/migration/data/310/extensions.php b/phpBB/phpbb/db/migration/data/310/extensions.php index 6a9caa1cfc..fde2038cca 100644 --- a/phpBB/phpbb/db/migration/data/310/extensions.php +++ b/phpBB/phpbb/db/migration/data/310/extensions.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_extensions extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class extensions extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/310/forgot_password.php b/phpBB/phpbb/db/migration/data/310/forgot_password.php index a553e51f35..9a42565223 100644 --- a/phpBB/phpbb/db/migration/data/310/forgot_password.php +++ b/phpBB/phpbb/db/migration/data/310/forgot_password.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_forgot_password extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class forgot_password extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/310/jquery_update.php b/phpBB/phpbb/db/migration/data/310/jquery_update.php index dc49f74fcb..2b30e2dd3b 100644 --- a/phpBB/phpbb/db/migration/data/310/jquery_update.php +++ b/phpBB/phpbb/db/migration/data/310/jquery_update.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_jquery_update extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class jquery_update extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -17,7 +19,7 @@ class phpbb_db_migration_data_310_jquery_update extends phpbb_db_migration static public function depends_on() { return array( - 'phpbb_db_migration_data_310_dev', + '\phpbb\db\migration\data0\dev', ); } diff --git a/phpBB/phpbb/db/migration/data/310/notification_options_reconvert.php b/phpBB/phpbb/db/migration/data/310/notification_options_reconvert.php index d994d7ec5f..482051c287 100644 --- a/phpBB/phpbb/db/migration/data/310/notification_options_reconvert.php +++ b/phpBB/phpbb/db/migration/data/310/notification_options_reconvert.php @@ -7,11 +7,13 @@ * */ -class phpbb_db_migration_data_310_notification_options_reconvert extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class notification_options_reconvert extends \phpbb\db\migration\migration { static public function depends_on() { - return array('phpbb_db_migration_data_310_notifications_schema_fix'); + return array('\phpbb\db\migration\data0\notifications_schema_fix'); } public function update_data() @@ -24,7 +26,7 @@ class phpbb_db_migration_data_310_notification_options_reconvert extends phpbb_d public function convert_notifications() { $insert_table = $this->table_prefix . 'user_notifications'; - $insert_buffer = new phpbb_db_sql_insert_buffer($this->db, $insert_table); + $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $insert_table); $this->perform_conversion($insert_buffer, $insert_table); } @@ -32,10 +34,10 @@ class phpbb_db_migration_data_310_notification_options_reconvert extends phpbb_d /** * Perform the conversion (separate for testability) * - * @param phpbb_db_sql_insert_buffer $insert_buffer + * @param \phpbb\db\sql_insert_buffer $insert_buffer * @param string $insert_table */ - public function perform_conversion(phpbb_db_sql_insert_buffer $insert_buffer, $insert_table) + public function perform_conversion(\phpbb\db\sql_insert_buffer $insert_buffer, $insert_table) { $sql = 'DELETE FROM ' . $insert_table; $this->db->sql_query($sql); @@ -94,13 +96,13 @@ class phpbb_db_migration_data_310_notification_options_reconvert extends phpbb_d /** * Insert method rows to DB * - * @param phpbb_db_sql_insert_buffer $insert_buffer + * @param \phpbb\db\sql_insert_buffer $insert_buffer * @param string $item_type * @param int $item_id * @param int $user_id * @param string $methods */ - protected function add_method_rows(phpbb_db_sql_insert_buffer $insert_buffer, $item_type, $item_id, $user_id, array $methods) + protected function add_method_rows(\phpbb\db\sql_insert_buffer $insert_buffer, $item_type, $item_id, $user_id, array $methods) { $row_base = array( 'item_type' => $item_type, diff --git a/phpBB/phpbb/db/migration/data/310/notifications.php b/phpBB/phpbb/db/migration/data/310/notifications.php index 17c939d95a..f5bd9ebf07 100644 --- a/phpBB/phpbb/db/migration/data/310/notifications.php +++ b/phpBB/phpbb/db/migration/data/310/notifications.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_notifications extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class notifications extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -16,7 +18,7 @@ class phpbb_db_migration_data_310_notifications extends phpbb_db_migration static public function depends_on() { - return array('phpbb_db_migration_data_310_dev'); + return array('\phpbb\db\migration\data0\dev'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/310/notifications_schema_fix.php b/phpBB/phpbb/db/migration/data/310/notifications_schema_fix.php index 27e63e10d0..fa2da6fe92 100644 --- a/phpBB/phpbb/db/migration/data/310/notifications_schema_fix.php +++ b/phpBB/phpbb/db/migration/data/310/notifications_schema_fix.php @@ -7,11 +7,13 @@ * */ -class phpbb_db_migration_data_310_notifications_schema_fix extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class notifications_schema_fix extends \phpbb\db\migration\migration { static public function depends_on() { - return array('phpbb_db_migration_data_310_notifications'); + return array('\phpbb\db\migration\data0\notifications'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/310/reported_posts_display.php b/phpBB/phpbb/db/migration/data/310/reported_posts_display.php index 80a0a0e43f..ef35f48970 100644 --- a/phpBB/phpbb/db/migration/data/310/reported_posts_display.php +++ b/phpBB/phpbb/db/migration/data/310/reported_posts_display.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_reported_posts_display extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class reported_posts_display extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/310/signature_module_auth.php b/phpBB/phpbb/db/migration/data/310/signature_module_auth.php index e4fbb27bcb..27585fec10 100644 --- a/phpBB/phpbb/db/migration/data/310/signature_module_auth.php +++ b/phpBB/phpbb/db/migration/data/310/signature_module_auth.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_signature_module_auth extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class signature_module_auth extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/310/softdelete_p1.php b/phpBB/phpbb/db/migration/data/310/softdelete_p1.php index 84f8eebd4a..22ee78bb22 100644 --- a/phpBB/phpbb/db/migration/data/310/softdelete_p1.php +++ b/phpBB/phpbb/db/migration/data/310/softdelete_p1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_softdelete_p1 extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class softdelete_p1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -16,7 +18,7 @@ class phpbb_db_migration_data_310_softdelete_p1 extends phpbb_db_migration static public function depends_on() { - return array('phpbb_db_migration_data_310_dev'); + return array('\phpbb\db\migration\data0\dev'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/310/softdelete_p2.php b/phpBB/phpbb/db/migration/data/310/softdelete_p2.php index 7320a2c2bf..698e44fab7 100644 --- a/phpBB/phpbb/db/migration/data/310/softdelete_p2.php +++ b/phpBB/phpbb/db/migration/data/310/softdelete_p2.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_softdelete_p2 extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class softdelete_p2 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -17,8 +19,8 @@ class phpbb_db_migration_data_310_softdelete_p2 extends phpbb_db_migration static public function depends_on() { return array( - 'phpbb_db_migration_data_310_dev', - 'phpbb_db_migration_data_310_softdelete_p1', + '\phpbb\db\migration\data0\dev', + '\phpbb\db\migration\data0\softdelete_p1', ); } diff --git a/phpBB/phpbb/db/migration/data/310/style_update_p1.php b/phpBB/phpbb/db/migration/data/310/style_update_p1.php index d43537559d..fe60993f20 100644 --- a/phpBB/phpbb/db/migration/data/310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/310/style_update_p1.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_style_update_p1 extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class style_update_p1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -59,7 +61,7 @@ class phpbb_db_migration_data_310_style_update_p1 extends phpbb_db_migration // Get list of valid 3.1 styles $available_styles = array('prosilver'); - $iterator = new DirectoryIterator($this->phpbb_root_path . 'styles'); + $iterator = new \DirectoryIterator($this->phpbb_root_path . 'styles'); $skip_dirs = array('.', '..', 'prosilver'); foreach ($iterator as $fileinfo) { diff --git a/phpBB/phpbb/db/migration/data/310/style_update_p2.php b/phpBB/phpbb/db/migration/data/310/style_update_p2.php index 7b10518a66..3f6477b7cb 100644 --- a/phpBB/phpbb/db/migration/data/310/style_update_p2.php +++ b/phpBB/phpbb/db/migration/data/310/style_update_p2.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_style_update_p2 extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class style_update_p2 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -16,7 +18,7 @@ class phpbb_db_migration_data_310_style_update_p2 extends phpbb_db_migration static public function depends_on() { - return array('phpbb_db_migration_data_310_style_update_p1'); + return array('\phpbb\db\migration\data0\style_update_p1'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/310/teampage.php b/phpBB/phpbb/db/migration/data/310/teampage.php index 4e77da17b7..605156dc41 100644 --- a/phpBB/phpbb/db/migration/data/310/teampage.php +++ b/phpBB/phpbb/db/migration/data/310/teampage.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_teampage extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class teampage extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -16,7 +18,7 @@ class phpbb_db_migration_data_310_teampage extends phpbb_db_migration static public function depends_on() { - return array('phpbb_db_migration_data_310_dev'); + return array('\phpbb\db\migration\data0\dev'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/310/timezone.php b/phpBB/phpbb/db/migration/data/310/timezone.php index 6e50cbe45f..97fea19a64 100644 --- a/phpBB/phpbb/db/migration/data/310/timezone.php +++ b/phpBB/phpbb/db/migration/data/310/timezone.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_timezone extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class timezone extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -63,12 +65,12 @@ class phpbb_db_migration_data_310_timezone extends phpbb_db_migration } /** - * Determine the new timezone for a given phpBB 3.0 timezone and + * Determine the new \timezone for a given phpBB 3.0 timezone and * "Daylight Saving Time" option * * @param $timezone float Users timezone in 3.0 * @param $dst int Users daylight saving time - * @return string Users new php Timezone which is used since 3.1 + * @return string Users new \php Timezone which is used since 3.1 */ public function convert_phpbb30_timezone($timezone, $dst) { diff --git a/phpBB/phpbb/db/migration/data/310/timezone_p2.php b/phpBB/phpbb/db/migration/data/310/timezone_p2.php index 113b979e4f..0c174b0d56 100644 --- a/phpBB/phpbb/db/migration/data/310/timezone_p2.php +++ b/phpBB/phpbb/db/migration/data/310/timezone_p2.php @@ -7,7 +7,9 @@ * */ -class phpbb_db_migration_data_310_timezone_p2 extends phpbb_db_migration +namespace phpbb\db\migration\data0; + +class timezone_p2 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -16,7 +18,7 @@ class phpbb_db_migration_data_310_timezone_p2 extends phpbb_db_migration static public function depends_on() { - return array('phpbb_db_migration_data_310_timezone'); + return array('\phpbb\db\migration\data0\timezone'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/exception.php b/phpBB/phpbb/db/migration/exception.php index e84330dd71..8bf18dec68 100644 --- a/phpBB/phpbb/db/migration/exception.php +++ b/phpBB/phpbb/db/migration/exception.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\migration; + /** * @ignore */ @@ -16,11 +18,11 @@ if (!defined('IN_PHPBB')) } /** -* The migrator is responsible for applying new migrations in the correct order. +* The migrator is responsible for applying new \migrations in the correct order. * * @package db */ -class phpbb_db_migration_exception extends \Exception +class exception extends \Exception { /** * Extra parameters sent to exception to aid in debugging @@ -64,12 +66,12 @@ class phpbb_db_migration_exception extends \Exception } /** - * Get localised message (with $user->lang()) + * Get localised message (\with $user->lang()) * - * @param phpbb_user $user + * @param \phpbb\user $user * @return string */ - public function getLocalisedMessage(phpbb_user $user) + public function getLocalisedMessage(\phpbb\user $user) { $parameters = $this->getParameters(); array_unshift($parameters, $this->getMessage()); diff --git a/phpBB/phpbb/db/migration/migration.php b/phpBB/phpbb/db/migration/migration.php index 0ffa96fd14..aff3837279 100644 --- a/phpBB/phpbb/db/migration/migration.php +++ b/phpBB/phpbb/db/migration/migration.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db\migration; + /** * @ignore */ @@ -24,15 +26,15 @@ if (!defined('IN_PHPBB')) * * @package db */ -abstract class phpbb_db_migration +abstract class migration { - /** @var phpbb_config */ + /** @var \phpbb\config\config */ protected $config; - /** @var phpbb_db_driver */ + /** @var \phpbb\db\driver\driver */ protected $db; - /** @var phpbb_db_tools */ + /** @var \phpbb\db\tools */ protected $db_tools; /** @var string */ @@ -53,14 +55,14 @@ abstract class phpbb_db_migration /** * Constructor * - * @param phpbb_config $config - * @param phpbb_db_driver $db - * @param phpbb_db_tools $db_tools + * @param \phpbb\config\config $config + * @param \phpbb\db\driver\driver $db + * @param \phpbb\db\tools $db_tools * @param string $phpbb_root_path * @param string $php_ext * @param string $table_prefix */ - public function __construct(phpbb_config $config, phpbb_db_driver $db, phpbb_db_tools $db_tools, $phpbb_root_path, $php_ext, $table_prefix) + public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\db\tools $db_tools, $phpbb_root_path, $php_ext, $table_prefix) { $this->config = $config; $this->db = $db; diff --git a/phpBB/phpbb/db/migration/tool/config.php b/phpBB/phpbb/db/migration/tool/config.php index 5dd47cfa60..6ff69bbd2b 100644 --- a/phpBB/phpbb/db/migration/tool/config.php +++ b/phpBB/phpbb/db/migration/tool/config.php @@ -7,22 +7,24 @@ * */ +namespace phpbb\db\migration\tool; + /** * Migration config tool * * @package db */ -class phpbb_db_migration_tool_config implements phpbb_db_migration_tool_tool_interface +class config implements \phpbb\db\migration\tool\tool_interface { - /** @var phpbb_config */ + /** @var \phpbb\config\config */ protected $config; /** * Constructor * - * @param phpbb_config $config + * @param \phpbb\config\config $config */ - public function __construct(phpbb_config $config) + public function __construct(\phpbb\config\config $config) { $this->config = $config; } @@ -67,7 +69,7 @@ class phpbb_db_migration_tool_config implements phpbb_db_migration_tool_tool_int { if (!isset($this->config[$config_name])) { - throw new phpbb_db_migration_exception('CONFIG_NOT_EXIST', $config_name); + throw new \phpbb\db\migration\exception('CONFIG_NOT_EXIST', $config_name); } $this->config->set($config_name, $config_value); @@ -78,7 +80,7 @@ class phpbb_db_migration_tool_config implements phpbb_db_migration_tool_tool_int * current config value * * @param string $compare If equal to the current config value, will be - * updated to the new config value, otherwise not + * updated to the new \config value, otherwise not * @param string $config_name The name of the config setting you would * like to update * @param mixed $config_value The value of the config setting @@ -88,7 +90,7 @@ class phpbb_db_migration_tool_config implements phpbb_db_migration_tool_tool_int { if (!isset($this->config[$config_name])) { - throw new phpbb_db_migration_exception('CONFIG_NOT_EXIST', $config_name); + throw new \phpbb\db\migration\exception('CONFIG_NOT_EXIST', $config_name); } $this->config->set_atomic($config_name, $compare, $config_value); diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 8ed2a933ff..ecb1176bd4 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -7,20 +7,22 @@ * */ +namespace phpbb\db\migration\tool; + /** * Migration module management tool * * @package db */ -class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_interface +class module implements \phpbb\db\migration\tool\tool_interface { - /** @var phpbb_cache_service */ + /** @var \phpbb\cache\service */ protected $cache; /** @var dbal */ protected $db; - /** @var phpbb_user */ + /** @var \phpbb\user */ protected $user; /** @var string */ @@ -35,14 +37,14 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_int /** * Constructor * - * @param phpbb_db_driver $db + * @param \phpbb\db\driver\driver $db * @param mixed $cache - * @param phpbb_user $user + * @param \phpbb\user $user * @param string $phpbb_root_path * @param string $php_ext * @param string $modules_table */ - public function __construct(phpbb_db_driver $db, phpbb_cache_service $cache, phpbb_user $user, $phpbb_root_path, $php_ext, $modules_table) + public function __construct(\phpbb\db\driver\driver $db, \phpbb\cache\service $cache, \phpbb\user $user, $phpbb_root_path, $php_ext, $modules_table) { $this->db = $db; $this->cache = $cache; @@ -129,11 +131,11 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_int /** * Module Add * - * Add a new module + * Add a new \module * * @param string $class The module class(acp|mcp|ucp) * @param int|string $parent The parent module_id|module_langname (0 for no parent) - * @param array $data an array of the data on the new module. + * @param array $data an array of the data on the new \module. * This can be setup in two different ways. * 1. The "manual" way. For inserting a category or one at a time. * It will be merged with the base array shown a bit below, @@ -221,14 +223,14 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_int if (!$module_id) { - throw new phpbb_db_migration_exception('MODULE_NOT_EXIST', $parent); + throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent); } $parent = $data['parent_id'] = $module_id; } else if (!$this->exists($class, false, $parent)) { - throw new phpbb_db_migration_exception('MODULE_NOT_EXIST', $parent); + throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent); } if ($this->exists($class, $parent, $data['module_langname'])) @@ -241,7 +243,7 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_int include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); $this->user->add_lang('acp/modules'); } - $acp_modules = new acp_modules(); + $acp_modules = new \acp_modules(); $module_data = array( 'module_enabled' => (isset($data['module_enabled'])) ? $data['module_enabled'] : 1, @@ -259,7 +261,7 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_int if (is_string($result)) { // Error - throw new phpbb_db_migration_exception('MODULE_ERROR', $result); + throw new \phpbb\db\migration\exception('MODULE_ERROR', $result); } else { @@ -347,7 +349,7 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_int // Failed. if (!isset($module['module_basename'])) { - throw new phpbb_db_migration_exception('MODULE_NOT_EXIST'); + throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST'); } // Automatic method @@ -433,7 +435,7 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_int include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); $this->user->add_lang('acp/modules'); } - $acp_modules = new acp_modules(); + $acp_modules = new \acp_modules(); $acp_modules->module_class = $class; foreach ($module_ids as $module_id) @@ -476,7 +478,7 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_int } /** - * Wrapper for acp_modules::get_module_infos() + * Wrapper for \acp_modules::get_module_infos() * * @param string $class Module Class * @param string $basename Module Basename @@ -488,12 +490,12 @@ class phpbb_db_migration_tool_module implements phpbb_db_migration_tool_tool_int { include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); } - $acp_modules = new acp_modules(); + $acp_modules = new \acp_modules(); $module = $acp_modules->get_module_infos($basename, $class, true); if (empty($module)) { - throw new phpbb_db_migration_exception('MODULE_INFO_FILE_NOT_EXIST', $class, $basename); + throw new \phpbb\db\migration\exception('MODULE_INFO_FILE_NOT_EXIST', $class, $basename); } return array_pop($module); diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index f1140d0759..51b0996c30 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -7,17 +7,19 @@ * */ +namespace phpbb\db\migration\tool; + /** * Migration permission management tool * * @package db */ -class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool_interface +class permission implements \phpbb\db\migration\tool\tool_interface { - /** @var phpbb_auth */ + /** @var \phpbb\auth\auth */ protected $auth; - /** @var phpbb_cache_service */ + /** @var \phpbb\cache\service */ protected $cache; /** @var dbal */ @@ -32,13 +34,13 @@ class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool /** * Constructor * - * @param phpbb_db_driver $db + * @param \phpbb\db\driver\driver $db * @param mixed $cache - * @param phpbb_auth $auth + * @param \phpbb\auth\auth $auth * @param string $phpbb_root_path * @param string $php_ext */ - public function __construct(phpbb_db_driver $db, phpbb_cache_service $cache, phpbb_auth $auth, $phpbb_root_path, $php_ext) + public function __construct(\phpbb\db\driver\driver $db, \phpbb\cache\service $cache, \phpbb\auth\auth $auth, $phpbb_root_path, $php_ext) { $this->db = $db; $this->cache = $cache; @@ -117,7 +119,7 @@ class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool { include($this->phpbb_root_path . 'includes/acp/auth.' . $this->php_ext); } - $auth_admin = new auth_admin(); + $auth_admin = new \auth_admin(); // We have to add a check to see if the !$global (if global, local, and if local, global) permission already exists. If it does, acl_add_option currently has a bug which would break the ACL system, so we are having a work-around here. if ($this->exists($auth_option, !$global)) @@ -236,9 +238,9 @@ class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool } /** - * Add a new permission role + * Add a new \permission role * - * @param string $role_name The new role name + * @param string $role_name The new \role name * @param sting $role_type The type (u_, m_, a_) * @return null */ @@ -277,7 +279,7 @@ class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool * Update the name on a permission role * * @param string $old_role_name The old role name - * @param string $new_role_name The new role name + * @param string $new_role_name The new \role name * @return null */ public function role_update($old_role_name, $new_role_name) @@ -290,7 +292,7 @@ class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool if (!$role_id) { - throw new phpbb_db_migration_exception('ROLE_NOT_EXIST', $old_role_name); + throw new \phpbb\db\migration\exception('ROLE_NOT_EXIST', $old_role_name); } $sql = 'UPDATE ' . ACL_ROLES_TABLE . " @@ -380,7 +382,7 @@ class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool if (!$role_id) { - throw new phpbb_db_migration_exception('ROLE_NOT_EXIST', $name); + throw new \phpbb\db\migration\exception('ROLE_NOT_EXIST', $name); } $sql = 'SELECT auth_option_id, auth_setting @@ -403,7 +405,7 @@ class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool if (!$group_id) { - throw new phpbb_db_migration_exception('GROUP_NOT_EXIST', $name); + throw new \phpbb\db\migration\exception('GROUP_NOT_EXIST', $name); } // If the group has a role set for them we will add the requested permissions to that role. @@ -523,7 +525,7 @@ class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool if (!$role_id) { - throw new phpbb_db_migration_exception('ROLE_NOT_EXIST', $name); + throw new \phpbb\db\migration\exception('ROLE_NOT_EXIST', $name); } $sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' @@ -540,7 +542,7 @@ class phpbb_db_migration_tool_permission implements phpbb_db_migration_tool_tool if (!$group_id) { - throw new phpbb_db_migration_exception('GROUP_NOT_EXIST', $name); + throw new \phpbb\db\migration\exception('GROUP_NOT_EXIST', $name); } // If the group has a role set for them we will remove the requested permissions from that role. diff --git a/phpBB/phpbb/db/migration/tool/tool_interface.php b/phpBB/phpbb/db/migration/tool/tool_interface.php index 72344d50d2..e7b89d8858 100644 --- a/phpBB/phpbb/db/migration/tool/tool_interface.php +++ b/phpBB/phpbb/db/migration/tool/tool_interface.php @@ -7,12 +7,14 @@ * */ +namespace phpbb\db\migration\tool; + /** * Migration tool interface * * @package db */ -interface phpbb_db_migration_tool_tool_interface +interface tool_interface { /** * Retrieve a short name used for commands in migrations. diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index ca3ffc8043..0b9463a622 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db; + /** * @ignore */ @@ -16,19 +18,19 @@ if (!defined('IN_PHPBB')) } /** -* The migrator is responsible for applying new migrations in the correct order. +* The migrator is responsible for applying new \migrations in the correct order. * * @package db */ -class phpbb_db_migrator +class migrator { - /** @var phpbb_config */ + /** @var \phpbb\config\config */ protected $config; - /** @var phpbb_db_driver */ + /** @var \phpbb\db\driver\driver */ protected $db; - /** @var phpbb_db_tools */ + /** @var \phpbb\db\tools */ protected $db_tools; /** @var string */ @@ -71,7 +73,7 @@ class phpbb_db_migrator /** * Constructor of the database migrator */ - public function __construct(phpbb_config $config, phpbb_db_driver $db, phpbb_db_tools $db_tools, $migrations_table, $phpbb_root_path, $php_ext, $table_prefix, $tools) + public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\db\tools $db_tools, $migrations_table, $phpbb_root_path, $php_ext, $table_prefix, $tools) { $this->config = $config; $this->db = $db; @@ -240,7 +242,7 @@ class phpbb_db_migrator $state['migration_data_done'] = ($result === true); $state['migration_end_time'] = ($result === true) ? time() : 0; } - catch (phpbb_db_migration_exception $e) + catch (\phpbb\db\migration\exception $e) { // Revert the schema changes $this->revert($name); @@ -398,7 +400,7 @@ class phpbb_db_migrator )); } } - catch (phpbb_db_migration_exception $e) + catch (\phpbb\db\migration\exception $e) { // We should try rolling back here foreach ($steps as $reverse_step_identifier => $reverse_step) @@ -474,12 +476,12 @@ class phpbb_db_migrator case 'if': if (!isset($parameters[0])) { - throw new phpbb_db_migration_exception('MIGRATION_INVALID_DATA_MISSING_CONDITION', $step); + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_MISSING_CONDITION', $step); } if (!isset($parameters[1])) { - throw new phpbb_db_migration_exception('MIGRATION_INVALID_DATA_MISSING_STEP', $step); + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_MISSING_STEP', $step); } $condition = $parameters[0]; @@ -496,7 +498,7 @@ class phpbb_db_migrator case 'custom': if (!is_callable($parameters[0])) { - throw new phpbb_db_migration_exception('MIGRATION_INVALID_DATA_CUSTOM_NOT_CALLABLE', $step); + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_CUSTOM_NOT_CALLABLE', $step); } return array( @@ -508,17 +510,17 @@ class phpbb_db_migrator default: if (!$method) { - throw new phpbb_db_migration_exception('MIGRATION_INVALID_DATA_UNKNOWN_TYPE', $step); + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_UNKNOWN_TYPE', $step); } if (!isset($this->tools[$class])) { - throw new phpbb_db_migration_exception('MIGRATION_INVALID_DATA_UNDEFINED_TOOL', $step); + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_UNDEFINED_TOOL', $step); } if (!method_exists(get_class($this->tools[$class]), $method)) { - throw new phpbb_db_migration_exception('MIGRATION_INVALID_DATA_UNDEFINED_METHOD', $step); + throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_UNDEFINED_METHOD', $step); } // Attempt to reverse operations @@ -656,7 +658,7 @@ class phpbb_db_migrator * Helper to get a migration * * @param string $name Name of the migration - * @return phpbb_db_migration + * @return \phpbb\db\migration\migration */ protected function get_migration($name) { @@ -694,7 +696,7 @@ class phpbb_db_migrator /** * Load migration data files from a directory * - * @param phpbb_extension_finder $finder + * @param \phpbb\extension\finder $finder * @param string $path Path to migration data files * @param bool $check_fulfillable If TRUE (default), we will check * if all of the migrations are fulfillable after loading them. @@ -703,11 +705,11 @@ class phpbb_db_migrator * with the last call to prevent throwing errors unnecessarily). * @return array Array of migration names */ - public function load_migrations(phpbb_extension_finder $finder, $path, $check_fulfillable = true) + public function load_migrations(\phpbb\extension\finder $finder, $path, $check_fulfillable = true) { if (!is_dir($path)) { - throw new phpbb_db_migration_exception('DIRECTORY INVALID', $path); + throw new \phpbb\db\migration\exception('DIRECTORY INVALID', $path); } $migrations = array(); @@ -736,7 +738,7 @@ class phpbb_db_migrator $unfulfillable = $this->unfulfillable($name); if ($unfulfillable !== false) { - throw new phpbb_db_migration_exception('MIGRATION_NOT_FULFILLABLE', $name, $unfulfillable); + throw new \phpbb\db\migration\exception('MIGRATION_NOT_FULFILLABLE', $name, $unfulfillable); } } } diff --git a/phpBB/phpbb/db/sql_insert_buffer.php b/phpBB/phpbb/db/sql_insert_buffer.php index c18f908429..7bbd213bdc 100644 --- a/phpBB/phpbb/db/sql_insert_buffer.php +++ b/phpBB/phpbb/db/sql_insert_buffer.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db; + /** * @ignore */ @@ -38,7 +40,7 @@ if (!defined('IN_PHPBB')) * * Usage: * -* $buffer = new phpbb_db_sql_insert_buffer($db, 'test_table', 1234); +* $buffer = new \phpbb\db\sql_insert_buffer($db, 'test_table', 1234); * * while (do_stuff()) * { @@ -53,9 +55,9 @@ if (!defined('IN_PHPBB')) * * @package dbal */ -class phpbb_db_sql_insert_buffer +class sql_insert_buffer { - /** @var phpbb_db_driver */ + /** @var \phpbb\db\driver\driver */ protected $db; /** @var string */ @@ -68,11 +70,11 @@ class phpbb_db_sql_insert_buffer protected $buffer = array(); /** - * @param phpbb_db_driver $db + * @param \phpbb\db\driver\driver $db * @param string $table_name * @param int $max_buffered_rows */ - public function __construct(phpbb_db_driver $db, $table_name, $max_buffered_rows = 500) + public function __construct(\phpbb\db\driver\driver $db, $table_name, $max_buffered_rows = 500) { $this->db = $db; $this->table_name = $table_name; diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index 492284ffcd..35b89e8166 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\db; + /** * @ignore */ @@ -21,7 +23,7 @@ if (!defined('IN_PHPBB')) * * @package dbal */ -class phpbb_db_tools +class tools { /** * Current sql layer @@ -300,10 +302,10 @@ class phpbb_db_tools /** * Constructor. Set DB Object and set {@link $return_statements return_statements}. * - * @param phpbb_db_driver $db Database connection + * @param \phpbb\db\driver\driver $db Database connection * @param bool $return_statements True if only statements should be returned and no SQL being executed */ - public function __construct(phpbb_db_driver $db, $return_statements = false) + public function __construct(\phpbb\db\driver\driver $db, $return_statements = false) { $this->db = $db; $this->return_statements = $return_statements; @@ -491,7 +493,7 @@ class phpbb_db_tools trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR); } - // here we add the definition of the new column to the list of columns + // here we add the definition of the new \column to the list of columns switch ($this->sql_layer) { case 'mssql': @@ -978,7 +980,7 @@ class phpbb_db_tools $column_list[] = $entities[0]; } - // note down the primary key notation because sqlite only supports adding it to the end for the new table + // note down the primary key notation because sqlite only supports adding it to the end for the new \table $primary_key = false; $_new_cols = array(); @@ -1058,7 +1060,7 @@ class phpbb_db_tools { $new_table_cols[] = 'PRIMARY KEY (' . implode(', ', $sql_schema_changes['primary_key']) . ')'; } - // Add a new one or the old primary key + // Add a new \one or the old primary key else if ($primary_key !== false) { $new_table_cols[] = $primary_key; @@ -1066,7 +1068,7 @@ class phpbb_db_tools $columns = implode(',', $column_list); - // create a new table and fill it up. destroy the temp one + // create a new \table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $new_table_cols) . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -1689,7 +1691,7 @@ class phpbb_db_tools } /** - * Add new column + * Add new \column */ function sql_column_add($table_name, $column_name, $column_data, $inline = false) { @@ -1798,7 +1800,7 @@ class phpbb_db_tools $new_table_cols = $column_name . ' ' . $column_data['column_type_sql'] . ',' . $new_table_cols; - // create a new table and fill it up. destroy the temp one + // create a new \table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -1913,7 +1915,7 @@ class phpbb_db_tools $new_table_cols = preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols); - // create a new table and fill it up. destroy the temp one + // create a new \table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -2105,7 +2107,7 @@ class phpbb_db_tools $columns = implode(',', $column_list); - // create a new table and fill it up. destroy the temp one + // create a new \table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ', PRIMARY KEY (' . implode(', ', $column) . '));'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -2471,7 +2473,7 @@ class phpbb_db_tools $columns = implode(',', $column_list); - // create a new table and fill it up. destroy the temp one + // create a new \table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $old_table_cols) . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; -- cgit v1.2.1 From e1239b455fb4e8c5fcc80e9890c501e70ff8f1e4 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 14:17:47 +0200 Subject: [ticket/11700] Namespaces and class names should not start with digits PHPBB3-11700 --- phpBB/phpbb/db/migration/data/30x/3_0_1.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_10.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_10_rc1.php | 32 -- phpBB/phpbb/db/migration/data/30x/3_0_10_rc2.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_10_rc3.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_11.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_11_rc1.php | 97 ----- phpBB/phpbb/db/migration/data/30x/3_0_11_rc2.php | 52 --- phpBB/phpbb/db/migration/data/30x/3_0_12_rc1.php | 125 ------- phpBB/phpbb/db/migration/data/30x/3_0_1_rc1.php | 110 ------ phpBB/phpbb/db/migration/data/30x/3_0_2.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_2_rc1.php | 34 -- phpBB/phpbb/db/migration/data/30x/3_0_2_rc2.php | 82 ----- phpBB/phpbb/db/migration/data/30x/3_0_3.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_3_rc1.php | 85 ----- phpBB/phpbb/db/migration/data/30x/3_0_4.php | 51 --- phpBB/phpbb/db/migration/data/30x/3_0_4_rc1.php | 125 ------- phpBB/phpbb/db/migration/data/30x/3_0_5.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_5_rc1.php | 126 ------- .../phpbb/db/migration/data/30x/3_0_5_rc1part2.php | 44 --- phpBB/phpbb/db/migration/data/30x/3_0_6.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_6_rc1.php | 326 ---------------- phpBB/phpbb/db/migration/data/30x/3_0_6_rc2.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_6_rc3.php | 42 --- phpBB/phpbb/db/migration/data/30x/3_0_6_rc4.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_7.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_7_pl1.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_7_rc1.php | 78 ---- phpBB/phpbb/db/migration/data/30x/3_0_7_rc2.php | 75 ---- phpBB/phpbb/db/migration/data/30x/3_0_8.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_8_rc1.php | 223 ----------- phpBB/phpbb/db/migration/data/30x/3_0_9.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_9_rc1.php | 126 ------- phpBB/phpbb/db/migration/data/30x/3_0_9_rc2.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_9_rc3.php | 30 -- phpBB/phpbb/db/migration/data/30x/3_0_9_rc4.php | 30 -- .../db/migration/data/30x/local_url_bbcode.php | 59 --- phpBB/phpbb/db/migration/data/310/avatars.php | 69 ---- phpBB/phpbb/db/migration/data/310/boardindex.php | 25 -- .../phpbb/db/migration/data/310/config_db_text.php | 47 --- phpBB/phpbb/db/migration/data/310/dev.php | 410 --------------------- phpBB/phpbb/db/migration/data/310/extensions.php | 71 ---- .../db/migration/data/310/forgot_password.php | 30 -- .../phpbb/db/migration/data/310/jquery_update.php | 33 -- .../data/310/notification_options_reconvert.php | 120 ------ .../phpbb/db/migration/data/310/notifications.php | 98 ----- .../data/310/notifications_schema_fix.php | 94 ----- .../migration/data/310/reported_posts_display.php | 49 --- .../migration/data/310/signature_module_auth.php | 53 --- .../phpbb/db/migration/data/310/softdelete_p1.php | 173 --------- .../phpbb/db/migration/data/310/softdelete_p2.php | 70 ---- .../db/migration/data/310/style_update_p1.php | 187 ---------- .../db/migration/data/310/style_update_p2.php | 131 ------- phpBB/phpbb/db/migration/data/310/teampage.php | 106 ------ phpBB/phpbb/db/migration/data/310/timezone.php | 165 --------- phpBB/phpbb/db/migration/data/310/timezone_p2.php | 45 --- .../db/migration/data/v30x/local_url_bbcode.php | 59 +++ .../phpbb/db/migration/data/v30x/release_3_0_1.php | 30 ++ .../db/migration/data/v30x/release_3_0_10.php | 30 ++ .../db/migration/data/v30x/release_3_0_10_rc1.php | 32 ++ .../db/migration/data/v30x/release_3_0_10_rc2.php | 30 ++ .../db/migration/data/v30x/release_3_0_10_rc3.php | 30 ++ .../db/migration/data/v30x/release_3_0_11.php | 30 ++ .../db/migration/data/v30x/release_3_0_11_rc1.php | 97 +++++ .../db/migration/data/v30x/release_3_0_11_rc2.php | 52 +++ .../db/migration/data/v30x/release_3_0_12_rc1.php | 125 +++++++ .../db/migration/data/v30x/release_3_0_1_rc1.php | 110 ++++++ .../phpbb/db/migration/data/v30x/release_3_0_2.php | 30 ++ .../db/migration/data/v30x/release_3_0_2_rc1.php | 34 ++ .../db/migration/data/v30x/release_3_0_2_rc2.php | 82 +++++ .../phpbb/db/migration/data/v30x/release_3_0_3.php | 30 ++ .../db/migration/data/v30x/release_3_0_3_rc1.php | 85 +++++ .../phpbb/db/migration/data/v30x/release_3_0_4.php | 51 +++ .../db/migration/data/v30x/release_3_0_4_rc1.php | 125 +++++++ .../phpbb/db/migration/data/v30x/release_3_0_5.php | 30 ++ .../db/migration/data/v30x/release_3_0_5_rc1.php | 126 +++++++ .../migration/data/v30x/release_3_0_5_rc1part2.php | 44 +++ .../phpbb/db/migration/data/v30x/release_3_0_6.php | 30 ++ .../db/migration/data/v30x/release_3_0_6_rc1.php | 326 ++++++++++++++++ .../db/migration/data/v30x/release_3_0_6_rc2.php | 30 ++ .../db/migration/data/v30x/release_3_0_6_rc3.php | 42 +++ .../db/migration/data/v30x/release_3_0_6_rc4.php | 30 ++ .../phpbb/db/migration/data/v30x/release_3_0_7.php | 30 ++ .../db/migration/data/v30x/release_3_0_7_pl1.php | 30 ++ .../db/migration/data/v30x/release_3_0_7_rc1.php | 78 ++++ .../db/migration/data/v30x/release_3_0_7_rc2.php | 75 ++++ .../phpbb/db/migration/data/v30x/release_3_0_8.php | 30 ++ .../db/migration/data/v30x/release_3_0_8_rc1.php | 223 +++++++++++ .../phpbb/db/migration/data/v30x/release_3_0_9.php | 30 ++ .../db/migration/data/v30x/release_3_0_9_rc1.php | 126 +++++++ .../db/migration/data/v30x/release_3_0_9_rc2.php | 30 ++ .../db/migration/data/v30x/release_3_0_9_rc3.php | 30 ++ .../db/migration/data/v30x/release_3_0_9_rc4.php | 30 ++ phpBB/phpbb/db/migration/data/v310/avatars.php | 69 ++++ phpBB/phpbb/db/migration/data/v310/boardindex.php | 25 ++ .../db/migration/data/v310/config_db_text.php | 47 +++ phpBB/phpbb/db/migration/data/v310/dev.php | 410 +++++++++++++++++++++ phpBB/phpbb/db/migration/data/v310/extensions.php | 71 ++++ .../db/migration/data/v310/forgot_password.php | 30 ++ .../phpbb/db/migration/data/v310/jquery_update.php | 33 ++ .../data/v310/notification_options_reconvert.php | 120 ++++++ .../phpbb/db/migration/data/v310/notifications.php | 98 +++++ .../data/v310/notifications_schema_fix.php | 94 +++++ .../migration/data/v310/reported_posts_display.php | 49 +++ .../migration/data/v310/signature_module_auth.php | 53 +++ .../phpbb/db/migration/data/v310/softdelete_p1.php | 173 +++++++++ .../phpbb/db/migration/data/v310/softdelete_p2.php | 70 ++++ .../db/migration/data/v310/style_update_p1.php | 187 ++++++++++ .../db/migration/data/v310/style_update_p2.php | 131 +++++++ phpBB/phpbb/db/migration/data/v310/teampage.php | 106 ++++++ phpBB/phpbb/db/migration/data/v310/timezone.php | 165 +++++++++ phpBB/phpbb/db/migration/data/v310/timezone_p2.php | 45 +++ 112 files changed, 4408 insertions(+), 4408 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_10.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_10_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_10_rc2.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_10_rc3.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_11.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_11_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_11_rc2.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_12_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_1_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_2.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_2_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_2_rc2.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_3.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_3_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_4.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_4_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_5.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_5_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_5_rc1part2.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_6.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_6_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_6_rc2.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_6_rc3.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_6_rc4.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_7.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_7_pl1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_7_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_7_rc2.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_8.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_8_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_9.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_9_rc1.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_9_rc2.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_9_rc3.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/3_0_9_rc4.php delete mode 100644 phpBB/phpbb/db/migration/data/30x/local_url_bbcode.php delete mode 100644 phpBB/phpbb/db/migration/data/310/avatars.php delete mode 100644 phpBB/phpbb/db/migration/data/310/boardindex.php delete mode 100644 phpBB/phpbb/db/migration/data/310/config_db_text.php delete mode 100644 phpBB/phpbb/db/migration/data/310/dev.php delete mode 100644 phpBB/phpbb/db/migration/data/310/extensions.php delete mode 100644 phpBB/phpbb/db/migration/data/310/forgot_password.php delete mode 100644 phpBB/phpbb/db/migration/data/310/jquery_update.php delete mode 100644 phpBB/phpbb/db/migration/data/310/notification_options_reconvert.php delete mode 100644 phpBB/phpbb/db/migration/data/310/notifications.php delete mode 100644 phpBB/phpbb/db/migration/data/310/notifications_schema_fix.php delete mode 100644 phpBB/phpbb/db/migration/data/310/reported_posts_display.php delete mode 100644 phpBB/phpbb/db/migration/data/310/signature_module_auth.php delete mode 100644 phpBB/phpbb/db/migration/data/310/softdelete_p1.php delete mode 100644 phpBB/phpbb/db/migration/data/310/softdelete_p2.php delete mode 100644 phpBB/phpbb/db/migration/data/310/style_update_p1.php delete mode 100644 phpBB/phpbb/db/migration/data/310/style_update_p2.php delete mode 100644 phpBB/phpbb/db/migration/data/310/teampage.php delete mode 100644 phpBB/phpbb/db/migration/data/310/timezone.php delete mode 100644 phpBB/phpbb/db/migration/data/310/timezone_p2.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php create mode 100644 phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php create mode 100644 phpBB/phpbb/db/migration/data/v310/avatars.php create mode 100644 phpBB/phpbb/db/migration/data/v310/boardindex.php create mode 100644 phpBB/phpbb/db/migration/data/v310/config_db_text.php create mode 100644 phpBB/phpbb/db/migration/data/v310/dev.php create mode 100644 phpBB/phpbb/db/migration/data/v310/extensions.php create mode 100644 phpBB/phpbb/db/migration/data/v310/forgot_password.php create mode 100644 phpBB/phpbb/db/migration/data/v310/jquery_update.php create mode 100644 phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php create mode 100644 phpBB/phpbb/db/migration/data/v310/notifications.php create mode 100644 phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php create mode 100644 phpBB/phpbb/db/migration/data/v310/reported_posts_display.php create mode 100644 phpBB/phpbb/db/migration/data/v310/signature_module_auth.php create mode 100644 phpBB/phpbb/db/migration/data/v310/softdelete_p1.php create mode 100644 phpBB/phpbb/db/migration/data/v310/softdelete_p2.php create mode 100644 phpBB/phpbb/db/migration/data/v310/style_update_p1.php create mode 100644 phpBB/phpbb/db/migration/data/v310/style_update_p2.php create mode 100644 phpBB/phpbb/db/migration/data/v310/teampage.php create mode 100644 phpBB/phpbb/db/migration/data/v310/timezone.php create mode 100644 phpBB/phpbb/db/migration/data/v310/timezone_p2.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_1.php b/phpBB/phpbb/db/migration/data/30x/3_0_1.php deleted file mode 100644 index 2fe0addc06..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_1.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_1_rc1'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.1')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_10.php b/phpBB/phpbb/db/migration/data/30x/3_0_10.php deleted file mode 100644 index cdf824a9ff..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_10.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.10', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_10_rc3'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.10')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_10_rc1.php deleted file mode 100644 index ee05fcabaa..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc1.php +++ /dev/null @@ -1,32 +0,0 @@ -config['version'], '3.0.10-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_9'); - } - - public function update_data() - { - return array( - array('config.add', array('email_max_chunk_size', 50)), - - array('config.update', array('version', '3.0.10-rc1')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_10_rc2.php deleted file mode 100644 index f53a4b0d97..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc2.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.10-rc2', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_10_rc1'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.10-rc2')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc3.php b/phpBB/phpbb/db/migration/data/30x/3_0_10_rc3.php deleted file mode 100644 index 20456e0458..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_10_rc3.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.10-rc3', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_10_rc2'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.10-rc3')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_11.php b/phpBB/phpbb/db/migration/data/30x/3_0_11.php deleted file mode 100644 index 5b842cba4b..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_11.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.11', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_11_rc2'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.11')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_11_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_11_rc1.php deleted file mode 100644 index 1d484a97ca..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_11_rc1.php +++ /dev/null @@ -1,97 +0,0 @@ -config['version'], '3.0.11-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_10'); - } - - public function update_data() - { - return array( - array('custom', array(array(&$this, 'cleanup_deactivated_styles'))), - array('custom', array(array(&$this, 'delete_orphan_private_messages'))), - - array('config.update', array('version', '3.0.11-rc1')), - ); - } - - public function cleanup_deactivated_styles() - { - // Updates users having current style a deactivated one - $sql = 'SELECT style_id - FROM ' . STYLES_TABLE . ' - WHERE style_active = 0'; - $result = $this->sql_query($sql); - - $deactivated_style_ids = array(); - while ($style_id = $this->db->sql_fetchfield('style_id', false, $result)) - { - $deactivated_style_ids[] = (int) $style_id; - } - $this->db->sql_freeresult($result); - - if (!empty($deactivated_style_ids)) - { - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_style = ' . (int) $this->config['default_style'] .' - WHERE ' . $this->db->sql_in_set('user_style', $deactivated_style_ids); - $this->sql_query($sql); - } - } - - public function delete_orphan_private_messages() - { - // Delete orphan private messages - $batch_size = 500; - - $sql_array = array( - 'SELECT' => 'p.msg_id', - 'FROM' => array( - PRIVMSGS_TABLE => 'p', - ), - 'LEFT_JOIN' => array( - array( - 'FROM' => array(PRIVMSGS_TO_TABLE => 't'), - 'ON' => 'p.msg_id = t.msg_id', - ), - ), - 'WHERE' => 't.user_id IS NULL', - ); - $sql = $this->db->sql_build_query('SELECT', $sql_array); - - $result = $this->db->sql_query_limit($sql, $batch_size); - - $delete_pms = array(); - while ($row = $this->db->sql_fetchrow($result)) - { - $delete_pms[] = (int) $row['msg_id']; - } - $this->db->sql_freeresult($result); - - if (!empty($delete_pms)) - { - $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' - WHERE ' . $this->db->sql_in_set('msg_id', $delete_pms); - $this->sql_query($sql); - - // Return false to have the Migrator call this function again - return false; - } - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_11_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_11_rc2.php deleted file mode 100644 index b7e475a87b..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_11_rc2.php +++ /dev/null @@ -1,52 +0,0 @@ -config['version'], '3.0.11-rc2', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_11_rc1'); - } - - public function update_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'profile_fields' => array( - 'field_show_novalue' => array('BOOL', 0), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'profile_fields' => array( - 'field_show_novalue', - ), - ), - ); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.11-rc2')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_12_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_12_rc1.php deleted file mode 100644 index f1692f8ef7..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_12_rc1.php +++ /dev/null @@ -1,125 +0,0 @@ -config['version'], '3.0.12-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_11'); - } - - public function update_data() - { - return array( - array('custom', array(array(&$this, 'update_module_auth'))), - array('custom', array(array(&$this, 'update_bots'))), - array('custom', array(array(&$this, 'disable_bots_from_receiving_pms'))), - - array('config.update', array('version', '3.0.12-rc1')), - ); - } - - public function disable_bots_from_receiving_pms() - { - // Disable receiving pms for bots - $sql = 'SELECT user_id - FROM ' . BOTS_TABLE; - $result = $this->db->sql_query($sql); - - $bot_user_ids = array(); - while ($row = $this->db->sql_fetchrow($result)) - { - $bot_user_ids[] = (int) $row['user_id']; - } - $this->db->sql_freeresult($result); - - if (!empty($bot_user_ids)) - { - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_allow_pm = 0 - WHERE ' . $this->db->sql_in_set('user_id', $bot_user_ids); - $this->sql_query($sql); - } - } - - public function update_module_auth() - { - $sql = 'UPDATE ' . MODULES_TABLE . ' - SET module_auth = \'acl_u_sig\' - WHERE module_class = \'ucp\' - AND module_basename = \'profile\' - AND module_mode = \'signature\''; - $this->sql_query($sql); - } - - public function update_bots() - { - // Update bots - if (!function_exists('user_delete')) - { - include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); - } - - $bots_updates = array( - // Bot Deletions - 'NG-Search [Bot]' => false, - 'Nutch/CVS [Bot]' => false, - 'OmniExplorer [Bot]' => false, - 'Seekport [Bot]' => false, - 'Synoo [Bot]' => false, - 'WiseNut [Bot]' => false, - - // Bot Updates - // Bot name to bot user agent map - 'Baidu [Spider]' => 'Baiduspider', - 'Exabot [Bot]' => 'Exabot', - 'Voyager [Bot]' => 'voyager/', - 'W3C [Validator]' => 'W3C_Validator', - ); - - foreach ($bots_updates as $bot_name => $bot_agent) - { - $sql = 'SELECT user_id - FROM ' . USERS_TABLE . ' - WHERE user_type = ' . USER_IGNORE . " - AND username_clean = '" . $this->db->sql_escape(utf8_clean_string($bot_name)) . "'"; - $result = $this->db->sql_query($sql); - $bot_user_id = (int) $this->db->sql_fetchfield('user_id'); - $this->db->sql_freeresult($result); - - if ($bot_user_id) - { - if ($bot_agent === false) - { - $sql = 'DELETE FROM ' . BOTS_TABLE . " - WHERE user_id = $bot_user_id"; - $this->sql_query($sql); - - user_delete('remove', $bot_user_id); - } - else - { - $sql = 'UPDATE ' . BOTS_TABLE . " - SET bot_agent = '" . $this->db->sql_escape($bot_agent) . "' - WHERE user_id = $bot_user_id"; - $this->sql_query($sql); - } - } - } - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_1_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_1_rc1.php deleted file mode 100644 index 0444de4ac2..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_1_rc1.php +++ /dev/null @@ -1,110 +0,0 @@ -config['version'], '3.0.1-rc1', '>='); - } - - public function update_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'forums' => array( - 'display_subforum_list' => array('BOOL', 1), - ), - $this->table_prefix . 'sessions' => array( - 'session_forum_id' => array('UINT', 0), - ), - ), - 'drop_keys' => array( - $this->table_prefix . 'groups' => array( - 'group_legend', - ), - ), - 'add_index' => array( - $this->table_prefix . 'sessions' => array( - 'session_forum_id' => array('session_forum_id'), - ), - $this->table_prefix . 'groups' => array( - 'group_legend_name' => array('group_legend', 'group_name'), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'forums' => array( - 'display_subforum_list', - ), - $this->table_prefix . 'sessions' => array( - 'session_forum_id', - ), - ), - 'add_index' => array( - $this->table_prefix . 'groups' => array( - 'group_legend' => array('group_legend'), - ), - ), - 'drop_keys' => array( - $this->table_prefix . 'sessions' => array( - 'session_forum_id', - ), - $this->table_prefix . 'groups' => array( - 'group_legend_name', - ), - ), - ); - } - - public function update_data() - { - return array( - array('custom', array(array(&$this, 'fix_unset_last_view_time'))), - array('custom', array(array(&$this, 'reset_smiley_size'))), - - array('config.update', array('version', '3.0.1-rc1')), - ); - } - - public function fix_unset_last_view_time() - { - $sql = 'UPDATE ' . $this->table_prefix . "topics - SET topic_last_view_time = topic_last_post_time - WHERE topic_last_view_time = 0"; - $this->sql_query($sql); - } - - public function reset_smiley_size() - { - // Update smiley sizes - $smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif'); - - foreach ($smileys as $smiley) - { - if (file_exists($this->phpbb_root_path . 'images/smilies/' . $smiley)) - { - list($width, $height) = getimagesize($this->phpbb_root_path . 'images/smilies/' . $smiley); - - $sql = 'UPDATE ' . SMILIES_TABLE . ' - SET smiley_width = ' . $width . ', smiley_height = ' . $height . " - WHERE smiley_url = '" . $this->db->sql_escape($smiley) . "'"; - - $this->sql_query($sql); - } - } - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_2.php b/phpBB/phpbb/db/migration/data/30x/3_0_2.php deleted file mode 100644 index 4f9278e2fa..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_2.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.2', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_2_rc2'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.2')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_2_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_2_rc1.php deleted file mode 100644 index 8f709fb769..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_2_rc1.php +++ /dev/null @@ -1,34 +0,0 @@ -config['version'], '3.0.2-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_1'); - } - - public function update_data() - { - return array( - array('config.add', array('referer_validation', '1')), - array('config.add', array('check_attachment_content', '1')), - array('config.add', array('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title')), - - array('config.update', array('version', '3.0.2-rc1')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_2_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_2_rc2.php deleted file mode 100644 index ecbe8bf808..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_2_rc2.php +++ /dev/null @@ -1,82 +0,0 @@ -config['version'], '3.0.2-rc2', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_2_rc1'); - } - - public function update_schema() - { - return array( - 'change_columns' => array( - $this->table_prefix . 'drafts' => array( - 'draft_subject' => array('STEXT_UNI', ''), - ), - $this->table_prefix . 'forums' => array( - 'forum_last_post_subject' => array('STEXT_UNI', ''), - ), - $this->table_prefix . 'posts' => array( - 'post_subject' => array('STEXT_UNI', '', 'true_sort'), - ), - $this->table_prefix . 'privmsgs' => array( - 'message_subject' => array('STEXT_UNI', ''), - ), - $this->table_prefix . 'topics' => array( - 'topic_title' => array('STEXT_UNI', '', 'true_sort'), - 'topic_last_post_subject' => array('STEXT_UNI', ''), - ), - ), - 'drop_keys' => array( - $this->table_prefix . 'sessions' => array( - 'session_forum_id', - ), - ), - 'add_index' => array( - $this->table_prefix . 'sessions' => array( - 'session_fid' => array('session_forum_id'), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'add_index' => array( - $this->table_prefix . 'sessions' => array( - 'session_forum_id' => array( - 'session_forum_id', - ), - ), - ), - 'drop_keys' => array( - $this->table_prefix . 'sessions' => array( - 'session_fid', - ), - ), - ); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.2-rc2')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_3.php b/phpBB/phpbb/db/migration/data/30x/3_0_3.php deleted file mode 100644 index 5f94bd9018..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_3.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.3', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_3_rc1'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.3')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_3_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_3_rc1.php deleted file mode 100644 index 631d382135..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_3_rc1.php +++ /dev/null @@ -1,85 +0,0 @@ -config['version'], '3.0.3-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_2'); - } - - public function update_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'styles_template' => array( - 'template_inherits_id' => array('UINT:4', 0), - 'template_inherit_path' => array('VCHAR', ''), - ), - $this->table_prefix . 'groups' => array( - 'group_max_recipients' => array('UINT', 0), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'styles_template' => array( - 'template_inherits_id', - 'template_inherit_path', - ), - $this->table_prefix . 'groups' => array( - 'group_max_recipients', - ), - ), - ); - } - - public function update_data() - { - return array( - array('config.add', array('enable_queue_trigger', '0')), - array('config.add', array('queue_trigger_posts', '3')), - array('config.add', array('pm_max_recipients', '0')), - array('custom', array(array(&$this, 'set_group_default_max_recipients'))), - array('config.add', array('dbms_version', $this->db->sql_server_info(true))), - array('permission.add', array('u_masspm_group', true, 'u_masspm')), - array('custom', array(array(&$this, 'correct_acp_email_permissions'))), - - array('config.update', array('version', '3.0.3-rc1')), - ); - } - - public function correct_acp_email_permissions() - { - $sql = 'UPDATE ' . $this->table_prefix . 'modules - SET module_auth = \'acl_a_email && cfg_email_enable\' - WHERE module_class = \'acp\' - AND module_basename = \'email\''; - $this->sql_query($sql); - } - - public function set_group_default_max_recipients() - { - // Set maximum number of recipients for the registered users, bots, guests group - $sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_max_recipients = 5 - WHERE ' . $this->db->sql_in_set('group_name', array('GUESTS', 'REGISTERED', 'REGISTERED_COPPA', 'BOTS')); - $this->sql_query($sql); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_4.php b/phpBB/phpbb/db/migration/data/30x/3_0_4.php deleted file mode 100644 index 369f23f7e7..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_4.php +++ /dev/null @@ -1,51 +0,0 @@ -config['version'], '3.0.4', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_4_rc1'); - } - - public function update_data() - { - return array( - array('custom', array(array(&$this, 'rename_log_delete_topic'))), - - array('config.update', array('version', '3.0.4')), - ); - } - - public function rename_log_delete_topic() - { - if ($this->db->sql_layer == 'oracle') - { - // log_operation is CLOB - but we can change this later - $sql = 'UPDATE ' . $this->table_prefix . "log - SET log_operation = 'LOG_DELETE_TOPIC' - WHERE log_operation LIKE 'LOG_TOPIC_DELETED'"; - $this->sql_query($sql); - } - else - { - $sql = 'UPDATE ' . $this->table_prefix . "log - SET log_operation = 'LOG_DELETE_TOPIC' - WHERE log_operation = 'LOG_TOPIC_DELETED'"; - $this->sql_query($sql); - } - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_4_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_4_rc1.php deleted file mode 100644 index f98d7a59d0..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_4_rc1.php +++ /dev/null @@ -1,125 +0,0 @@ -config['version'], '3.0.4-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_3'); - } - - public function update_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'profile_fields' => array( - 'field_show_profile' => array('BOOL', 0), - ), - ), - 'change_columns' => array( - $this->table_prefix . 'styles' => array( - 'style_id' => array('UINT', NULL, 'auto_increment'), - 'template_id' => array('UINT', 0), - 'theme_id' => array('UINT', 0), - 'imageset_id' => array('UINT', 0), - ), - $this->table_prefix . 'styles_imageset' => array( - 'imageset_id' => array('UINT', NULL, 'auto_increment'), - ), - $this->table_prefix . 'styles_imageset_data' => array( - 'image_id' => array('UINT', NULL, 'auto_increment'), - 'imageset_id' => array('UINT', 0), - ), - $this->table_prefix . 'styles_theme' => array( - 'theme_id' => array('UINT', NULL, 'auto_increment'), - ), - $this->table_prefix . 'styles_template' => array( - 'template_id' => array('UINT', NULL, 'auto_increment'), - ), - $this->table_prefix . 'styles_template_data' => array( - 'template_id' => array('UINT', 0), - ), - $this->table_prefix . 'forums' => array( - 'forum_style' => array('UINT', 0), - ), - $this->table_prefix . 'users' => array( - 'user_style' => array('UINT', 0), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'profile_fields' => array( - 'field_show_profile', - ), - ), - ); - } - - public function update_data() - { - return array( - array('custom', array(array(&$this, 'update_custom_profile_fields'))), - - array('config.update', array('version', '3.0.4-rc1')), - ); - } - - public function update_custom_profile_fields() - { - // Update the Custom Profile Fields based on previous settings to the new \format - $sql = 'SELECT field_id, field_required, field_show_on_reg, field_hide - FROM ' . PROFILE_FIELDS_TABLE; - $result = $this->db->sql_query($sql); - - while ($row = $this->db->sql_fetchrow($result)) - { - $sql_ary = array( - 'field_required' => 0, - 'field_show_on_reg' => 0, - 'field_hide' => 0, - 'field_show_profile'=> 0, - ); - - if ($row['field_required']) - { - $sql_ary['field_required'] = $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1; - } - else if ($row['field_show_on_reg']) - { - $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1; - } - else if ($row['field_hide']) - { - // Only administrators and moderators can see this CPF, if the view is enabled, they can see it, otherwise just admins in the acp_users module - $sql_ary['field_hide'] = 1; - } - else - { - // equivelant to "none", which is the "Display in user control panel" option - $sql_ary['field_show_profile'] = 1; - } - - $this->sql_query('UPDATE ' . $this->table_prefix . 'profile_fields SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id'], $errored, $error_ary); - } - - $this->db->sql_freeresult($result); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_5.php b/phpBB/phpbb/db/migration/data/30x/3_0_5.php deleted file mode 100644 index 9265f09b39..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_5.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.5', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_5_rc1part2'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.5')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1.php deleted file mode 100644 index b99313de5d..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1.php +++ /dev/null @@ -1,126 +0,0 @@ -config['version'], '3.0.5-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_4'); - } - - public function update_schema() - { - return array( - 'change_columns' => array( - $this->table_prefix . 'forums' => array( - 'forum_style' => array('UINT', 0), - ), - ), - ); - } - - public function update_data() - { - $search_indexing_state = $this->config['search_indexing_state']; - - return array( - array('config.add', array('captcha_gd_wave', 0)), - array('config.add', array('captcha_gd_3d_noise', 1)), - array('config.add', array('captcha_gd_fonts', 1)), - array('config.add', array('confirm_refresh', 1)), - array('config.add', array('max_num_search_keywords', 10)), - array('config.remove', array('search_indexing_state')), - array('config.add', array('search_indexing_state', $search_indexing_state, true)), - array('custom', array(array(&$this, 'hash_old_passwords'))), - array('custom', array(array(&$this, 'update_ichiro_bot'))), - ); - } - - public function hash_old_passwords() - { - $sql = 'SELECT user_id, user_password - FROM ' . $this->table_prefix . 'users - WHERE user_pass_convert = 1'; - $result = $this->db->sql_query($sql); - - while ($row = $this->db->sql_fetchrow($result)) - { - if (strlen($row['user_password']) == 32) - { - $sql_ary = array( - 'user_password' => phpbb_hash($row['user_password']), - ); - - $this->sql_query('UPDATE ' . $this->table_prefix . 'users SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $row['user_id']); - } - } - $this->db->sql_freeresult($result); - } - - public function update_ichiro_bot() - { - // Adjust bot entry - $sql = 'UPDATE ' . $this->table_prefix . "bots - SET bot_agent = 'ichiro/' - WHERE bot_agent = 'ichiro/2'"; - $this->sql_query($sql); - } - - public function remove_duplicate_auth_options() - { - // Before we are able to add a unique key to auth_option, we need to remove duplicate entries - $sql = 'SELECT auth_option - FROM ' . $this->table_prefix . 'acl_options - GROUP BY auth_option - HAVING COUNT(*) >= 2'; - $result = $this->db->sql_query($sql); - - $auth_options = array(); - while ($row = $this->db->sql_fetchrow($result)) - { - $auth_options[] = $row['auth_option']; - } - $this->db->sql_freeresult($result); - - // Remove specific auth options - if (!empty($auth_options)) - { - foreach ($auth_options as $option) - { - // Select auth_option_ids... the largest id will be preserved - $sql = 'SELECT auth_option_id - FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option = '" . $db->sql_escape($option) . "' - ORDER BY auth_option_id DESC"; - // sql_query_limit not possible here, due to bug in postgresql layer - $result = $this->db->sql_query($sql); - - // Skip first row, this is our original auth option we want to preserve - $row = $this->db->sql_fetchrow($result); - - while ($row = $this->db->sql_fetchrow($result)) - { - // Ok, remove this auth option... - $this->sql_query('DELETE FROM ' . ACL_OPTIONS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); - $this->sql_query('DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); - $this->sql_query('DELETE FROM ' . ACL_GROUPS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); - $this->sql_query('DELETE FROM ' . ACL_USERS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); - } - $this->db->sql_freeresult($result); - } - } - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1part2.php b/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1part2.php deleted file mode 100644 index 65787f9310..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_5_rc1part2.php +++ /dev/null @@ -1,44 +0,0 @@ -config['version'], '3.0.5-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_5_rc1'); - } - - public function update_schema() - { - return array( - 'drop_keys' => array( - $this->table_prefix . 'acl_options' => array('auth_option'), - ), - 'add_unique_index' => array( - $this->table_prefix . 'acl_options' => array( - 'auth_option' => array('auth_option'), - ), - ), - ); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.5-rc1')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_6.php b/phpBB/phpbb/db/migration/data/30x/3_0_6.php deleted file mode 100644 index 382fb6cde2..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_6.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.6', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_6_rc4'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.6')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc1.php deleted file mode 100644 index 0b54c3b195..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc1.php +++ /dev/null @@ -1,326 +0,0 @@ -config['version'], '3.0.6-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_5'); - } - - public function update_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'confirm' => array( - 'attempts' => array('UINT', 0), - ), - $this->table_prefix . 'users' => array( - 'user_new' => array('BOOL', 1), - 'user_reminded' => array('TINT:4', 0), - 'user_reminded_time' => array('TIMESTAMP', 0), - ), - $this->table_prefix . 'groups' => array( - 'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'), - ), - $this->table_prefix . 'privmsgs' => array( - 'message_reported' => array('BOOL', 0), - ), - $this->table_prefix . 'reports' => array( - 'pm_id' => array('UINT', 0), - ), - $this->table_prefix . 'profile_fields' => array( - 'field_show_on_vt' => array('BOOL', 0), - ), - $this->table_prefix . 'forums' => array( - 'forum_options' => array('UINT:20', 0), - ), - ), - 'change_columns' => array( - $this->table_prefix . 'users' => array( - 'user_options' => array('UINT:11', 230271), - ), - ), - 'add_index' => array( - $this->table_prefix . 'reports' => array( - 'post_id' => array('post_id'), - 'pm_id' => array('pm_id'), - ), - $this->table_prefix . 'posts' => array( - 'post_username' => array('post_username:255'), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'confirm' => array( - 'attempts', - ), - $this->table_prefix . 'users' => array( - 'user_new', - 'user_reminded', - 'user_reminded_time', - ), - $this->table_prefix . 'groups' => array( - 'group_skip_auth', - ), - $this->table_prefix . 'privmsgs' => array( - 'message_reported', - ), - $this->table_prefix . 'reports' => array( - 'pm_id', - ), - $this->table_prefix . 'profile_fields' => array( - 'field_show_on_vt', - ), - $this->table_prefix . 'forums' => array( - 'forum_options', - ), - ), - 'drop_keys' => array( - $this->table_prefix . 'reports' => array( - 'post_id', - 'pm_id', - ), - $this->table_prefix . 'posts' => array( - 'post_username', - ), - ), - ); - } - - public function update_data() - { - return array( - array('config.add', array('captcha_plugin', 'phpbb_captcha_nogd')), - array('if', array( - ($this->config['captcha_gd']), - array('config.update', array('captcha_plugin', 'phpbb_captcha_gd')), - )), - - array('config.add', array('feed_enable', 0)), - array('config.add', array('feed_limit', 10)), - array('config.add', array('feed_overall_forums', 1)), - array('config.add', array('feed_overall_forums_limit', 15)), - array('config.add', array('feed_overall_topics', 0)), - array('config.add', array('feed_overall_topics_limit', 15)), - array('config.add', array('feed_forum', 1)), - array('config.add', array('feed_topic', 1)), - array('config.add', array('feed_item_statistics', 1)), - - array('config.add', array('smilies_per_page', 50)), - array('config.add', array('allow_pm_report', 1)), - array('config.add', array('min_post_chars', 1)), - array('config.add', array('allow_quick_reply', 1)), - array('config.add', array('new_member_post_limit', 0)), - array('config.add', array('new_member_group_default', 0)), - array('config.add', array('delete_time', $this->config['edit_time'])), - - array('config.add', array('allow_avatar', 0)), - array('if', array( - ($this->config['allow_avatar_upload'] || $this->config['allow_avatar_local'] || $this->config['allow_avatar_remote']), - array('config.update', array('allow_avatar', 1)), - )), - array('config.add', array('allow_avatar_remote_upload', 0)), - array('if', array( - ($this->config['allow_avatar_remote'] && $this->config['allow_avatar_upload']), - array('config.update', array('allow_avatar_remote_upload', 1)), - )), - - array('module.add', array( - 'acp', - 'ACP_BOARD_CONFIGURATION', - array( - 'module_basename' => 'acp_board', - 'modes' => array('feed'), - ), - )), - array('module.add', array( - 'acp', - 'ACP_CAT_USERS', - array( - 'module_basename' => 'acp_users', - 'modes' => array('warnings'), - ), - )), - array('module.add', array( - 'acp', - 'ACP_SERVER_CONFIGURATION', - array( - 'module_basename' => 'acp_send_statistics', - 'modes' => array('send_statistics'), - ), - )), - array('module.add', array( - 'acp', - 'ACP_FORUM_BASED_PERMISSIONS', - array( - 'module_basename' => 'acp_permissions', - 'modes' => array('setting_forum_copy'), - ), - )), - array('module.add', array( - 'mcp', - 'MCP_REPORTS', - array( - 'module_basename' => 'mcp_pm_reports', - 'modes' => array('pm_reports','pm_reports_closed','pm_report_details'), - ), - )), - array('custom', array(array(&$this, 'add_newly_registered_group'))), - array('custom', array(array(&$this, 'set_user_options_default'))), - - array('config.update', array('version', '3.0.6-rc1')), - ); - } - - public function set_user_options_default() - { - // 229376 is the added value to enable all three signature options - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = user_options + 229376'; - $this->sql_query($sql); - } - - public function add_newly_registered_group() - { - // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema) - $sql = 'SELECT group_id - FROM ' . GROUPS_TABLE . " - WHERE group_name = 'NEWLY_REGISTERED'"; - $result = $this->db->sql_query($sql); - $group_id = (int) $this->db->sql_fetchfield('group_id'); - $this->db->sql_freeresult($result); - - if (!$group_id) - { - $sql = 'INSERT INTO ' . GROUPS_TABLE . " (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, '', '', '', 5)"; - $this->sql_query($sql); - - $group_id = $this->db->sql_nextid(); - } - - // Insert new \user role... at the end of the chain - $sql = 'SELECT role_id - FROM ' . ACL_ROLES_TABLE . " - WHERE role_name = 'ROLE_USER_NEW_MEMBER' - AND role_type = 'u_'"; - $result = $this->db->sql_query($sql); - $u_role = (int) $this->db->sql_fetchfield('role_id'); - $this->db->sql_freeresult($result); - - if (!$u_role) - { - $sql = 'SELECT MAX(role_order) as max_order_id - FROM ' . ACL_ROLES_TABLE . " - WHERE role_type = 'u_'"; - $result = $this->db->sql_query($sql); - $next_order_id = (int) $this->db->sql_fetchfield('max_order_id'); - $this->db->sql_freeresult($result); - - $next_order_id++; - - $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NEW_MEMBER', 'ROLE_DESCRIPTION_USER_NEW_MEMBER', 'u_', $next_order_id)"; - $this->sql_query($sql); - $u_role = $this->db->sql_nextid(); - - // Now add the correct data to the roles... - // The standard role says that new \users are not able to send a PM, Mass PM, are not able to PM groups - $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $u_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group')"; - $this->sql_query($sql); - - // Add user role to group - $sql = 'INSERT INTO ' . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES ($group_id, 0, 0, $u_role, 0)"; - $this->sql_query($sql); - } - - // Insert new \forum role - $sql = 'SELECT role_id - FROM ' . ACL_ROLES_TABLE . " - WHERE role_name = 'ROLE_FORUM_NEW_MEMBER' - AND role_type = 'f_'"; - $result = $this->db->sql_query($sql); - $f_role = (int) $this->db->sql_fetchfield('role_id'); - $this->db->sql_freeresult($result); - - if (!$f_role) - { - $sql = 'SELECT MAX(role_order) as max_order_id - FROM ' . ACL_ROLES_TABLE . " - WHERE role_type = 'f_'"; - $result = $this->db->sql_query($sql); - $next_order_id = (int) $this->db->sql_fetchfield('max_order_id'); - $this->db->sql_freeresult($result); - - $next_order_id++; - - $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NEW_MEMBER', 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER', 'f_', $next_order_id)"; - $this->sql_query($sql); - $f_role = $this->db->sql_nextid(); - - $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $f_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove')"; - $this->sql_query($sql); - } - - // Set every members user_new \column to 0 (old users) only if there is no one yet (this makes sure we do not execute this more than once) - $sql = 'SELECT 1 - FROM ' . USERS_TABLE . ' - WHERE user_new = 0'; - $result = $this->db->sql_query_limit($sql, 1); - $row = $this->db->sql_fetchrow($result); - $this->db->sql_freeresult($result); - - if (!$row) - { - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new = 0'; - $this->sql_query($sql); - } - - // To mimick the old "feature" we will assign the forum role to every forum, regardless of the setting (this makes sure there are no "this does not work!!!! YUO!!!" posts... - // Check if the role is already assigned... - $sql = 'SELECT forum_id - FROM ' . ACL_GROUPS_TABLE . ' - WHERE group_id = ' . $group_id . ' - AND auth_role_id = ' . $f_role; - $result = $this->db->sql_query($sql); - $is_options = (int) $this->db->sql_fetchfield('forum_id'); - $this->db->sql_freeresult($result); - - // Not assigned at all... :/ - if (!$is_options) - { - // Get postable forums - $sql = 'SELECT forum_id - FROM ' . FORUMS_TABLE . ' - WHERE forum_type != ' . FORUM_LINK; - $result = $this->db->sql_query($sql); - - while ($row = $this->db->sql_fetchrow($result)) - { - $this->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (' . $group_id . ', ' . (int) $row['forum_id'] . ', 0, ' . $f_role . ', 0)'); - } - $this->db->sql_freeresult($result); - } - - // Clear permissions... - include_once($this->phpbb_root_path . 'includes/acp/auth.' . $this->php_ext); - $auth_admin = new \auth_admin(); - $auth_admin->acl_clear_prefetch(); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc2.php deleted file mode 100644 index 041224d19a..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc2.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.6-rc2', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_6_rc1'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.6-rc2')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc3.php b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc3.php deleted file mode 100644 index 3183c16efd..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc3.php +++ /dev/null @@ -1,42 +0,0 @@ -config['version'], '3.0.6-rc3', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_6_rc2'); - } - - public function update_data() - { - return array( - array('custom', array(array(&$this, 'update_cp_fields'))), - - array('config.update', array('version', '3.0.6-rc3')), - ); - } - - public function update_cp_fields() - { - // Update the Custom Profile Fields based on previous settings to the new \format - $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . ' - SET field_show_on_vt = 1 - WHERE field_hide = 0 - AND (field_required = 1 OR field_show_on_reg = 1 OR field_show_profile = 1)'; - $this->sql_query($sql); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc4.php b/phpBB/phpbb/db/migration/data/30x/3_0_6_rc4.php deleted file mode 100644 index 7d75b12130..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_6_rc4.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.6-rc4', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_6_rc3'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.6-rc4')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_7.php b/phpBB/phpbb/db/migration/data/30x/3_0_7.php deleted file mode 100644 index 1b1e5d0373..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_7.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.7', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_7_rc2'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.7')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_7_pl1.php b/phpBB/phpbb/db/migration/data/30x/3_0_7_pl1.php deleted file mode 100644 index a45c9c3c14..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_7_pl1.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.7-pl1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_7'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.7-pl1')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_7_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_7_rc1.php deleted file mode 100644 index dab90512ab..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_7_rc1.php +++ /dev/null @@ -1,78 +0,0 @@ -config['version'], '3.0.7-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_6'); - } - - public function update_schema() - { - return array( - 'drop_keys' => array( - $this->table_prefix . 'log' => array( - 'log_time', - ), - ), - 'add_index' => array( - $this->table_prefix . 'topics_track' => array( - 'topic_id' => array('topic_id'), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'add_index' => array( - $this->table_prefix . 'log' => array( - 'log_time' => array('log_time'), - ), - ), - 'drop_keys' => array( - $this->table_prefix . 'topics_track' => array( - 'topic_id', - ), - ), - ); - } - - public function update_data() - { - return array( - array('config.add', array('feed_overall', 1)), - array('config.add', array('feed_http_auth', 0)), - array('config.add', array('feed_limit_post', $this->config['feed_limit'])), - array('config.add', array('feed_limit_topic', $this->config['feed_overall_topics_limit'])), - array('config.add', array('feed_topics_new', $this->config['feed_overall_topics'])), - array('config.add', array('feed_topics_active', $this->config['feed_overall_topics'])), - array('custom', array(array(&$this, 'delete_text_templates'))), - - array('config.update', array('version', '3.0.7-rc1')), - ); - } - - public function delete_text_templates() - { - // Delete all text-templates from the template_data - $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . ' - WHERE template_filename ' . $this->db->sql_like_expression($this->db->any_char . '.txt'); - $this->sql_query($sql); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_7_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_7_rc2.php deleted file mode 100644 index ea430740c6..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_7_rc2.php +++ /dev/null @@ -1,75 +0,0 @@ -config['version'], '3.0.7-rc2', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_7_rc1'); - } - - public function update_data() - { - return array( - array('custom', array(array(&$this, 'update_email_hash'))), - - array('config.update', array('version', '3.0.7-rc2')), - ); - } - - public function update_email_hash($start = 0) - { - $limit = 1000; - - $sql = 'SELECT user_id, user_email, user_email_hash - FROM ' . USERS_TABLE . ' - WHERE user_type <> ' . USER_IGNORE . " - AND user_email <> ''"; - $result = $this->db->sql_query_limit($sql, $limit, $start); - - $i = 0; - while ($row = $this->db->sql_fetchrow($result)) - { - $i++; - - // Snapshot of the phpbb_email_hash() function - // We cannot call it directly because the auto updater updates the DB first. :/ - $user_email_hash = sprintf('%u', crc32(strtolower($row['user_email']))) . strlen($row['user_email']); - - if ($user_email_hash != $row['user_email_hash']) - { - $sql_ary = array( - 'user_email_hash' => $user_email_hash, - ); - - $sql = 'UPDATE ' . USERS_TABLE . ' - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' - WHERE user_id = ' . (int) $row['user_id']; - $this->sql_query($sql); - } - } - $this->db->sql_freeresult($result); - - if ($i < $limit) - { - // Completed - return; - } - - // Return the next start, will be sent to $start when this function is called again - return $start + $limit; - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_8.php b/phpBB/phpbb/db/migration/data/30x/3_0_8.php deleted file mode 100644 index c08a74e5ee..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_8.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.8', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_8_rc1'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.8')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_8_rc1.php deleted file mode 100644 index dce88e249e..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_8_rc1.php +++ /dev/null @@ -1,223 +0,0 @@ -config['version'], '3.0.8-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_7_pl1'); - } - - public function update_data() - { - return array( - array('custom', array(array(&$this, 'update_file_extension_group_names'))), - array('custom', array(array(&$this, 'update_module_auth'))), - array('custom', array(array(&$this, 'update_bots'))), - array('custom', array(array(&$this, 'delete_orphan_shadow_topics'))), - array('module.add', array( - 'acp', - 'ACP_MESSAGES', - array( - 'module_basename' => 'acp_board', - 'modes' => array('post'), - ), - )), - array('config.add', array('load_unreads_search', 1)), - array('config.update_if_equals', array(600, 'queue_interval', 60)), - array('config.update_if_equals', array(50, 'email_package_size', 20)), - - array('config.update', array('version', '3.0.8-rc1')), - ); - } - - public function update_file_extension_group_names() - { - // Update file extension group names to use language strings. - $sql = 'SELECT lang_dir - FROM ' . LANG_TABLE; - $result = $this->db->sql_query($sql); - - $extension_groups_updated = array(); - while ($lang_dir = $this->db->sql_fetchfield('lang_dir')) - { - $lang_dir = basename($lang_dir); - - // The language strings we need are either in language/.../acp/attachments.php - // in the update package if we're updating to 3.0.8-RC1 or later, - // or they are in language/.../install.php when we're updating from 3.0.7-PL1 or earlier. - // On an already updated board, they can also already be in language/.../acp/attachments.php - // in the board root. - $lang_files = array( - "{$this->phpbb_root_path}install/update/new/language/$lang_dir/acp/attachments.{$this->php_ext}", - "{$this->phpbb_root_path}language/$lang_dir/install.{$this->php_ext}", - "{$this->phpbb_root_path}language/$lang_dir/acp/attachments.{$this->php_ext}", - ); - - foreach ($lang_files as $lang_file) - { - if (!file_exists($lang_file)) - { - continue; - } - - $lang = array(); - include($lang_file); - - foreach($lang as $lang_key => $lang_val) - { - if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0) - { - continue; - } - - $sql_ary = array( - 'group_name' => substr($lang_key, 10), // Strip off 'EXT_GROUP_' - ); - - $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . " - WHERE group_name = '" . $this->db->sql_escape($lang_val) . "'"; - $this->sql_query($sql); - - $extension_groups_updated[$lang_key] = true; - } - } - } - $this->db->sql_freeresult($result); - } - - public function update_module_auth() - { - $sql = 'UPDATE ' . MODULES_TABLE . ' - SET module_auth = \'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)\' - WHERE module_class = \'ucp\' - AND module_basename = \'profile\' - AND module_mode = \'avatar\''; - $this->sql_query($sql); - } - - public function update_bots() - { - $bot_name = 'Bing [Bot]'; - $bot_name_clean = utf8_clean_string($bot_name); - - $sql = 'SELECT user_id - FROM ' . USERS_TABLE . " - WHERE username_clean = '" . $this->db->sql_escape($bot_name_clean) . "'"; - $result = $this->db->sql_query($sql); - $bing_already_added = (bool) $this->db->sql_fetchfield('user_id'); - $this->db->sql_freeresult($result); - - if (!$bing_already_added) - { - $bot_agent = 'bingbot/'; - $bot_ip = ''; - $sql = 'SELECT group_id, group_colour - FROM ' . GROUPS_TABLE . " - WHERE group_name = 'BOTS'"; - $result = $this->db->sql_query($sql); - $group_row = $this->db->sql_fetchrow($result); - $this->db->sql_freeresult($result); - - if (!$group_row) - { - // default fallback, should never get here - $group_row['group_id'] = 6; - $group_row['group_colour'] = '9E8DA7'; - } - - if (!function_exists('user_add')) - { - include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); - } - - $user_row = array( - 'user_type' => USER_IGNORE, - 'group_id' => $group_row['group_id'], - 'username' => $bot_name, - 'user_regdate' => time(), - 'user_password' => '', - 'user_colour' => $group_row['group_colour'], - 'user_email' => '', - 'user_lang' => $this->config['default_lang'], - 'user_style' => $this->config['default_style'], - 'user_timezone' => 0, - 'user_dateformat' => $this->config['default_dateformat'], - 'user_allow_massemail' => 0, - ); - - $user_id = user_add($user_row); - - $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $this->db->sql_build_array('INSERT', array( - 'bot_active' => 1, - 'bot_name' => (string) $bot_name, - 'user_id' => (int) $user_id, - 'bot_agent' => (string) $bot_agent, - 'bot_ip' => (string) $bot_ip, - )); - - $this->sql_query($sql); - } - } - - public function delete_orphan_shadow_topics() - { - // Delete shadow topics pointing to not existing topics - $batch_size = 500; - - // Set of affected forums we have to resync - $sync_forum_ids = array(); - - $sql_array = array( - 'SELECT' => 't1.topic_id, t1.forum_id', - 'FROM' => array( - TOPICS_TABLE => 't1', - ), - 'LEFT_JOIN' => array( - array( - 'FROM' => array(TOPICS_TABLE => 't2'), - 'ON' => 't1.topic_moved_id = t2.topic_id', - ), - ), - 'WHERE' => 't1.topic_moved_id <> 0 - AND t2.topic_id IS NULL', - ); - $sql = $this->db->sql_build_query('SELECT', $sql_array); - $result = $this->db->sql_query_limit($sql, $batch_size); - - $topic_ids = array(); - while ($row = $this->db->sql_fetchrow($result)) - { - $topic_ids[] = (int) $row['topic_id']; - - $sync_forum_ids[(int) $row['forum_id']] = (int) $row['forum_id']; - } - $this->db->sql_freeresult($result); - - if (!empty($topic_ids)) - { - $sql = 'DELETE FROM ' . TOPICS_TABLE . ' - WHERE ' . $this->db->sql_in_set('topic_id', $topic_ids); - $this->db->sql_query($sql); - - // Sync the forums we have deleted shadow topics from. - sync('forum', 'forum_id', $sync_forum_ids, true, true); - - return false; - } - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_9.php b/phpBB/phpbb/db/migration/data/30x/3_0_9.php deleted file mode 100644 index 8254ac8561..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_9.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.9', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_9_rc4'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.9')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc1.php b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc1.php deleted file mode 100644 index 14e0fe6013..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc1.php +++ /dev/null @@ -1,126 +0,0 @@ -config['version'], '3.0.9-rc1', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_8'); - } - - public function update_schema() - { - return array( - 'add_tables' => array( - $this->table_prefix . 'login_attempts' => array( - 'COLUMNS' => array( - // this column was removed from the database updater - // after 3.0.9-RC3 was released. It might still exist - // in 3.0.9-RCX installations and has to be dropped as - // soon as the db_tools class is capable of properly - // removing a primary key. - // 'attempt_id' => array('UINT', NULL, 'auto_increment'), - 'attempt_ip' => array('VCHAR:40', ''), - 'attempt_browser' => array('VCHAR:150', ''), - 'attempt_forwarded_for' => array('VCHAR:255', ''), - 'attempt_time' => array('TIMESTAMP', 0), - 'user_id' => array('UINT', 0), - 'username' => array('VCHAR_UNI:255', 0), - 'username_clean' => array('VCHAR_CI', 0), - ), - //'PRIMARY_KEY' => 'attempt_id', - 'KEYS' => array( - 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')), - 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')), - 'att_time' => array('INDEX', array('attempt_time')), - 'user_id' => array('INDEX', 'user_id'), - ), - ), - ), - 'change_columns' => array( - $this->table_prefix . 'bbcodes' => array( - 'bbcode_id' => array('USINT', 0), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_tables' => array( - $this->table_prefix . 'login_attempts', - ), - ); - } - - public function update_data() - { - return array( - array('config.add', array('ip_login_limit_max', 50)), - array('config.add', array('ip_login_limit_time', 21600)), - array('config.add', array('ip_login_limit_use_forwarded', 0)), - array('custom', array(array(&$this, 'update_file_extension_group_names'))), - array('custom', array(array(&$this, 'fix_firebird_qa_captcha'))), - - array('config.update', array('version', '3.0.9-rc1')), - ); - } - - public function update_file_extension_group_names() - { - // Update file extension group names to use language strings, again. - $sql = 'SELECT group_id, group_name - FROM ' . EXTENSION_GROUPS_TABLE . ' - WHERE group_name ' . $this->db->sql_like_expression('EXT_GROUP_' . $this->db->any_char); - $result = $this->db->sql_query($sql); - - while ($row = $this->db->sql_fetchrow($result)) - { - $sql_ary = array( - 'group_name' => substr($row['group_name'], 10), // Strip off 'EXT_GROUP_' - ); - - $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' - WHERE group_id = ' . $row['group_id']; - $this->sql_query($sql); - } - $this->db->sql_freeresult($result); - } - - public function fix_firebird_qa_captcha() - { - // Recover from potentially broken Q&A CAPTCHA table on firebird - // Q&A CAPTCHA was uninstallable, so it's safe to remove these - // without data loss - if ($this->db_tools->sql_layer == 'firebird') - { - $tables = array( - $this->table_prefix . 'captcha_questions', - $this->table_prefix . 'captcha_answers', - $this->table_prefix . 'qa_confirm', - ); - foreach ($tables as $table) - { - if ($this->db_tools->sql_table_exists($table)) - { - $this->db_tools->sql_table_drop($table); - } - } - } - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc2.php b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc2.php deleted file mode 100644 index 44fd789353..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc2.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.9-rc2', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_9_rc1'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.9-rc2')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc3.php b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc3.php deleted file mode 100644 index e4102fb193..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc3.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.9-rc3', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_9_rc2'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.9-rc3')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc4.php b/phpBB/phpbb/db/migration/data/30x/3_0_9_rc4.php deleted file mode 100644 index 5896d11ba5..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/3_0_9_rc4.php +++ /dev/null @@ -1,30 +0,0 @@ -config['version'], '3.0.9-rc4', '>='); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_9_rc3'); - } - - public function update_data() - { - return array( - array('config.update', array('version', '3.0.9-rc4')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/30x/local_url_bbcode.php b/phpBB/phpbb/db/migration/data/30x/local_url_bbcode.php deleted file mode 100644 index 360daed437..0000000000 --- a/phpBB/phpbb/db/migration/data/30x/local_url_bbcode.php +++ /dev/null @@ -1,59 +0,0 @@ -db->sql_like_expression($this->db->any_char . 'LOCAL_URL' . $this->db->any_char); - $result = $this->db->sql_query($sql); - - while ($row = $this->db->sql_fetchrow($result)) - { - if (!class_exists('acp_bbcodes')) - { - global $phpEx; - phpbb_require_updated('includes/acp/acp_bbcodes.' . $phpEx); - } - $bbcode_match = $row['bbcode_match']; - $bbcode_tpl = $row['bbcode_tpl']; - - $acp_bbcodes = new \acp_bbcodes(); - $sql_ary = $acp_bbcodes->build_regexp($bbcode_match, $bbcode_tpl); - - $sql = 'UPDATE ' . BBCODES_TABLE . ' - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' - WHERE bbcode_id = ' . (int) $row['bbcode_id']; - $this->sql_query($sql); - } - $this->db->sql_freeresult($result); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/avatars.php b/phpBB/phpbb/db/migration/data/310/avatars.php deleted file mode 100644 index 0d539d0c75..0000000000 --- a/phpBB/phpbb/db/migration/data/310/avatars.php +++ /dev/null @@ -1,69 +0,0 @@ -config['allow_avatar_gravatar']); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_11'); - } - - public function update_schema() - { - return array( - 'change_columns' => array( - $this->table_prefix . 'users' => array( - 'user_avatar_type' => array('VCHAR:255', ''), - ), - $this->table_prefix . 'groups' => array( - 'group_avatar_type' => array('VCHAR:255', ''), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'change_columns' => array( - $this->table_prefix . 'users' => array( - 'user_avatar_type' => array('TINT:2', ''), - ), - $this->table_prefix . 'groups' => array( - 'group_avatar_type' => array('TINT:2', ''), - ), - ), - ); - } - - public function update_data() - { - return array( - array('config.add', array('allow_avatar_gravatar', 0)), - array('custom', array(array($this, 'update_module_auth'))), - ); - } - - public function update_module_auth() - { - $sql = 'UPDATE ' . $this->table_prefix . "modules - SET module_auth = 'cfg_allow_avatar' - WHERE module_class = 'ucp' - AND module_basename = 'ucp_profile' - AND module_mode = 'avatar'"; - $this->db->sql_query($sql); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/boardindex.php b/phpBB/phpbb/db/migration/data/310/boardindex.php deleted file mode 100644 index ee403a7360..0000000000 --- a/phpBB/phpbb/db/migration/data/310/boardindex.php +++ /dev/null @@ -1,25 +0,0 @@ -config['board_index_text']); - } - - public function update_data() - { - return array( - array('config.add', array('board_index_text', '')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/config_db_text.php b/phpBB/phpbb/db/migration/data/310/config_db_text.php deleted file mode 100644 index 932edf39d7..0000000000 --- a/phpBB/phpbb/db/migration/data/310/config_db_text.php +++ /dev/null @@ -1,47 +0,0 @@ -db_tools->sql_table_exists($this->table_prefix . 'config_text'); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_11'); - } - - public function update_schema() - { - return array( - 'add_tables' => array( - $this->table_prefix . 'config_text' => array( - 'COLUMNS' => array( - 'config_name' => array('VCHAR', ''), - 'config_value' => array('MTEXT', ''), - ), - 'PRIMARY_KEY' => 'config_name', - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_tables' => array( - $this->table_prefix . 'config_text', - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/dev.php b/phpBB/phpbb/db/migration/data/310/dev.php deleted file mode 100644 index 702073bcdd..0000000000 --- a/phpBB/phpbb/db/migration/data/310/dev.php +++ /dev/null @@ -1,410 +0,0 @@ -config['version'], '3.1.0-dev', '>='); - } - - static public function depends_on() - { - return array( - '\phpbb\db\migration\data0\extensions', - '\phpbb\db\migration\data0\style_update_p2', - '\phpbb\db\migration\data0\timezone_p2', - '\phpbb\db\migration\data0\reported_posts_display', - ); - } - - public function update_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'groups' => array( - 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'), - ), - $this->table_prefix . 'profile_fields' => array( - 'field_show_on_pm' => array('BOOL', 0), - ), - $this->table_prefix . 'styles' => array( - 'style_path' => array('VCHAR:100', ''), - 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), - 'style_parent_id' => array('UINT:4', 0), - 'style_parent_tree' => array('TEXT', ''), - ), - $this->table_prefix . 'reports' => array( - 'reported_post_text' => array('MTEXT_UNI', ''), - 'reported_post_uid' => array('VCHAR:8', ''), - 'reported_post_bitfield' => array('VCHAR:255', ''), - ), - ), - 'change_columns' => array( - $this->table_prefix . 'groups' => array( - 'group_legend' => array('UINT', 0), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'groups' => array( - 'group_teampage', - ), - $this->table_prefix . 'profile_fields' => array( - 'field_show_on_pm', - ), - $this->table_prefix . 'styles' => array( - 'style_path', - 'bbcode_bitfield', - 'style_parent_id', - 'style_parent_tree', - ), - $this->table_prefix . 'reports' => array( - 'reported_post_text', - 'reported_post_uid', - 'reported_post_bitfield', - ), - ), - ); - } - - public function update_data() - { - return array( - array('if', array( - (strpos('phpbb_search_', $this->config['search_type']) !== 0), - array('config.update', array('search_type', 'phpbb_search_' . $this->config['search_type'])), - )), - - array('config.add', array('fulltext_postgres_ts_name', 'simple')), - array('config.add', array('fulltext_postgres_min_word_len', 4)), - array('config.add', array('fulltext_postgres_max_word_len', 254)), - array('config.add', array('fulltext_sphinx_stopwords', 0)), - array('config.add', array('fulltext_sphinx_indexer_mem_limit', 512)), - - array('config.add', array('load_jquery_cdn', 0)), - array('config.add', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js')), - - array('config.add', array('use_system_cron', 0)), - - array('config.add', array('legend_sort_groupname', 0)), - array('config.add', array('teampage_forums', 1)), - array('config.add', array('teampage_memberships', 1)), - - array('config.add', array('load_cpf_pm', 0)), - - array('config.add', array('display_last_subject', 1)), - - array('config.add', array('assets_version', 1)), - - array('config.add', array('site_home_url', '')), - array('config.add', array('site_home_text', '')), - - array('permission.add', array('u_chgprofileinfo', true, 'u_sig')), - - array('module.add', array( - 'acp', - 'ACP_GROUPS', - array( - 'module_basename' => 'acp_groups', - 'modes' => array('position'), - ), - )), - array('module.add', array( - 'acp', - 'ACP_ATTACHMENTS', - array( - 'module_basename' => 'acp_attachments', - 'modes' => array('manage'), - ), - )), - array('module.add', array( - 'acp', - 'ACP_STYLE_MANAGEMENT', - array( - 'module_basename' => 'acp_styles', - 'modes' => array('install', 'cache'), - ), - )), - array('module.add', array( - 'ucp', - 'UCP_PROFILE', - array( - 'module_basename' => 'ucp_profile', - 'modes' => array('autologin_keys'), - ), - )), - // Module will be renamed later - array('module.add', array( - 'acp', - 'ACP_CAT_STYLES', - 'ACP_LANGUAGE' - )), - - array('module.remove', array( - 'acp', - false, - 'ACP_TEMPLATES', - )), - array('module.remove', array( - 'acp', - false, - 'ACP_THEMES', - )), - array('module.remove', array( - 'acp', - false, - 'ACP_IMAGESETS', - )), - - array('custom', array(array($this, 'rename_module_basenames'))), - array('custom', array(array($this, 'rename_styles_module'))), - array('custom', array(array($this, 'add_group_teampage'))), - array('custom', array(array($this, 'update_group_legend'))), - array('custom', array(array($this, 'localise_global_announcements'))), - array('custom', array(array($this, 'update_ucp_pm_basename'))), - array('custom', array(array($this, 'update_ucp_profile_auth'))), - array('custom', array(array($this, 'move_customise_modules'))), - - array('config.update', array('version', '3.1.0-dev')), - ); - } - - public function move_customise_modules() - { - // Move language management to new \location in the Customise tab - // First get language module id - $sql = 'SELECT module_id FROM ' . MODULES_TABLE . " - WHERE module_basename = 'acp_language'"; - $result = $this->db->sql_query($sql); - $language_module_id = $this->db->sql_fetchfield('module_id'); - $this->db->sql_freeresult($result); - // Next get language management module id of the one just created - $sql = 'SELECT module_id FROM ' . MODULES_TABLE . " - WHERE module_langname = 'ACP_LANGUAGE'"; - $result = $this->db->sql_query($sql); - $language_management_module_id = $this->db->sql_fetchfield('module_id'); - $this->db->sql_freeresult($result); - - if (!class_exists('acp_modules')) - { - include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); - } - // acp_modules calls adm_back_link, which is undefined at this point - if (!function_exists('adm_back_link')) - { - include($this->phpbb_root_path . 'includes/functions_acp.' . $this->php_ext); - } - $module_manager = new \acp_modules(); - $module_manager->module_class = 'acp'; - $module_manager->move_module($language_module_id, $language_management_module_id); - } - - public function update_ucp_pm_basename() - { - $sql = 'SELECT module_id, module_basename - FROM ' . MODULES_TABLE . " - WHERE module_basename <> 'ucp_pm' AND - module_langname='UCP_PM'"; - $result = $this->db->sql_query_limit($sql, 1); - - if ($row = $this->db->sql_fetchrow($result)) - { - // This update is still not applied. Applying it - - $sql = 'UPDATE ' . MODULES_TABLE . " - SET module_basename = 'ucp_pm' - WHERE module_id = " . (int) $row['module_id']; - - $this->sql_query($sql); - } - $this->db->sql_freeresult($result); - } - - public function update_ucp_profile_auth() - { - // Update the auth setting for the module - $sql = 'UPDATE ' . MODULES_TABLE . " - SET module_auth = 'acl_u_chgprofileinfo' - WHERE module_class = 'ucp' - AND module_basename = 'ucp_profile' - AND module_mode = 'profile_info'"; - $this->sql_query($sql); - } - - public function rename_styles_module() - { - // Rename styles module to Customise - $sql = 'UPDATE ' . MODULES_TABLE . " - SET module_langname = 'ACP_CAT_CUSTOMISE' - WHERE module_langname = 'ACP_CAT_STYLES'"; - $this->sql_query($sql); - } - - public function rename_module_basenames() - { - // rename all module basenames to full classname - $sql = 'SELECT module_id, module_basename, module_class - FROM ' . MODULES_TABLE; - $result = $this->db->sql_query($sql); - - while ($row = $this->db->sql_fetchrow($result)) - { - $module_id = (int) $row['module_id']; - unset($row['module_id']); - - if (!empty($row['module_basename']) && !empty($row['module_class'])) - { - // all the class names start with class name or with phpbb_ for auto loading - if (strpos($row['module_basename'], $row['module_class'] . '_') !== 0 && - strpos($row['module_basename'], 'phpbb_') !== 0) - { - $row['module_basename'] = $row['module_class'] . '_' . $row['module_basename']; - - $sql_update = $this->db->sql_build_array('UPDATE', $row); - - $sql = 'UPDATE ' . MODULES_TABLE . ' - SET ' . $sql_update . ' - WHERE module_id = ' . $module_id; - $this->sql_query($sql); - } - } - } - - $this->db->sql_freeresult($result); - } - - public function add_group_teampage() - { - $sql = 'UPDATE ' . GROUPS_TABLE . ' - SET group_teampage = 1 - WHERE group_type = ' . GROUP_SPECIAL . " - AND group_name = 'ADMINISTRATORS'"; - $this->sql_query($sql); - - $sql = 'UPDATE ' . GROUPS_TABLE . ' - SET group_teampage = 2 - WHERE group_type = ' . GROUP_SPECIAL . " - AND group_name = 'GLOBAL_MODERATORS'"; - $this->sql_query($sql); - } - - public function update_group_legend() - { - $sql = 'SELECT group_id - FROM ' . GROUPS_TABLE . ' - WHERE group_legend = 1 - ORDER BY group_name ASC'; - $result = $this->db->sql_query($sql); - - $next_legend = 1; - while ($row = $this->db->sql_fetchrow($result)) - { - $sql = 'UPDATE ' . GROUPS_TABLE . ' - SET group_legend = ' . $next_legend . ' - WHERE group_id = ' . (int) $row['group_id']; - $this->sql_query($sql); - - $next_legend++; - } - $this->db->sql_freeresult($result); - } - - public function localise_global_announcements() - { - // Localise Global Announcements - $sql = 'SELECT topic_id, topic_approved, (topic_replies + 1) AS topic_posts, topic_last_post_id, topic_last_post_subject, topic_last_post_time, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour - FROM ' . TOPICS_TABLE . ' - WHERE forum_id = 0 - AND topic_type = ' . POST_GLOBAL; - $result = $this->db->sql_query($sql); - - $global_announcements = $update_lastpost_data = array(); - $update_lastpost_data['forum_last_post_time'] = 0; - $update_forum_data = array( - 'forum_posts' => 0, - 'forum_topics' => 0, - 'forum_topics_real' => 0, - ); - - while ($row = $this->db->sql_fetchrow($result)) - { - $global_announcements[] = (int) $row['topic_id']; - - $update_forum_data['forum_posts'] += (int) $row['topic_posts']; - $update_forum_data['forum_topics_real']++; - if ($row['topic_approved']) - { - $update_forum_data['forum_topics']++; - } - - if ($update_lastpost_data['forum_last_post_time'] < $row['topic_last_post_time']) - { - $update_lastpost_data = array( - 'forum_last_post_id' => (int) $row['topic_last_post_id'], - 'forum_last_post_subject' => $row['topic_last_post_subject'], - 'forum_last_post_time' => (int) $row['topic_last_post_time'], - 'forum_last_poster_id' => (int) $row['topic_last_poster_id'], - 'forum_last_poster_name' => $row['topic_last_poster_name'], - 'forum_last_poster_colour' => $row['topic_last_poster_colour'], - ); - } - } - $this->db->sql_freeresult($result); - - if (!empty($global_announcements)) - { - // Update the post/topic-count for the forum and the last-post if needed - $sql = 'SELECT forum_id - FROM ' . FORUMS_TABLE . ' - WHERE forum_type = ' . FORUM_POST; - $result = $this->db->sql_query_limit($sql, 1); - $ga_forum_id = $this->db->sql_fetchfield('forum_id'); - $this->db->sql_freeresult($result); - - $sql = 'SELECT forum_last_post_time - FROM ' . FORUMS_TABLE . ' - WHERE forum_id = ' . $ga_forum_id; - $result = $this->db->sql_query($sql); - $lastpost = (int) $this->db->sql_fetchfield('forum_last_post_time'); - $this->db->sql_freeresult($result); - - $sql_update = 'forum_posts = forum_posts + ' . $update_forum_data['forum_posts'] . ', '; - $sql_update .= 'forum_topics_real = forum_topics_real + ' . $update_forum_data['forum_topics_real'] . ', '; - $sql_update .= 'forum_topics = forum_topics + ' . $update_forum_data['forum_topics']; - if ($lastpost < $update_lastpost_data['forum_last_post_time']) - { - $sql_update .= ', ' . $this->db->sql_build_array('UPDATE', $update_lastpost_data); - } - - $sql = 'UPDATE ' . FORUMS_TABLE . ' - SET ' . $sql_update . ' - WHERE forum_id = ' . $ga_forum_id; - $this->sql_query($sql); - - // Update some forum_ids - $table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE); - foreach ($table_ary as $table) - { - $sql = "UPDATE $table - SET forum_id = $ga_forum_id - WHERE " . $this->db->sql_in_set('topic_id', $global_announcements); - $this->sql_query($sql); - } - unset($table_ary); - } - } -} diff --git a/phpBB/phpbb/db/migration/data/310/extensions.php b/phpBB/phpbb/db/migration/data/310/extensions.php deleted file mode 100644 index fde2038cca..0000000000 --- a/phpBB/phpbb/db/migration/data/310/extensions.php +++ /dev/null @@ -1,71 +0,0 @@ -db_tools->sql_table_exists($this->table_prefix . 'ext'); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_11'); - } - - public function update_schema() - { - return array( - 'add_tables' => array( - $this->table_prefix . 'ext' => array( - 'COLUMNS' => array( - 'ext_name' => array('VCHAR', ''), - 'ext_active' => array('BOOL', 0), - 'ext_state' => array('TEXT', ''), - ), - 'KEYS' => array( - 'ext_name' => array('UNIQUE', 'ext_name'), - ), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_tables' => array( - $this->table_prefix . 'ext', - ), - ); - } - - public function update_data() - { - return array( - // Module will be renamed later - array('module.add', array( - 'acp', - 'ACP_CAT_STYLES', - 'ACP_EXTENSION_MANAGEMENT' - )), - array('module.add', array( - 'acp', - 'ACP_EXTENSION_MANAGEMENT', - array( - 'module_basename' => 'acp_extensions', - 'modes' => array('main'), - ), - )), - array('permission.add', array('a_extensions', true, 'a_styles')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/forgot_password.php b/phpBB/phpbb/db/migration/data/310/forgot_password.php deleted file mode 100644 index 9a42565223..0000000000 --- a/phpBB/phpbb/db/migration/data/310/forgot_password.php +++ /dev/null @@ -1,30 +0,0 @@ -config['allow_password_reset']); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_11'); - } - - public function update_data() - { - return array( - array('config.add', array('allow_password_reset', 1)), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/jquery_update.php b/phpBB/phpbb/db/migration/data/310/jquery_update.php deleted file mode 100644 index 2b30e2dd3b..0000000000 --- a/phpBB/phpbb/db/migration/data/310/jquery_update.php +++ /dev/null @@ -1,33 +0,0 @@ -config['load_jquery_url'] !== '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'; - } - - static public function depends_on() - { - return array( - '\phpbb\db\migration\data0\dev', - ); - } - - public function update_data() - { - return array( - array('config.update', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js')), - ); - } - -} diff --git a/phpBB/phpbb/db/migration/data/310/notification_options_reconvert.php b/phpBB/phpbb/db/migration/data/310/notification_options_reconvert.php deleted file mode 100644 index 482051c287..0000000000 --- a/phpBB/phpbb/db/migration/data/310/notification_options_reconvert.php +++ /dev/null @@ -1,120 +0,0 @@ -table_prefix . 'user_notifications'; - $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $insert_table); - - $this->perform_conversion($insert_buffer, $insert_table); - } - - /** - * Perform the conversion (separate for testability) - * - * @param \phpbb\db\sql_insert_buffer $insert_buffer - * @param string $insert_table - */ - public function perform_conversion(\phpbb\db\sql_insert_buffer $insert_buffer, $insert_table) - { - $sql = 'DELETE FROM ' . $insert_table; - $this->db->sql_query($sql); - - $sql = 'SELECT user_id, user_notify_type, user_notify_pm - FROM ' . USERS_TABLE; - $result = $this->db->sql_query($sql); - - while ($row = $this->db->sql_fetchrow($result)) - { - $notification_methods = array(); - - // In-board notification - $notification_methods[] = ''; - - if ($row['user_notify_type'] == NOTIFY_EMAIL || $row['user_notify_type'] == NOTIFY_BOTH) - { - $notification_methods[] = 'email'; - } - - if ($row['user_notify_type'] == NOTIFY_IM || $row['user_notify_type'] == NOTIFY_BOTH) - { - $notification_methods[] = 'jabber'; - } - - // Notifications for posts - foreach (array('post', 'topic') as $item_type) - { - $this->add_method_rows( - $insert_buffer, - $item_type, - 0, - $row['user_id'], - $notification_methods - ); - } - - if ($row['user_notify_pm']) - { - // Notifications for private messages - // User either gets all methods or no method - $this->add_method_rows( - $insert_buffer, - 'pm', - 0, - $row['user_id'], - $notification_methods - ); - } - } - $this->db->sql_freeresult($result); - - $insert_buffer->flush(); - } - - /** - * Insert method rows to DB - * - * @param \phpbb\db\sql_insert_buffer $insert_buffer - * @param string $item_type - * @param int $item_id - * @param int $user_id - * @param string $methods - */ - protected function add_method_rows(\phpbb\db\sql_insert_buffer $insert_buffer, $item_type, $item_id, $user_id, array $methods) - { - $row_base = array( - 'item_type' => $item_type, - 'item_id' => (int) $item_id, - 'user_id' => (int) $user_id, - 'notify' => 1 - ); - - foreach ($methods as $method) - { - $row_base['method'] = $method; - $insert_buffer->insert($row_base); - } - } -} diff --git a/phpBB/phpbb/db/migration/data/310/notifications.php b/phpBB/phpbb/db/migration/data/310/notifications.php deleted file mode 100644 index f5bd9ebf07..0000000000 --- a/phpBB/phpbb/db/migration/data/310/notifications.php +++ /dev/null @@ -1,98 +0,0 @@ -db_tools->sql_table_exists($this->table_prefix . 'notifications'); - } - - static public function depends_on() - { - return array('\phpbb\db\migration\data0\dev'); - } - - public function update_schema() - { - return array( - 'add_tables' => array( - $this->table_prefix . 'notification_types' => array( - 'COLUMNS' => array( - 'notification_type' => array('VCHAR:255', ''), - 'notification_type_enabled' => array('BOOL', 1), - ), - 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'), - ), - $this->table_prefix . 'notifications' => array( - 'COLUMNS' => array( - 'notification_id' => array('UINT', NULL, 'auto_increment'), - 'item_type' => array('VCHAR:255', ''), - 'item_id' => array('UINT', 0), - 'item_parent_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'notification_read' => array('BOOL', 0), - 'notification_time' => array('TIMESTAMP', 1), - 'notification_data' => array('TEXT_UNI', ''), - ), - 'PRIMARY_KEY' => 'notification_id', - 'KEYS' => array( - 'item_ident' => array('INDEX', array('item_type', 'item_id')), - 'user' => array('INDEX', array('user_id', 'notification_read')), - ), - ), - $this->table_prefix . 'user_notifications' => array( - 'COLUMNS' => array( - 'item_type' => array('VCHAR:255', ''), - 'item_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'method' => array('VCHAR:255', ''), - 'notify' => array('BOOL', 1), - ), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_tables' => array( - $this->table_prefix . 'notification_types', - $this->table_prefix . 'notifications', - $this->table_prefix . 'user_notifications', - ), - ); - } - - public function update_data() - { - return array( - array('module.add', array( - 'ucp', - 'UCP_MAIN', - array( - 'module_basename' => 'ucp_notifications', - 'modes' => array('notification_list'), - ), - )), - array('module.add', array( - 'ucp', - 'UCP_PREFS', - array( - 'module_basename' => 'ucp_notifications', - 'modes' => array('notification_options'), - ), - )), - array('config.add', array('load_notifications', 1)), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/notifications_schema_fix.php b/phpBB/phpbb/db/migration/data/310/notifications_schema_fix.php deleted file mode 100644 index fa2da6fe92..0000000000 --- a/phpBB/phpbb/db/migration/data/310/notifications_schema_fix.php +++ /dev/null @@ -1,94 +0,0 @@ - array( - $this->table_prefix . 'notification_types', - $this->table_prefix . 'notifications', - ), - 'add_tables' => array( - $this->table_prefix . 'notification_types' => array( - 'COLUMNS' => array( - 'notification_type_id' => array('USINT', NULL, 'auto_increment'), - 'notification_type_name' => array('VCHAR:255', ''), - 'notification_type_enabled' => array('BOOL', 1), - ), - 'PRIMARY_KEY' => array('notification_type_id'), - 'KEYS' => array( - 'type' => array('UNIQUE', array('notification_type_name')), - ), - ), - $this->table_prefix . 'notifications' => array( - 'COLUMNS' => array( - 'notification_id' => array('UINT:10', NULL, 'auto_increment'), - 'notification_type_id' => array('USINT', 0), - 'item_id' => array('UINT', 0), - 'item_parent_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'notification_read' => array('BOOL', 0), - 'notification_time' => array('TIMESTAMP', 1), - 'notification_data' => array('TEXT_UNI', ''), - ), - 'PRIMARY_KEY' => 'notification_id', - 'KEYS' => array( - 'item_ident' => array('INDEX', array('notification_type_id', 'item_id')), - 'user' => array('INDEX', array('user_id', 'notification_read')), - ), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_tables' => array( - $this->table_prefix . 'notification_types', - $this->table_prefix . 'notifications', - ), - 'add_tables' => array( - $this->table_prefix . 'notification_types' => array( - 'COLUMNS' => array( - 'notification_type' => array('VCHAR:255', ''), - 'notification_type_enabled' => array('BOOL', 1), - ), - 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'), - ), - $this->table_prefix . 'notifications' => array( - 'COLUMNS' => array( - 'notification_id' => array('UINT', NULL, 'auto_increment'), - 'item_type' => array('VCHAR:255', ''), - 'item_id' => array('UINT', 0), - 'item_parent_id' => array('UINT', 0), - 'user_id' => array('UINT', 0), - 'notification_read' => array('BOOL', 0), - 'notification_time' => array('TIMESTAMP', 1), - 'notification_data' => array('TEXT_UNI', ''), - ), - 'PRIMARY_KEY' => 'notification_id', - 'KEYS' => array( - 'item_ident' => array('INDEX', array('item_type', 'item_id')), - 'user' => array('INDEX', array('user_id', 'notification_read')), - ), - ), - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/reported_posts_display.php b/phpBB/phpbb/db/migration/data/310/reported_posts_display.php deleted file mode 100644 index ef35f48970..0000000000 --- a/phpBB/phpbb/db/migration/data/310/reported_posts_display.php +++ /dev/null @@ -1,49 +0,0 @@ -db_tools->sql_column_exists($this->table_prefix . 'reports', 'reported_post_enable_bbcode'); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_11'); - } - - public function update_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'reports' => array( - 'reported_post_enable_bbcode' => array('BOOL', 1), - 'reported_post_enable_smilies' => array('BOOL', 1), - 'reported_post_enable_magic_url' => array('BOOL', 1), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'reports' => array( - 'reported_post_enable_bbcode', - 'reported_post_enable_smilies', - 'reported_post_enable_magic_url', - ), - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/signature_module_auth.php b/phpBB/phpbb/db/migration/data/310/signature_module_auth.php deleted file mode 100644 index 27585fec10..0000000000 --- a/phpBB/phpbb/db/migration/data/310/signature_module_auth.php +++ /dev/null @@ -1,53 +0,0 @@ -db->sql_query($sql); - $module_auth = $this->db_sql_fetchfield('module_auth'); - $this->db->sql_freeresult($result); - - return $module_auth === 'acl_u_sig' || $module_auth === false; - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_31x_dev'); - } - - public function update_data() - { - return array( - array('custom', array( - array($this, 'update_signature_module_auth'), - ), - ), - ); - } - - public function update_signature_module_auth() - { - $sql = 'UPDATE ' . MODULES_TABLE . " - SET module_auth = 'acl_u_sig' - WHERE module_class = 'ucp' - AND module_basename = 'ucp_profile' - AND module_mode = 'signature' - AND module_auth = ''"; - $this->db->sql_query($sql); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/softdelete_p1.php b/phpBB/phpbb/db/migration/data/310/softdelete_p1.php deleted file mode 100644 index 22ee78bb22..0000000000 --- a/phpBB/phpbb/db/migration/data/310/softdelete_p1.php +++ /dev/null @@ -1,173 +0,0 @@ -db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_visibility'); - } - - static public function depends_on() - { - return array('\phpbb\db\migration\data0\dev'); - } - - public function update_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'forums' => array( - 'forum_posts_approved' => array('UINT', 0), - 'forum_posts_unapproved' => array('UINT', 0), - 'forum_posts_softdeleted' => array('UINT', 0), - 'forum_topics_approved' => array('UINT', 0), - 'forum_topics_unapproved' => array('UINT', 0), - 'forum_topics_softdeleted' => array('UINT', 0), - ), - $this->table_prefix . 'posts' => array( - 'post_visibility' => array('TINT:3', 0), - 'post_delete_time' => array('TIMESTAMP', 0), - 'post_delete_reason' => array('STEXT_UNI', ''), - 'post_delete_user' => array('UINT', 0), - ), - $this->table_prefix . 'topics' => array( - 'topic_visibility' => array('TINT:3', 0), - 'topic_delete_time' => array('TIMESTAMP', 0), - 'topic_delete_reason' => array('STEXT_UNI', ''), - 'topic_delete_user' => array('UINT', 0), - 'topic_posts_approved' => array('UINT', 0), - 'topic_posts_unapproved' => array('UINT', 0), - 'topic_posts_softdeleted' => array('UINT', 0), - ), - ), - 'add_index' => array( - $this->table_prefix . 'posts' => array( - 'post_visibility' => array('post_visibility'), - ), - $this->table_prefix . 'topics' => array( - 'topic_visibility' => array('topic_visibility'), - 'forum_vis_last' => array('forum_id', 'topic_visibility', 'topic_last_post_id'), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'forums' => array( - 'forum_posts_approved', - 'forum_posts_unapproved', - 'forum_posts_softdeleted', - 'forum_topics_approved', - 'forum_topics_unapproved', - 'forum_topics_softdeleted', - ), - $this->table_prefix . 'posts' => array( - 'post_visibility', - 'post_delete_time', - 'post_delete_reason', - 'post_delete_user', - ), - $this->table_prefix . 'topics' => array( - 'topic_visibility', - 'topic_delete_time', - 'topic_delete_reason', - 'topic_delete_user', - 'topic_posts_approved', - 'topic_posts_unapproved', - 'topic_posts_softdeleted', - ), - ), - 'drop_keys' => array( - $this->table_prefix . 'posts' => array('post_visibility'), - $this->table_prefix . 'topics' => array('topic_visibility', 'forum_vis_last'), - ), - ); - } - - public function update_data() - { - return array( - array('custom', array(array($this, 'update_post_visibility'))), - array('custom', array(array($this, 'update_topic_visibility'))), - array('custom', array(array($this, 'update_topic_forum_counts'))), - - array('permission.add', array('f_softdelete', false)), - array('permission.add', array('m_softdelete', false)), - ); - } - - public function update_post_visibility() - { - $sql = 'UPDATE ' . $this->table_prefix . 'posts - SET post_visibility = post_approved'; - $this->sql_query($sql); - } - - public function update_topic_visibility() - { - $sql = 'UPDATE ' . $this->table_prefix . 'topics - SET topic_visibility = topic_approved'; - $this->sql_query($sql); - } - - public function update_topic_forum_counts() - { - $sql = 'UPDATE ' . $this->table_prefix . 'topics - SET topic_posts_approved = topic_replies + 1, - topic_posts_unapproved = topic_replies_real - topic_replies - WHERE topic_visibility = ' . ITEM_APPROVED; - $this->sql_query($sql); - - $sql = 'UPDATE ' . $this->table_prefix . 'topics - SET topic_posts_approved = 0, - topic_posts_unapproved = (topic_replies_real - topic_replies) + 1 - WHERE topic_visibility = ' . ITEM_UNAPPROVED; - $this->sql_query($sql); - - $sql = 'SELECT forum_id, topic_visibility, COUNT(topic_id) AS sum_topics, SUM(topic_posts_approved) AS sum_posts_approved, SUM(topic_posts_unapproved) AS sum_posts_unapproved - FROM ' . $this->table_prefix . 'topics - GROUP BY forum_id, topic_visibility'; - $result = $this->db->sql_query($sql); - - $update_forums = array(); - while ($row = $this->db->sql_fetchrow($result)) - { - $forum_id = (int) $row['forum_id']; - if (!isset($update_forums[$forum_id])) - { - $update_forums[$forum_id] = array( - 'forum_posts_approved' => 0, - 'forum_posts_unapproved' => 0, - 'forum_topics_approved' => 0, - 'forum_topics_unapproved' => 0, - ); - } - - $update_forums[$forum_id]['forum_posts_approved'] += (int) $row['sum_posts_approved']; - $update_forums[$forum_id]['forum_posts_unapproved'] += (int) $row['sum_posts_unapproved']; - - $update_forums[$forum_id][(($row['topic_visibility'] == ITEM_APPROVED) ? 'forum_topics_approved' : 'forum_topics_unapproved')] += (int) $row['sum_topics']; - } - $this->db->sql_freeresult($result); - - foreach ($update_forums as $forum_id => $forum_data) - { - $sql = 'UPDATE ' . FORUMS_TABLE . ' - SET ' . $this->db->sql_build_array('UPDATE', $forum_data) . ' - WHERE forum_id = ' . $forum_id; - $this->sql_query($sql); - } - } -} diff --git a/phpBB/phpbb/db/migration/data/310/softdelete_p2.php b/phpBB/phpbb/db/migration/data/310/softdelete_p2.php deleted file mode 100644 index 698e44fab7..0000000000 --- a/phpBB/phpbb/db/migration/data/310/softdelete_p2.php +++ /dev/null @@ -1,70 +0,0 @@ -db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_approved'); - } - - static public function depends_on() - { - return array( - '\phpbb\db\migration\data0\dev', - '\phpbb\db\migration\data0\softdelete_p1', - ); - } - - public function update_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'forums' => array('forum_posts', 'forum_topics', 'forum_topics_real'), - $this->table_prefix . 'posts' => array('post_approved'), - $this->table_prefix . 'topics' => array('topic_approved', 'topic_replies', 'topic_replies_real'), - ), - 'drop_keys' => array( - $this->table_prefix . 'posts' => array('post_approved'), - $this->table_prefix . 'topics' => array('forum_appr_last'), - ), - ); - } - - public function revert_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'forums' => array( - 'forum_posts' => array('UINT', 0), - 'forum_topics' => array('UINT', 0), - 'forum_topics_real' => array('UINT', 0), - ), - $this->table_prefix . 'posts' => array( - 'post_approved' => array('BOOL', 1), - ), - $this->table_prefix . 'topics' => array( - 'topic_approved' => array('BOOL', 1), - 'topic_replies' => array('UINT', 0), - 'topic_replies_real' => array('UINT', 0), - ), - ), - 'add_index' => array( - $this->table_prefix . 'posts' => array( - 'post_approved' => array('post_approved'), - ), - $this->table_prefix . 'topics' => array( - 'forum_appr_last' => array('forum_id', 'topic_approved', 'topic_last_post_id'), - ), - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/style_update_p1.php b/phpBB/phpbb/db/migration/data/310/style_update_p1.php deleted file mode 100644 index fe60993f20..0000000000 --- a/phpBB/phpbb/db/migration/data/310/style_update_p1.php +++ /dev/null @@ -1,187 +0,0 @@ -db_tools->sql_table_exists($this->table_prefix . 'styles_imageset'); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_11'); - } - - public function update_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'styles' => array( - 'style_path' => array('VCHAR:100', ''), - 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), - 'style_parent_id' => array('UINT', 0), - 'style_parent_tree' => array('TEXT', ''), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'styles' => array( - 'style_path', - 'bbcode_bitfield', - 'style_parent_id', - 'style_parent_tree', - ), - ), - ); - } - - public function update_data() - { - return array( - array('custom', array(array($this, 'styles_update'))), - ); - } - - public function styles_update() - { - // Get list of valid 3.1 styles - $available_styles = array('prosilver'); - - $iterator = new \DirectoryIterator($this->phpbb_root_path . 'styles'); - $skip_dirs = array('.', '..', 'prosilver'); - foreach ($iterator as $fileinfo) - { - if ($fileinfo->isDir() && !in_array($fileinfo->getFilename(), $skip_dirs) && file_exists($fileinfo->getPathname() . '/style.cfg')) - { - $style_cfg = parse_cfg_file($fileinfo->getPathname() . '/style.cfg'); - if (isset($style_cfg['phpbb_version']) && version_compare($style_cfg['phpbb_version'], '3.1.0-dev', '>=')) - { - // 3.1 style - $available_styles[] = $fileinfo->getFilename(); - } - } - } - - // Get all installed styles - if ($this->db_tools->sql_table_exists($this->table_prefix . 'styles_imageset')) - { - $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_id, i.imageset_path - FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . 'styles_theme c, ' . $this->table_prefix . "styles_imageset i - WHERE t.template_id = s.template_id - AND c.theme_id = s.theme_id - AND i.imageset_id = s.imageset_id"; - } - else - { - $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_id - FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . "stles_theme c - WHERE t.template_id = s.template_id - AND c.theme_id = s.theme_id"; - } - $result = $this->db->sql_query($sql); - - $styles = array(); - while ($row = $this->db->sql_fetchrow($result)) - { - $styles[] = $row; - } - $this->db->sql_freeresult($result); - - // Decide which styles to keep, all others will be deleted - $valid_styles = array(); - foreach ($styles as $style_row) - { - if ( - // Delete styles with parent style (not supported yet) - $style_row['template_inherits_id'] == 0 && - // Check if components match - $style_row['template_path'] == $style_row['theme_path'] && (!isset($style_row['imageset_path']) || $style_row['template_path'] == $style_row['imageset_path']) && - // Check if components are valid - in_array($style_row['template_path'], $available_styles) - ) - { - // Valid style. Keep it - $sql_ary = array( - 'style_path' => $style_row['template_path'], - 'bbcode_bitfield' => $style_row['bbcode_bitfield'], - 'style_parent_id' => 0, - 'style_parent_tree' => '', - ); - $this->sql_query('UPDATE ' . STYLES_TABLE . ' - SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' - WHERE style_id = ' . $style_row['style_id']); - $valid_styles[] = (int) $style_row['style_id']; - } - } - - // Remove old entries from styles table - if (!sizeof($valid_styles)) - { - // No valid styles: remove everything and add prosilver - $this->sql_query('DELETE FROM ' . STYLES_TABLE, $errored, $error_ary); - - $sql_ary = array( - 'style_name' => 'prosilver', - 'style_copyright' => '© phpBB Group', - 'style_active' => 1, - 'style_path' => 'prosilver', - 'bbcode_bitfield' => 'lNg=', - 'style_parent_id' => 0, - 'style_parent_tree' => '', - - // Will be removed in the next step - 'imageset_id' => 0, - 'template_id' => 0, - 'theme_id' => 0, - ); - - $sql = 'INSERT INTO ' . STYLES_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); - $this->sql_query($sql); - - $sql = 'SELECT style_id - FROM ' . $table . " - WHERE style_name = 'prosilver'"; - $result = $this->sql_query($sql); - $default_style = $this->db->sql_fetchfield($result); - $this->db->sql_freeresult($result); - - set_config('default_style', $default_style); - - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0'; - $this->sql_query($sql); - } - else - { - // There are valid styles in styles table. Remove styles that are outdated - $this->sql_query('DELETE FROM ' . STYLES_TABLE . ' - WHERE ' . $this->db->sql_in_set('style_id', $valid_styles, true)); - - // Change default style - if (!in_array($this->config['default_style'], $valid_styles)) - { - $this->sql_query('UPDATE ' . CONFIG_TABLE . " - SET config_value = '" . $valid_styles[0] . "' - WHERE config_name = 'default_style'"); - } - - // Reset styles for users - $this->sql_query('UPDATE ' . USERS_TABLE . ' - SET user_style = 0 - WHERE ' . $this->db->sql_in_set('user_style', $valid_styles, true)); - } - } -} diff --git a/phpBB/phpbb/db/migration/data/310/style_update_p2.php b/phpBB/phpbb/db/migration/data/310/style_update_p2.php deleted file mode 100644 index 3f6477b7cb..0000000000 --- a/phpBB/phpbb/db/migration/data/310/style_update_p2.php +++ /dev/null @@ -1,131 +0,0 @@ -db_tools->sql_table_exists($this->table_prefix . 'styles_imageset'); - } - - static public function depends_on() - { - return array('\phpbb\db\migration\data0\style_update_p1'); - } - - public function update_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'styles' => array( - 'imageset_id', - 'template_id', - 'theme_id', - ), - ), - - 'drop_tables' => array( - $this->table_prefix . 'styles_imageset', - $this->table_prefix . 'styles_imageset_data', - $this->table_prefix . 'styles_template', - $this->table_prefix . 'styles_template_data', - $this->table_prefix . 'styles_theme', - ), - ); - } - - public function revert_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'styles' => array( - 'imageset_id' => array('UINT', 0), - 'template_id' => array('UINT', 0), - 'theme_id' => array('UINT', 0), - ), - ), - - 'add_tables' => array( - $this->table_prefix . 'styles_imageset' => array( - 'COLUMNS' => array( - 'imageset_id' => array('UINT', NULL, 'auto_increment'), - 'imageset_name' => array('VCHAR_UNI:255', ''), - 'imageset_copyright' => array('VCHAR_UNI', ''), - 'imageset_path' => array('VCHAR:100', ''), - ), - 'PRIMARY_KEY' => 'imageset_id', - 'KEYS' => array( - 'imgset_nm' => array('UNIQUE', 'imageset_name'), - ), - ), - $this->table_prefix . 'styles_imageset_data' => array( - 'COLUMNS' => array( - 'image_id' => array('UINT', NULL, 'auto_increment'), - 'image_name' => array('VCHAR:200', ''), - 'image_filename' => array('VCHAR:200', ''), - 'image_lang' => array('VCHAR:30', ''), - 'image_height' => array('USINT', 0), - 'image_width' => array('USINT', 0), - 'imageset_id' => array('UINT', 0), - ), - 'PRIMARY_KEY' => 'image_id', - 'KEYS' => array( - 'i_d' => array('INDEX', 'imageset_id'), - ), - ), - $this->table_prefix . 'styles_template' => array( - 'COLUMNS' => array( - 'template_id' => array('UINT', NULL, 'auto_increment'), - 'template_name' => array('VCHAR_UNI:255', ''), - 'template_copyright' => array('VCHAR_UNI', ''), - 'template_path' => array('VCHAR:100', ''), - 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), - 'template_storedb' => array('BOOL', 0), - 'template_inherits_id' => array('UINT:4', 0), - 'template_inherit_path' => array('VCHAR', ''), - ), - 'PRIMARY_KEY' => 'template_id', - 'KEYS' => array( - 'tmplte_nm' => array('UNIQUE', 'template_name'), - ), - ), - $this->table_prefix . 'styles_template_data' => array( - 'COLUMNS' => array( - 'template_id' => array('UINT', 0), - 'template_filename' => array('VCHAR:100', ''), - 'template_included' => array('TEXT', ''), - 'template_mtime' => array('TIMESTAMP', 0), - 'template_data' => array('MTEXT_UNI', ''), - ), - 'KEYS' => array( - 'tid' => array('INDEX', 'template_id'), - 'tfn' => array('INDEX', 'template_filename'), - ), - ), - $this->table_prefix . 'styles_theme' => array( - 'COLUMNS' => array( - 'theme_id' => array('UINT', NULL, 'auto_increment'), - 'theme_name' => array('VCHAR_UNI:255', ''), - 'theme_copyright' => array('VCHAR_UNI', ''), - 'theme_path' => array('VCHAR:100', ''), - 'theme_storedb' => array('BOOL', 0), - 'theme_mtime' => array('TIMESTAMP', 0), - 'theme_data' => array('MTEXT_UNI', ''), - ), - 'PRIMARY_KEY' => 'theme_id', - 'KEYS' => array( - 'theme_name' => array('UNIQUE', 'theme_name'), - ), - ), - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/teampage.php b/phpBB/phpbb/db/migration/data/310/teampage.php deleted file mode 100644 index 605156dc41..0000000000 --- a/phpBB/phpbb/db/migration/data/310/teampage.php +++ /dev/null @@ -1,106 +0,0 @@ -db_tools->sql_table_exists($this->table_prefix . 'teampage'); - } - - static public function depends_on() - { - return array('\phpbb\db\migration\data0\dev'); - } - - public function update_schema() - { - return array( - 'add_tables' => array( - $this->table_prefix . 'teampage' => array( - 'COLUMNS' => array( - 'teampage_id' => array('UINT', NULL, 'auto_increment'), - 'group_id' => array('UINT', 0), - 'teampage_name' => array('VCHAR_UNI:255', ''), - 'teampage_position' => array('UINT', 0), - 'teampage_parent' => array('UINT', 0), - ), - 'PRIMARY_KEY' => 'teampage_id', - ), - ), - 'drop_columns' => array( - $this->table_prefix . 'groups' => array( - 'group_teampage', - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_tables' => array( - $this->table_prefix . 'teampage', - ), - 'add_columns' => array( - $this->table_prefix . 'groups' => array( - 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'), - ), - ), - ); - } - - public function update_data() - { - return array( - array('custom', array(array($this, 'add_groups_teampage'))), - ); - } - - public function add_groups_teampage() - { - $sql = 'SELECT teampage_id - FROM ' . TEAMPAGE_TABLE; - $result = $this->db->sql_query_limit($sql, 1); - $added_groups_teampage = (bool) $this->db->sql_fetchfield('teampage_id'); - $this->db->sql_freeresult($result); - - if (!$added_groups_teampage) - { - $sql = 'SELECT * - FROM ' . GROUPS_TABLE . ' - WHERE group_type = ' . GROUP_SPECIAL . " - AND (group_name = 'ADMINISTRATORS' - OR group_name = 'GLOBAL_MODERATORS') - ORDER BY group_name ASC"; - $result = $this->db->sql_query($sql); - - $teampage_entries = array(); - while ($row = $this->db->sql_fetchrow($result)) - { - $teampage_entries[] = array( - 'group_id' => (int) $row['group_id'], - 'teampage_name' => '', - 'teampage_position' => sizeof($teampage_entries) + 1, - 'teampage_parent' => 0, - ); - } - $this->db->sql_freeresult($result); - - if (sizeof($teampage_entries)) - { - $this->db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_entries); - } - unset($teampage_entries); - } - - } -} diff --git a/phpBB/phpbb/db/migration/data/310/timezone.php b/phpBB/phpbb/db/migration/data/310/timezone.php deleted file mode 100644 index 97fea19a64..0000000000 --- a/phpBB/phpbb/db/migration/data/310/timezone.php +++ /dev/null @@ -1,165 +0,0 @@ -db_tools->sql_column_exists($this->table_prefix . 'users', 'user_dst'); - } - - static public function depends_on() - { - return array('phpbb_db_migration_data_30x_3_0_11'); - } - - public function update_schema() - { - return array( - 'change_columns' => array( - $this->table_prefix . 'users' => array( - 'user_timezone' => array('VCHAR:100', ''), - ), - ), - ); - } - - public function update_data() - { - return array( - array('custom', array(array($this, 'update_timezones'))), - ); - } - - public function update_timezones() - { - // Update user timezones - $sql = 'SELECT user_dst, user_timezone - FROM ' . $this->table_prefix . 'users - GROUP BY user_timezone, user_dst'; - $result = $this->db->sql_query($sql); - - while ($row = $this->db->sql_fetchrow($result)) - { - $sql = 'UPDATE ' . $this->table_prefix . "users - SET user_timezone = '" . $this->db->sql_escape($this->convert_phpbb30_timezone($row['user_timezone'], $row['user_dst'])) . "' - WHERE user_timezone = '" . $this->db->sql_escape($row['user_timezone']) . "' - AND user_dst = " . (int) $row['user_dst']; - $this->sql_query($sql); - } - $this->db->sql_freeresult($result); - - // Update board default timezone - $sql = 'UPDATE ' . $this->table_prefix . "config - SET config_value = '" . $this->convert_phpbb30_timezone($this->config['board_timezone'], $this->config['board_dst']) . "' - WHERE config_name = 'board_timezone'"; - $this->sql_query($sql); - } - - /** - * Determine the new \timezone for a given phpBB 3.0 timezone and - * "Daylight Saving Time" option - * - * @param $timezone float Users timezone in 3.0 - * @param $dst int Users daylight saving time - * @return string Users new \php Timezone which is used since 3.1 - */ - public function convert_phpbb30_timezone($timezone, $dst) - { - $offset = $timezone + $dst; - - switch ($timezone) - { - case '-12': - return 'Etc/GMT+' . abs($offset); //'[UTC - 12] Baker Island Time' - case '-11': - return 'Etc/GMT+' . abs($offset); //'[UTC - 11] Niue Time, Samoa Standard Time' - case '-10': - return 'Etc/GMT+' . abs($offset); //'[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time' - case '-9.5': - return 'Pacific/Marquesas'; //'[UTC - 9:30] Marquesas Islands Time' - case '-9': - return 'Etc/GMT+' . abs($offset); //'[UTC - 9] Alaska Standard Time, Gambier Island Time' - case '-8': - return 'Etc/GMT+' . abs($offset); //'[UTC - 8] Pacific Standard Time' - case '-7': - return 'Etc/GMT+' . abs($offset); //'[UTC - 7] Mountain Standard Time' - case '-6': - return 'Etc/GMT+' . abs($offset); //'[UTC - 6] Central Standard Time' - case '-5': - return 'Etc/GMT+' . abs($offset); //'[UTC - 5] Eastern Standard Time' - case '-4.5': - return 'America/Caracas'; //'[UTC - 4:30] Venezuelan Standard Time' - case '-4': - return 'Etc/GMT+' . abs($offset); //'[UTC - 4] Atlantic Standard Time' - case '-3.5': - return 'America/St_Johns'; //'[UTC - 3:30] Newfoundland Standard Time' - case '-3': - return 'Etc/GMT+' . abs($offset); //'[UTC - 3] Amazon Standard Time, Central Greenland Time' - case '-2': - return 'Etc/GMT+' . abs($offset); //'[UTC - 2] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time' - case '-1': - return 'Etc/GMT+' . abs($offset); //'[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time' - case '0': - return (!$dst) ? 'UTC' : 'Etc/GMT-1'; //'[UTC] Western European Time, Greenwich Mean Time' - case '1': - return 'Etc/GMT-' . $offset; //'[UTC + 1] Central European Time, West African Time' - case '2': - return 'Etc/GMT-' . $offset; //'[UTC + 2] Eastern European Time, Central African Time' - case '3': - return 'Etc/GMT-' . $offset; //'[UTC + 3] Moscow Standard Time, Eastern African Time' - case '3.5': - return 'Asia/Tehran'; //'[UTC + 3:30] Iran Standard Time' - case '4': - return 'Etc/GMT-' . $offset; //'[UTC + 4] Gulf Standard Time, Samara Standard Time' - case '4.5': - return 'Asia/Kabul'; //'[UTC + 4:30] Afghanistan Time' - case '5': - return 'Etc/GMT-' . $offset; //'[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time' - case '5.5': - return 'Asia/Kolkata'; //'[UTC + 5:30] Indian Standard Time, Sri Lanka Time' - case '5.75': - return 'Asia/Kathmandu'; //'[UTC + 5:45] Nepal Time' - case '6': - return 'Etc/GMT-' . $offset; //'[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time' - case '6.5': - return 'Indian/Cocos'; //'[UTC + 6:30] Cocos Islands Time, Myanmar Time' - case '7': - return 'Etc/GMT-' . $offset; //'[UTC + 7] Indochina Time, Krasnoyarsk Standard Time' - case '8': - return 'Etc/GMT-' . $offset; //'[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time' - case '8.75': - return 'Australia/Eucla'; //'[UTC + 8:45] Southeastern Western Australia Standard Time' - case '9': - return 'Etc/GMT-' . $offset; //'[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time' - case '9.5': - return 'Australia/ACT'; //'[UTC + 9:30] Australian Central Standard Time' - case '10': - return 'Etc/GMT-' . $offset; //'[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time' - case '10.5': - return 'Australia/Lord_Howe'; //'[UTC + 10:30] Lord Howe Standard Time' - case '11': - return 'Etc/GMT-' . $offset; //'[UTC + 11] Solomon Island Time, Magadan Standard Time' - case '11.5': - return 'Pacific/Norfolk'; //'[UTC + 11:30] Norfolk Island Time' - case '12': - return 'Etc/GMT-12'; //'[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time' - case '12.75': - return 'Pacific/Chatham'; //'[UTC + 12:45] Chatham Islands Time' - case '13': - return 'Pacific/Tongatapu'; //'[UTC + 13] Tonga Time, Phoenix Islands Time' - case '14': - return 'Pacific/Kiritimati'; //'[UTC + 14] Line Island Time' - default: - return 'UTC'; - } - } -} diff --git a/phpBB/phpbb/db/migration/data/310/timezone_p2.php b/phpBB/phpbb/db/migration/data/310/timezone_p2.php deleted file mode 100644 index 0c174b0d56..0000000000 --- a/phpBB/phpbb/db/migration/data/310/timezone_p2.php +++ /dev/null @@ -1,45 +0,0 @@ -db_tools->sql_column_exists($this->table_prefix . 'users', 'user_dst'); - } - - static public function depends_on() - { - return array('\phpbb\db\migration\data0\timezone'); - } - - public function update_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'users' => array( - 'user_dst', - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'users' => array( - 'user_dst' => array('BOOL', 0), - ), - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php b/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php new file mode 100644 index 0000000000..360daed437 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php @@ -0,0 +1,59 @@ +db->sql_like_expression($this->db->any_char . 'LOCAL_URL' . $this->db->any_char); + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + if (!class_exists('acp_bbcodes')) + { + global $phpEx; + phpbb_require_updated('includes/acp/acp_bbcodes.' . $phpEx); + } + $bbcode_match = $row['bbcode_match']; + $bbcode_tpl = $row['bbcode_tpl']; + + $acp_bbcodes = new \acp_bbcodes(); + $sql_ary = $acp_bbcodes->build_regexp($bbcode_match, $bbcode_tpl); + + $sql = 'UPDATE ' . BBCODES_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE bbcode_id = ' . (int) $row['bbcode_id']; + $this->sql_query($sql); + } + $this->db->sql_freeresult($result); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php new file mode 100644 index 0000000000..2fe0addc06 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php @@ -0,0 +1,30 @@ +config['version'], '3.0.1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_1_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.1')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php new file mode 100644 index 0000000000..cdf824a9ff --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php @@ -0,0 +1,30 @@ +config['version'], '3.0.10', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_10_rc3'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.10')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php new file mode 100644 index 0000000000..ee05fcabaa --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php @@ -0,0 +1,32 @@ +config['version'], '3.0.10-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_9'); + } + + public function update_data() + { + return array( + array('config.add', array('email_max_chunk_size', 50)), + + array('config.update', array('version', '3.0.10-rc1')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php new file mode 100644 index 0000000000..f53a4b0d97 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php @@ -0,0 +1,30 @@ +config['version'], '3.0.10-rc2', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_10_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.10-rc2')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php new file mode 100644 index 0000000000..20456e0458 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php @@ -0,0 +1,30 @@ +config['version'], '3.0.10-rc3', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_10_rc2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.10-rc3')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php new file mode 100644 index 0000000000..5b842cba4b --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php @@ -0,0 +1,30 @@ +config['version'], '3.0.11', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_11_rc2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.11')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php new file mode 100644 index 0000000000..1d484a97ca --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php @@ -0,0 +1,97 @@ +config['version'], '3.0.11-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_10'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'cleanup_deactivated_styles'))), + array('custom', array(array(&$this, 'delete_orphan_private_messages'))), + + array('config.update', array('version', '3.0.11-rc1')), + ); + } + + public function cleanup_deactivated_styles() + { + // Updates users having current style a deactivated one + $sql = 'SELECT style_id + FROM ' . STYLES_TABLE . ' + WHERE style_active = 0'; + $result = $this->sql_query($sql); + + $deactivated_style_ids = array(); + while ($style_id = $this->db->sql_fetchfield('style_id', false, $result)) + { + $deactivated_style_ids[] = (int) $style_id; + } + $this->db->sql_freeresult($result); + + if (!empty($deactivated_style_ids)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_style = ' . (int) $this->config['default_style'] .' + WHERE ' . $this->db->sql_in_set('user_style', $deactivated_style_ids); + $this->sql_query($sql); + } + } + + public function delete_orphan_private_messages() + { + // Delete orphan private messages + $batch_size = 500; + + $sql_array = array( + 'SELECT' => 'p.msg_id', + 'FROM' => array( + PRIVMSGS_TABLE => 'p', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(PRIVMSGS_TO_TABLE => 't'), + 'ON' => 'p.msg_id = t.msg_id', + ), + ), + 'WHERE' => 't.user_id IS NULL', + ); + $sql = $this->db->sql_build_query('SELECT', $sql_array); + + $result = $this->db->sql_query_limit($sql, $batch_size); + + $delete_pms = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $delete_pms[] = (int) $row['msg_id']; + } + $this->db->sql_freeresult($result); + + if (!empty($delete_pms)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $this->db->sql_in_set('msg_id', $delete_pms); + $this->sql_query($sql); + + // Return false to have the Migrator call this function again + return false; + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php new file mode 100644 index 0000000000..b7e475a87b --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php @@ -0,0 +1,52 @@ +config['version'], '3.0.11-rc2', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_11_rc1'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_novalue' => array('BOOL', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_novalue', + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.11-rc2')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php new file mode 100644 index 0000000000..3f851967df --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php @@ -0,0 +1,125 @@ +config['version'], '3.0.12-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_11'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'update_module_auth'))), + array('custom', array(array(&$this, 'update_bots'))), + array('custom', array(array(&$this, 'disable_bots_from_receiving_pms'))), + + array('config.update', array('version', '3.0.12-rc1')), + ); + } + + public function disable_bots_from_receiving_pms() + { + // Disable receiving pms for bots + $sql = 'SELECT user_id + FROM ' . BOTS_TABLE; + $result = $this->db->sql_query($sql); + + $bot_user_ids = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $bot_user_ids[] = (int) $row['user_id']; + } + $this->db->sql_freeresult($result); + + if (!empty($bot_user_ids)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_allow_pm = 0 + WHERE ' . $this->db->sql_in_set('user_id', $bot_user_ids); + $this->sql_query($sql); + } + } + + public function update_module_auth() + { + $sql = 'UPDATE ' . MODULES_TABLE . ' + SET module_auth = \'acl_u_sig\' + WHERE module_class = \'ucp\' + AND module_basename = \'profile\' + AND module_mode = \'signature\''; + $this->sql_query($sql); + } + + public function update_bots() + { + // Update bots + if (!function_exists('user_delete')) + { + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + } + + $bots_updates = array( + // Bot Deletions + 'NG-Search [Bot]' => false, + 'Nutch/CVS [Bot]' => false, + 'OmniExplorer [Bot]' => false, + 'Seekport [Bot]' => false, + 'Synoo [Bot]' => false, + 'WiseNut [Bot]' => false, + + // Bot Updates + // Bot name to bot user agent map + 'Baidu [Spider]' => 'Baiduspider', + 'Exabot [Bot]' => 'Exabot', + 'Voyager [Bot]' => 'voyager/', + 'W3C [Validator]' => 'W3C_Validator', + ); + + foreach ($bots_updates as $bot_name => $bot_agent) + { + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_IGNORE . " + AND username_clean = '" . $this->db->sql_escape(utf8_clean_string($bot_name)) . "'"; + $result = $this->db->sql_query($sql); + $bot_user_id = (int) $this->db->sql_fetchfield('user_id'); + $this->db->sql_freeresult($result); + + if ($bot_user_id) + { + if ($bot_agent === false) + { + $sql = 'DELETE FROM ' . BOTS_TABLE . " + WHERE user_id = $bot_user_id"; + $this->sql_query($sql); + + user_delete('remove', $bot_user_id); + } + else + { + $sql = 'UPDATE ' . BOTS_TABLE . " + SET bot_agent = '" . $this->db->sql_escape($bot_agent) . "' + WHERE user_id = $bot_user_id"; + $this->sql_query($sql); + } + } + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php new file mode 100644 index 0000000000..0444de4ac2 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php @@ -0,0 +1,110 @@ +config['version'], '3.0.1-rc1', '>='); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'forums' => array( + 'display_subforum_list' => array('BOOL', 1), + ), + $this->table_prefix . 'sessions' => array( + 'session_forum_id' => array('UINT', 0), + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'groups' => array( + 'group_legend', + ), + ), + 'add_index' => array( + $this->table_prefix . 'sessions' => array( + 'session_forum_id' => array('session_forum_id'), + ), + $this->table_prefix . 'groups' => array( + 'group_legend_name' => array('group_legend', 'group_name'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array( + 'display_subforum_list', + ), + $this->table_prefix . 'sessions' => array( + 'session_forum_id', + ), + ), + 'add_index' => array( + $this->table_prefix . 'groups' => array( + 'group_legend' => array('group_legend'), + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'sessions' => array( + 'session_forum_id', + ), + $this->table_prefix . 'groups' => array( + 'group_legend_name', + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'fix_unset_last_view_time'))), + array('custom', array(array(&$this, 'reset_smiley_size'))), + + array('config.update', array('version', '3.0.1-rc1')), + ); + } + + public function fix_unset_last_view_time() + { + $sql = 'UPDATE ' . $this->table_prefix . "topics + SET topic_last_view_time = topic_last_post_time + WHERE topic_last_view_time = 0"; + $this->sql_query($sql); + } + + public function reset_smiley_size() + { + // Update smiley sizes + $smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif'); + + foreach ($smileys as $smiley) + { + if (file_exists($this->phpbb_root_path . 'images/smilies/' . $smiley)) + { + list($width, $height) = getimagesize($this->phpbb_root_path . 'images/smilies/' . $smiley); + + $sql = 'UPDATE ' . SMILIES_TABLE . ' + SET smiley_width = ' . $width . ', smiley_height = ' . $height . " + WHERE smiley_url = '" . $this->db->sql_escape($smiley) . "'"; + + $this->sql_query($sql); + } + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php new file mode 100644 index 0000000000..4f9278e2fa --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php @@ -0,0 +1,30 @@ +config['version'], '3.0.2', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_2_rc2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.2')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php new file mode 100644 index 0000000000..8f709fb769 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php @@ -0,0 +1,34 @@ +config['version'], '3.0.2-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_1'); + } + + public function update_data() + { + return array( + array('config.add', array('referer_validation', '1')), + array('config.add', array('check_attachment_content', '1')), + array('config.add', array('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title')), + + array('config.update', array('version', '3.0.2-rc1')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php new file mode 100644 index 0000000000..ecbe8bf808 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php @@ -0,0 +1,82 @@ +config['version'], '3.0.2-rc2', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_2_rc1'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'drafts' => array( + 'draft_subject' => array('STEXT_UNI', ''), + ), + $this->table_prefix . 'forums' => array( + 'forum_last_post_subject' => array('STEXT_UNI', ''), + ), + $this->table_prefix . 'posts' => array( + 'post_subject' => array('STEXT_UNI', '', 'true_sort'), + ), + $this->table_prefix . 'privmsgs' => array( + 'message_subject' => array('STEXT_UNI', ''), + ), + $this->table_prefix . 'topics' => array( + 'topic_title' => array('STEXT_UNI', '', 'true_sort'), + 'topic_last_post_subject' => array('STEXT_UNI', ''), + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'sessions' => array( + 'session_forum_id', + ), + ), + 'add_index' => array( + $this->table_prefix . 'sessions' => array( + 'session_fid' => array('session_forum_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_index' => array( + $this->table_prefix . 'sessions' => array( + 'session_forum_id' => array( + 'session_forum_id', + ), + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'sessions' => array( + 'session_fid', + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.2-rc2')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php new file mode 100644 index 0000000000..5f94bd9018 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php @@ -0,0 +1,30 @@ +config['version'], '3.0.3', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_3_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.3')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php new file mode 100644 index 0000000000..631d382135 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php @@ -0,0 +1,85 @@ +config['version'], '3.0.3-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_2'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'styles_template' => array( + 'template_inherits_id' => array('UINT:4', 0), + 'template_inherit_path' => array('VCHAR', ''), + ), + $this->table_prefix . 'groups' => array( + 'group_max_recipients' => array('UINT', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'styles_template' => array( + 'template_inherits_id', + 'template_inherit_path', + ), + $this->table_prefix . 'groups' => array( + 'group_max_recipients', + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.add', array('enable_queue_trigger', '0')), + array('config.add', array('queue_trigger_posts', '3')), + array('config.add', array('pm_max_recipients', '0')), + array('custom', array(array(&$this, 'set_group_default_max_recipients'))), + array('config.add', array('dbms_version', $this->db->sql_server_info(true))), + array('permission.add', array('u_masspm_group', true, 'u_masspm')), + array('custom', array(array(&$this, 'correct_acp_email_permissions'))), + + array('config.update', array('version', '3.0.3-rc1')), + ); + } + + public function correct_acp_email_permissions() + { + $sql = 'UPDATE ' . $this->table_prefix . 'modules + SET module_auth = \'acl_a_email && cfg_email_enable\' + WHERE module_class = \'acp\' + AND module_basename = \'email\''; + $this->sql_query($sql); + } + + public function set_group_default_max_recipients() + { + // Set maximum number of recipients for the registered users, bots, guests group + $sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_max_recipients = 5 + WHERE ' . $this->db->sql_in_set('group_name', array('GUESTS', 'REGISTERED', 'REGISTERED_COPPA', 'BOTS')); + $this->sql_query($sql); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php new file mode 100644 index 0000000000..369f23f7e7 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php @@ -0,0 +1,51 @@ +config['version'], '3.0.4', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_4_rc1'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'rename_log_delete_topic'))), + + array('config.update', array('version', '3.0.4')), + ); + } + + public function rename_log_delete_topic() + { + if ($this->db->sql_layer == 'oracle') + { + // log_operation is CLOB - but we can change this later + $sql = 'UPDATE ' . $this->table_prefix . "log + SET log_operation = 'LOG_DELETE_TOPIC' + WHERE log_operation LIKE 'LOG_TOPIC_DELETED'"; + $this->sql_query($sql); + } + else + { + $sql = 'UPDATE ' . $this->table_prefix . "log + SET log_operation = 'LOG_DELETE_TOPIC' + WHERE log_operation = 'LOG_TOPIC_DELETED'"; + $this->sql_query($sql); + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php new file mode 100644 index 0000000000..f98d7a59d0 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php @@ -0,0 +1,125 @@ +config['version'], '3.0.4-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_3'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_profile' => array('BOOL', 0), + ), + ), + 'change_columns' => array( + $this->table_prefix . 'styles' => array( + 'style_id' => array('UINT', NULL, 'auto_increment'), + 'template_id' => array('UINT', 0), + 'theme_id' => array('UINT', 0), + 'imageset_id' => array('UINT', 0), + ), + $this->table_prefix . 'styles_imageset' => array( + 'imageset_id' => array('UINT', NULL, 'auto_increment'), + ), + $this->table_prefix . 'styles_imageset_data' => array( + 'image_id' => array('UINT', NULL, 'auto_increment'), + 'imageset_id' => array('UINT', 0), + ), + $this->table_prefix . 'styles_theme' => array( + 'theme_id' => array('UINT', NULL, 'auto_increment'), + ), + $this->table_prefix . 'styles_template' => array( + 'template_id' => array('UINT', NULL, 'auto_increment'), + ), + $this->table_prefix . 'styles_template_data' => array( + 'template_id' => array('UINT', 0), + ), + $this->table_prefix . 'forums' => array( + 'forum_style' => array('UINT', 0), + ), + $this->table_prefix . 'users' => array( + 'user_style' => array('UINT', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_profile', + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'update_custom_profile_fields'))), + + array('config.update', array('version', '3.0.4-rc1')), + ); + } + + public function update_custom_profile_fields() + { + // Update the Custom Profile Fields based on previous settings to the new \format + $sql = 'SELECT field_id, field_required, field_show_on_reg, field_hide + FROM ' . PROFILE_FIELDS_TABLE; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $sql_ary = array( + 'field_required' => 0, + 'field_show_on_reg' => 0, + 'field_hide' => 0, + 'field_show_profile'=> 0, + ); + + if ($row['field_required']) + { + $sql_ary['field_required'] = $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1; + } + else if ($row['field_show_on_reg']) + { + $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1; + } + else if ($row['field_hide']) + { + // Only administrators and moderators can see this CPF, if the view is enabled, they can see it, otherwise just admins in the acp_users module + $sql_ary['field_hide'] = 1; + } + else + { + // equivelant to "none", which is the "Display in user control panel" option + $sql_ary['field_show_profile'] = 1; + } + + $this->sql_query('UPDATE ' . $this->table_prefix . 'profile_fields SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id'], $errored, $error_ary); + } + + $this->db->sql_freeresult($result); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php new file mode 100644 index 0000000000..9265f09b39 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php @@ -0,0 +1,30 @@ +config['version'], '3.0.5', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_5_rc1part2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.5')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php new file mode 100644 index 0000000000..b99313de5d --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php @@ -0,0 +1,126 @@ +config['version'], '3.0.5-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_4'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'forums' => array( + 'forum_style' => array('UINT', 0), + ), + ), + ); + } + + public function update_data() + { + $search_indexing_state = $this->config['search_indexing_state']; + + return array( + array('config.add', array('captcha_gd_wave', 0)), + array('config.add', array('captcha_gd_3d_noise', 1)), + array('config.add', array('captcha_gd_fonts', 1)), + array('config.add', array('confirm_refresh', 1)), + array('config.add', array('max_num_search_keywords', 10)), + array('config.remove', array('search_indexing_state')), + array('config.add', array('search_indexing_state', $search_indexing_state, true)), + array('custom', array(array(&$this, 'hash_old_passwords'))), + array('custom', array(array(&$this, 'update_ichiro_bot'))), + ); + } + + public function hash_old_passwords() + { + $sql = 'SELECT user_id, user_password + FROM ' . $this->table_prefix . 'users + WHERE user_pass_convert = 1'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + if (strlen($row['user_password']) == 32) + { + $sql_ary = array( + 'user_password' => phpbb_hash($row['user_password']), + ); + + $this->sql_query('UPDATE ' . $this->table_prefix . 'users SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $row['user_id']); + } + } + $this->db->sql_freeresult($result); + } + + public function update_ichiro_bot() + { + // Adjust bot entry + $sql = 'UPDATE ' . $this->table_prefix . "bots + SET bot_agent = 'ichiro/' + WHERE bot_agent = 'ichiro/2'"; + $this->sql_query($sql); + } + + public function remove_duplicate_auth_options() + { + // Before we are able to add a unique key to auth_option, we need to remove duplicate entries + $sql = 'SELECT auth_option + FROM ' . $this->table_prefix . 'acl_options + GROUP BY auth_option + HAVING COUNT(*) >= 2'; + $result = $this->db->sql_query($sql); + + $auth_options = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $auth_options[] = $row['auth_option']; + } + $this->db->sql_freeresult($result); + + // Remove specific auth options + if (!empty($auth_options)) + { + foreach ($auth_options as $option) + { + // Select auth_option_ids... the largest id will be preserved + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option = '" . $db->sql_escape($option) . "' + ORDER BY auth_option_id DESC"; + // sql_query_limit not possible here, due to bug in postgresql layer + $result = $this->db->sql_query($sql); + + // Skip first row, this is our original auth option we want to preserve + $row = $this->db->sql_fetchrow($result); + + while ($row = $this->db->sql_fetchrow($result)) + { + // Ok, remove this auth option... + $this->sql_query('DELETE FROM ' . ACL_OPTIONS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); + $this->sql_query('DELETE FROM ' . ACL_ROLES_DATA_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); + $this->sql_query('DELETE FROM ' . ACL_GROUPS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); + $this->sql_query('DELETE FROM ' . ACL_USERS_TABLE . ' WHERE auth_option_id = ' . $row['auth_option_id']); + } + $this->db->sql_freeresult($result); + } + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php new file mode 100644 index 0000000000..65787f9310 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php @@ -0,0 +1,44 @@ +config['version'], '3.0.5-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_5_rc1'); + } + + public function update_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'acl_options' => array('auth_option'), + ), + 'add_unique_index' => array( + $this->table_prefix . 'acl_options' => array( + 'auth_option' => array('auth_option'), + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.5-rc1')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php new file mode 100644 index 0000000000..382fb6cde2 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php @@ -0,0 +1,30 @@ +config['version'], '3.0.6', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_6_rc4'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.6')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php new file mode 100644 index 0000000000..0b54c3b195 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php @@ -0,0 +1,326 @@ +config['version'], '3.0.6-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_5'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'confirm' => array( + 'attempts' => array('UINT', 0), + ), + $this->table_prefix . 'users' => array( + 'user_new' => array('BOOL', 1), + 'user_reminded' => array('TINT:4', 0), + 'user_reminded_time' => array('TIMESTAMP', 0), + ), + $this->table_prefix . 'groups' => array( + 'group_skip_auth' => array('BOOL', 0, 'after' => 'group_founder_manage'), + ), + $this->table_prefix . 'privmsgs' => array( + 'message_reported' => array('BOOL', 0), + ), + $this->table_prefix . 'reports' => array( + 'pm_id' => array('UINT', 0), + ), + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_vt' => array('BOOL', 0), + ), + $this->table_prefix . 'forums' => array( + 'forum_options' => array('UINT:20', 0), + ), + ), + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_options' => array('UINT:11', 230271), + ), + ), + 'add_index' => array( + $this->table_prefix . 'reports' => array( + 'post_id' => array('post_id'), + 'pm_id' => array('pm_id'), + ), + $this->table_prefix . 'posts' => array( + 'post_username' => array('post_username:255'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'confirm' => array( + 'attempts', + ), + $this->table_prefix . 'users' => array( + 'user_new', + 'user_reminded', + 'user_reminded_time', + ), + $this->table_prefix . 'groups' => array( + 'group_skip_auth', + ), + $this->table_prefix . 'privmsgs' => array( + 'message_reported', + ), + $this->table_prefix . 'reports' => array( + 'pm_id', + ), + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_vt', + ), + $this->table_prefix . 'forums' => array( + 'forum_options', + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'reports' => array( + 'post_id', + 'pm_id', + ), + $this->table_prefix . 'posts' => array( + 'post_username', + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.add', array('captcha_plugin', 'phpbb_captcha_nogd')), + array('if', array( + ($this->config['captcha_gd']), + array('config.update', array('captcha_plugin', 'phpbb_captcha_gd')), + )), + + array('config.add', array('feed_enable', 0)), + array('config.add', array('feed_limit', 10)), + array('config.add', array('feed_overall_forums', 1)), + array('config.add', array('feed_overall_forums_limit', 15)), + array('config.add', array('feed_overall_topics', 0)), + array('config.add', array('feed_overall_topics_limit', 15)), + array('config.add', array('feed_forum', 1)), + array('config.add', array('feed_topic', 1)), + array('config.add', array('feed_item_statistics', 1)), + + array('config.add', array('smilies_per_page', 50)), + array('config.add', array('allow_pm_report', 1)), + array('config.add', array('min_post_chars', 1)), + array('config.add', array('allow_quick_reply', 1)), + array('config.add', array('new_member_post_limit', 0)), + array('config.add', array('new_member_group_default', 0)), + array('config.add', array('delete_time', $this->config['edit_time'])), + + array('config.add', array('allow_avatar', 0)), + array('if', array( + ($this->config['allow_avatar_upload'] || $this->config['allow_avatar_local'] || $this->config['allow_avatar_remote']), + array('config.update', array('allow_avatar', 1)), + )), + array('config.add', array('allow_avatar_remote_upload', 0)), + array('if', array( + ($this->config['allow_avatar_remote'] && $this->config['allow_avatar_upload']), + array('config.update', array('allow_avatar_remote_upload', 1)), + )), + + array('module.add', array( + 'acp', + 'ACP_BOARD_CONFIGURATION', + array( + 'module_basename' => 'acp_board', + 'modes' => array('feed'), + ), + )), + array('module.add', array( + 'acp', + 'ACP_CAT_USERS', + array( + 'module_basename' => 'acp_users', + 'modes' => array('warnings'), + ), + )), + array('module.add', array( + 'acp', + 'ACP_SERVER_CONFIGURATION', + array( + 'module_basename' => 'acp_send_statistics', + 'modes' => array('send_statistics'), + ), + )), + array('module.add', array( + 'acp', + 'ACP_FORUM_BASED_PERMISSIONS', + array( + 'module_basename' => 'acp_permissions', + 'modes' => array('setting_forum_copy'), + ), + )), + array('module.add', array( + 'mcp', + 'MCP_REPORTS', + array( + 'module_basename' => 'mcp_pm_reports', + 'modes' => array('pm_reports','pm_reports_closed','pm_report_details'), + ), + )), + array('custom', array(array(&$this, 'add_newly_registered_group'))), + array('custom', array(array(&$this, 'set_user_options_default'))), + + array('config.update', array('version', '3.0.6-rc1')), + ); + } + + public function set_user_options_default() + { + // 229376 is the added value to enable all three signature options + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = user_options + 229376'; + $this->sql_query($sql); + } + + public function add_newly_registered_group() + { + // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema) + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'NEWLY_REGISTERED'"; + $result = $this->db->sql_query($sql); + $group_id = (int) $this->db->sql_fetchfield('group_id'); + $this->db->sql_freeresult($result); + + if (!$group_id) + { + $sql = 'INSERT INTO ' . GROUPS_TABLE . " (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, '', '', '', 5)"; + $this->sql_query($sql); + + $group_id = $this->db->sql_nextid(); + } + + // Insert new \user role... at the end of the chain + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = 'ROLE_USER_NEW_MEMBER' + AND role_type = 'u_'"; + $result = $this->db->sql_query($sql); + $u_role = (int) $this->db->sql_fetchfield('role_id'); + $this->db->sql_freeresult($result); + + if (!$u_role) + { + $sql = 'SELECT MAX(role_order) as max_order_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = 'u_'"; + $result = $this->db->sql_query($sql); + $next_order_id = (int) $this->db->sql_fetchfield('max_order_id'); + $this->db->sql_freeresult($result); + + $next_order_id++; + + $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NEW_MEMBER', 'ROLE_DESCRIPTION_USER_NEW_MEMBER', 'u_', $next_order_id)"; + $this->sql_query($sql); + $u_role = $this->db->sql_nextid(); + + // Now add the correct data to the roles... + // The standard role says that new \users are not able to send a PM, Mass PM, are not able to PM groups + $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $u_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group')"; + $this->sql_query($sql); + + // Add user role to group + $sql = 'INSERT INTO ' . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES ($group_id, 0, 0, $u_role, 0)"; + $this->sql_query($sql); + } + + // Insert new \forum role + $sql = 'SELECT role_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_name = 'ROLE_FORUM_NEW_MEMBER' + AND role_type = 'f_'"; + $result = $this->db->sql_query($sql); + $f_role = (int) $this->db->sql_fetchfield('role_id'); + $this->db->sql_freeresult($result); + + if (!$f_role) + { + $sql = 'SELECT MAX(role_order) as max_order_id + FROM ' . ACL_ROLES_TABLE . " + WHERE role_type = 'f_'"; + $result = $this->db->sql_query($sql); + $next_order_id = (int) $this->db->sql_fetchfield('max_order_id'); + $this->db->sql_freeresult($result); + + $next_order_id++; + + $sql = 'INSERT INTO ' . ACL_ROLES_TABLE . " (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NEW_MEMBER', 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER', 'f_', $next_order_id)"; + $this->sql_query($sql); + $f_role = $this->db->sql_nextid(); + + $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $f_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove')"; + $this->sql_query($sql); + } + + // Set every members user_new \column to 0 (old users) only if there is no one yet (this makes sure we do not execute this more than once) + $sql = 'SELECT 1 + FROM ' . USERS_TABLE . ' + WHERE user_new = 0'; + $result = $this->db->sql_query_limit($sql, 1); + $row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$row) + { + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new = 0'; + $this->sql_query($sql); + } + + // To mimick the old "feature" we will assign the forum role to every forum, regardless of the setting (this makes sure there are no "this does not work!!!! YUO!!!" posts... + // Check if the role is already assigned... + $sql = 'SELECT forum_id + FROM ' . ACL_GROUPS_TABLE . ' + WHERE group_id = ' . $group_id . ' + AND auth_role_id = ' . $f_role; + $result = $this->db->sql_query($sql); + $is_options = (int) $this->db->sql_fetchfield('forum_id'); + $this->db->sql_freeresult($result); + + // Not assigned at all... :/ + if (!$is_options) + { + // Get postable forums + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_type != ' . FORUM_LINK; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $this->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (' . $group_id . ', ' . (int) $row['forum_id'] . ', 0, ' . $f_role . ', 0)'); + } + $this->db->sql_freeresult($result); + } + + // Clear permissions... + include_once($this->phpbb_root_path . 'includes/acp/auth.' . $this->php_ext); + $auth_admin = new \auth_admin(); + $auth_admin->acl_clear_prefetch(); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php new file mode 100644 index 0000000000..041224d19a --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php @@ -0,0 +1,30 @@ +config['version'], '3.0.6-rc2', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_6_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.6-rc2')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php new file mode 100644 index 0000000000..3183c16efd --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php @@ -0,0 +1,42 @@ +config['version'], '3.0.6-rc3', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_6_rc2'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'update_cp_fields'))), + + array('config.update', array('version', '3.0.6-rc3')), + ); + } + + public function update_cp_fields() + { + // Update the Custom Profile Fields based on previous settings to the new \format + $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . ' + SET field_show_on_vt = 1 + WHERE field_hide = 0 + AND (field_required = 1 OR field_show_on_reg = 1 OR field_show_profile = 1)'; + $this->sql_query($sql); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php new file mode 100644 index 0000000000..7d75b12130 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php @@ -0,0 +1,30 @@ +config['version'], '3.0.6-rc4', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_6_rc3'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.6-rc4')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php new file mode 100644 index 0000000000..1b1e5d0373 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php @@ -0,0 +1,30 @@ +config['version'], '3.0.7', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_7_rc2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.7')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php new file mode 100644 index 0000000000..a45c9c3c14 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php @@ -0,0 +1,30 @@ +config['version'], '3.0.7-pl1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_7'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.7-pl1')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php new file mode 100644 index 0000000000..dab90512ab --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php @@ -0,0 +1,78 @@ +config['version'], '3.0.7-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_6'); + } + + public function update_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'log' => array( + 'log_time', + ), + ), + 'add_index' => array( + $this->table_prefix . 'topics_track' => array( + 'topic_id' => array('topic_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_index' => array( + $this->table_prefix . 'log' => array( + 'log_time' => array('log_time'), + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'topics_track' => array( + 'topic_id', + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.add', array('feed_overall', 1)), + array('config.add', array('feed_http_auth', 0)), + array('config.add', array('feed_limit_post', $this->config['feed_limit'])), + array('config.add', array('feed_limit_topic', $this->config['feed_overall_topics_limit'])), + array('config.add', array('feed_topics_new', $this->config['feed_overall_topics'])), + array('config.add', array('feed_topics_active', $this->config['feed_overall_topics'])), + array('custom', array(array(&$this, 'delete_text_templates'))), + + array('config.update', array('version', '3.0.7-rc1')), + ); + } + + public function delete_text_templates() + { + // Delete all text-templates from the template_data + $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . ' + WHERE template_filename ' . $this->db->sql_like_expression($this->db->any_char . '.txt'); + $this->sql_query($sql); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php new file mode 100644 index 0000000000..ea430740c6 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php @@ -0,0 +1,75 @@ +config['version'], '3.0.7-rc2', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_7_rc1'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'update_email_hash'))), + + array('config.update', array('version', '3.0.7-rc2')), + ); + } + + public function update_email_hash($start = 0) + { + $limit = 1000; + + $sql = 'SELECT user_id, user_email, user_email_hash + FROM ' . USERS_TABLE . ' + WHERE user_type <> ' . USER_IGNORE . " + AND user_email <> ''"; + $result = $this->db->sql_query_limit($sql, $limit, $start); + + $i = 0; + while ($row = $this->db->sql_fetchrow($result)) + { + $i++; + + // Snapshot of the phpbb_email_hash() function + // We cannot call it directly because the auto updater updates the DB first. :/ + $user_email_hash = sprintf('%u', crc32(strtolower($row['user_email']))) . strlen($row['user_email']); + + if ($user_email_hash != $row['user_email_hash']) + { + $sql_ary = array( + 'user_email_hash' => $user_email_hash, + ); + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . (int) $row['user_id']; + $this->sql_query($sql); + } + } + $this->db->sql_freeresult($result); + + if ($i < $limit) + { + // Completed + return; + } + + // Return the next start, will be sent to $start when this function is called again + return $start + $limit; + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php new file mode 100644 index 0000000000..c08a74e5ee --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php @@ -0,0 +1,30 @@ +config['version'], '3.0.8', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_8_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.8')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php new file mode 100644 index 0000000000..dce88e249e --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php @@ -0,0 +1,223 @@ +config['version'], '3.0.8-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_7_pl1'); + } + + public function update_data() + { + return array( + array('custom', array(array(&$this, 'update_file_extension_group_names'))), + array('custom', array(array(&$this, 'update_module_auth'))), + array('custom', array(array(&$this, 'update_bots'))), + array('custom', array(array(&$this, 'delete_orphan_shadow_topics'))), + array('module.add', array( + 'acp', + 'ACP_MESSAGES', + array( + 'module_basename' => 'acp_board', + 'modes' => array('post'), + ), + )), + array('config.add', array('load_unreads_search', 1)), + array('config.update_if_equals', array(600, 'queue_interval', 60)), + array('config.update_if_equals', array(50, 'email_package_size', 20)), + + array('config.update', array('version', '3.0.8-rc1')), + ); + } + + public function update_file_extension_group_names() + { + // Update file extension group names to use language strings. + $sql = 'SELECT lang_dir + FROM ' . LANG_TABLE; + $result = $this->db->sql_query($sql); + + $extension_groups_updated = array(); + while ($lang_dir = $this->db->sql_fetchfield('lang_dir')) + { + $lang_dir = basename($lang_dir); + + // The language strings we need are either in language/.../acp/attachments.php + // in the update package if we're updating to 3.0.8-RC1 or later, + // or they are in language/.../install.php when we're updating from 3.0.7-PL1 or earlier. + // On an already updated board, they can also already be in language/.../acp/attachments.php + // in the board root. + $lang_files = array( + "{$this->phpbb_root_path}install/update/new/language/$lang_dir/acp/attachments.{$this->php_ext}", + "{$this->phpbb_root_path}language/$lang_dir/install.{$this->php_ext}", + "{$this->phpbb_root_path}language/$lang_dir/acp/attachments.{$this->php_ext}", + ); + + foreach ($lang_files as $lang_file) + { + if (!file_exists($lang_file)) + { + continue; + } + + $lang = array(); + include($lang_file); + + foreach($lang as $lang_key => $lang_val) + { + if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0) + { + continue; + } + + $sql_ary = array( + 'group_name' => substr($lang_key, 10), // Strip off 'EXT_GROUP_' + ); + + $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . " + WHERE group_name = '" . $this->db->sql_escape($lang_val) . "'"; + $this->sql_query($sql); + + $extension_groups_updated[$lang_key] = true; + } + } + } + $this->db->sql_freeresult($result); + } + + public function update_module_auth() + { + $sql = 'UPDATE ' . MODULES_TABLE . ' + SET module_auth = \'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)\' + WHERE module_class = \'ucp\' + AND module_basename = \'profile\' + AND module_mode = \'avatar\''; + $this->sql_query($sql); + } + + public function update_bots() + { + $bot_name = 'Bing [Bot]'; + $bot_name_clean = utf8_clean_string($bot_name); + + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . " + WHERE username_clean = '" . $this->db->sql_escape($bot_name_clean) . "'"; + $result = $this->db->sql_query($sql); + $bing_already_added = (bool) $this->db->sql_fetchfield('user_id'); + $this->db->sql_freeresult($result); + + if (!$bing_already_added) + { + $bot_agent = 'bingbot/'; + $bot_ip = ''; + $sql = 'SELECT group_id, group_colour + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'BOTS'"; + $result = $this->db->sql_query($sql); + $group_row = $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (!$group_row) + { + // default fallback, should never get here + $group_row['group_id'] = 6; + $group_row['group_colour'] = '9E8DA7'; + } + + if (!function_exists('user_add')) + { + include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); + } + + $user_row = array( + 'user_type' => USER_IGNORE, + 'group_id' => $group_row['group_id'], + 'username' => $bot_name, + 'user_regdate' => time(), + 'user_password' => '', + 'user_colour' => $group_row['group_colour'], + 'user_email' => '', + 'user_lang' => $this->config['default_lang'], + 'user_style' => $this->config['default_style'], + 'user_timezone' => 0, + 'user_dateformat' => $this->config['default_dateformat'], + 'user_allow_massemail' => 0, + ); + + $user_id = user_add($user_row); + + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $this->db->sql_build_array('INSERT', array( + 'bot_active' => 1, + 'bot_name' => (string) $bot_name, + 'user_id' => (int) $user_id, + 'bot_agent' => (string) $bot_agent, + 'bot_ip' => (string) $bot_ip, + )); + + $this->sql_query($sql); + } + } + + public function delete_orphan_shadow_topics() + { + // Delete shadow topics pointing to not existing topics + $batch_size = 500; + + // Set of affected forums we have to resync + $sync_forum_ids = array(); + + $sql_array = array( + 'SELECT' => 't1.topic_id, t1.forum_id', + 'FROM' => array( + TOPICS_TABLE => 't1', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(TOPICS_TABLE => 't2'), + 'ON' => 't1.topic_moved_id = t2.topic_id', + ), + ), + 'WHERE' => 't1.topic_moved_id <> 0 + AND t2.topic_id IS NULL', + ); + $sql = $this->db->sql_build_query('SELECT', $sql_array); + $result = $this->db->sql_query_limit($sql, $batch_size); + + $topic_ids = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $topic_ids[] = (int) $row['topic_id']; + + $sync_forum_ids[(int) $row['forum_id']] = (int) $row['forum_id']; + } + $this->db->sql_freeresult($result); + + if (!empty($topic_ids)) + { + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE ' . $this->db->sql_in_set('topic_id', $topic_ids); + $this->db->sql_query($sql); + + // Sync the forums we have deleted shadow topics from. + sync('forum', 'forum_id', $sync_forum_ids, true, true); + + return false; + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php new file mode 100644 index 0000000000..8254ac8561 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php @@ -0,0 +1,30 @@ +config['version'], '3.0.9', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_9_rc4'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.9')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php new file mode 100644 index 0000000000..14e0fe6013 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php @@ -0,0 +1,126 @@ +config['version'], '3.0.9-rc1', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_8'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'login_attempts' => array( + 'COLUMNS' => array( + // this column was removed from the database updater + // after 3.0.9-RC3 was released. It might still exist + // in 3.0.9-RCX installations and has to be dropped as + // soon as the db_tools class is capable of properly + // removing a primary key. + // 'attempt_id' => array('UINT', NULL, 'auto_increment'), + 'attempt_ip' => array('VCHAR:40', ''), + 'attempt_browser' => array('VCHAR:150', ''), + 'attempt_forwarded_for' => array('VCHAR:255', ''), + 'attempt_time' => array('TIMESTAMP', 0), + 'user_id' => array('UINT', 0), + 'username' => array('VCHAR_UNI:255', 0), + 'username_clean' => array('VCHAR_CI', 0), + ), + //'PRIMARY_KEY' => 'attempt_id', + 'KEYS' => array( + 'att_ip' => array('INDEX', array('attempt_ip', 'attempt_time')), + 'att_for' => array('INDEX', array('attempt_forwarded_for', 'attempt_time')), + 'att_time' => array('INDEX', array('attempt_time')), + 'user_id' => array('INDEX', 'user_id'), + ), + ), + ), + 'change_columns' => array( + $this->table_prefix . 'bbcodes' => array( + 'bbcode_id' => array('USINT', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'login_attempts', + ), + ); + } + + public function update_data() + { + return array( + array('config.add', array('ip_login_limit_max', 50)), + array('config.add', array('ip_login_limit_time', 21600)), + array('config.add', array('ip_login_limit_use_forwarded', 0)), + array('custom', array(array(&$this, 'update_file_extension_group_names'))), + array('custom', array(array(&$this, 'fix_firebird_qa_captcha'))), + + array('config.update', array('version', '3.0.9-rc1')), + ); + } + + public function update_file_extension_group_names() + { + // Update file extension group names to use language strings, again. + $sql = 'SELECT group_id, group_name + FROM ' . EXTENSION_GROUPS_TABLE . ' + WHERE group_name ' . $this->db->sql_like_expression('EXT_GROUP_' . $this->db->any_char); + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $sql_ary = array( + 'group_name' => substr($row['group_name'], 10), // Strip off 'EXT_GROUP_' + ); + + $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE group_id = ' . $row['group_id']; + $this->sql_query($sql); + } + $this->db->sql_freeresult($result); + } + + public function fix_firebird_qa_captcha() + { + // Recover from potentially broken Q&A CAPTCHA table on firebird + // Q&A CAPTCHA was uninstallable, so it's safe to remove these + // without data loss + if ($this->db_tools->sql_layer == 'firebird') + { + $tables = array( + $this->table_prefix . 'captcha_questions', + $this->table_prefix . 'captcha_answers', + $this->table_prefix . 'qa_confirm', + ); + foreach ($tables as $table) + { + if ($this->db_tools->sql_table_exists($table)) + { + $this->db_tools->sql_table_drop($table); + } + } + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php new file mode 100644 index 0000000000..44fd789353 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php @@ -0,0 +1,30 @@ +config['version'], '3.0.9-rc2', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_9_rc1'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.9-rc2')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php new file mode 100644 index 0000000000..e4102fb193 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php @@ -0,0 +1,30 @@ +config['version'], '3.0.9-rc3', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_9_rc2'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.9-rc3')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php new file mode 100644 index 0000000000..5896d11ba5 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php @@ -0,0 +1,30 @@ +config['version'], '3.0.9-rc4', '>='); + } + + static public function depends_on() + { + return array('phpbb_db_migration_data_30x_3_0_9_rc3'); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.0.9-rc4')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/avatars.php b/phpBB/phpbb/db/migration/data/v310/avatars.php new file mode 100644 index 0000000000..80ce606f29 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/avatars.php @@ -0,0 +1,69 @@ +config['allow_avatar_gravatar']); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_avatar_type' => array('VCHAR:255', ''), + ), + $this->table_prefix . 'groups' => array( + 'group_avatar_type' => array('VCHAR:255', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_avatar_type' => array('TINT:2', ''), + ), + $this->table_prefix . 'groups' => array( + 'group_avatar_type' => array('TINT:2', ''), + ), + ), + ); + } + + public function update_data() + { + return array( + array('config.add', array('allow_avatar_gravatar', 0)), + array('custom', array(array($this, 'update_module_auth'))), + ); + } + + public function update_module_auth() + { + $sql = 'UPDATE ' . $this->table_prefix . "modules + SET module_auth = 'cfg_allow_avatar' + WHERE module_class = 'ucp' + AND module_basename = 'ucp_profile' + AND module_mode = 'avatar'"; + $this->db->sql_query($sql); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/boardindex.php b/phpBB/phpbb/db/migration/data/v310/boardindex.php new file mode 100644 index 0000000000..27492f2d0d --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/boardindex.php @@ -0,0 +1,25 @@ +config['board_index_text']); + } + + public function update_data() + { + return array( + array('config.add', array('board_index_text', '')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/config_db_text.php b/phpBB/phpbb/db/migration/data/v310/config_db_text.php new file mode 100644 index 0000000000..1a7ee7a9a6 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/config_db_text.php @@ -0,0 +1,47 @@ +db_tools->sql_table_exists($this->table_prefix . 'config_text'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'config_text' => array( + 'COLUMNS' => array( + 'config_name' => array('VCHAR', ''), + 'config_value' => array('MTEXT', ''), + ), + 'PRIMARY_KEY' => 'config_name', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'config_text', + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/dev.php b/phpBB/phpbb/db/migration/data/v310/dev.php new file mode 100644 index 0000000000..5a10e7c236 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/dev.php @@ -0,0 +1,410 @@ +config['version'], '3.1.0-dev', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\extensions', + '\phpbb\db\migration\data\v310\style_update_p2', + '\phpbb\db\migration\data\v310\timezone_p2', + '\phpbb\db\migration\data\v310\reported_posts_display', + ); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'groups' => array( + 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'), + ), + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_pm' => array('BOOL', 0), + ), + $this->table_prefix . 'styles' => array( + 'style_path' => array('VCHAR:100', ''), + 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), + 'style_parent_id' => array('UINT:4', 0), + 'style_parent_tree' => array('TEXT', ''), + ), + $this->table_prefix . 'reports' => array( + 'reported_post_text' => array('MTEXT_UNI', ''), + 'reported_post_uid' => array('VCHAR:8', ''), + 'reported_post_bitfield' => array('VCHAR:255', ''), + ), + ), + 'change_columns' => array( + $this->table_prefix . 'groups' => array( + 'group_legend' => array('UINT', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'groups' => array( + 'group_teampage', + ), + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_pm', + ), + $this->table_prefix . 'styles' => array( + 'style_path', + 'bbcode_bitfield', + 'style_parent_id', + 'style_parent_tree', + ), + $this->table_prefix . 'reports' => array( + 'reported_post_text', + 'reported_post_uid', + 'reported_post_bitfield', + ), + ), + ); + } + + public function update_data() + { + return array( + array('if', array( + (strpos('phpbb_search_', $this->config['search_type']) !== 0), + array('config.update', array('search_type', 'phpbb_search_' . $this->config['search_type'])), + )), + + array('config.add', array('fulltext_postgres_ts_name', 'simple')), + array('config.add', array('fulltext_postgres_min_word_len', 4)), + array('config.add', array('fulltext_postgres_max_word_len', 254)), + array('config.add', array('fulltext_sphinx_stopwords', 0)), + array('config.add', array('fulltext_sphinx_indexer_mem_limit', 512)), + + array('config.add', array('load_jquery_cdn', 0)), + array('config.add', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js')), + + array('config.add', array('use_system_cron', 0)), + + array('config.add', array('legend_sort_groupname', 0)), + array('config.add', array('teampage_forums', 1)), + array('config.add', array('teampage_memberships', 1)), + + array('config.add', array('load_cpf_pm', 0)), + + array('config.add', array('display_last_subject', 1)), + + array('config.add', array('assets_version', 1)), + + array('config.add', array('site_home_url', '')), + array('config.add', array('site_home_text', '')), + + array('permission.add', array('u_chgprofileinfo', true, 'u_sig')), + + array('module.add', array( + 'acp', + 'ACP_GROUPS', + array( + 'module_basename' => 'acp_groups', + 'modes' => array('position'), + ), + )), + array('module.add', array( + 'acp', + 'ACP_ATTACHMENTS', + array( + 'module_basename' => 'acp_attachments', + 'modes' => array('manage'), + ), + )), + array('module.add', array( + 'acp', + 'ACP_STYLE_MANAGEMENT', + array( + 'module_basename' => 'acp_styles', + 'modes' => array('install', 'cache'), + ), + )), + array('module.add', array( + 'ucp', + 'UCP_PROFILE', + array( + 'module_basename' => 'ucp_profile', + 'modes' => array('autologin_keys'), + ), + )), + // Module will be renamed later + array('module.add', array( + 'acp', + 'ACP_CAT_STYLES', + 'ACP_LANGUAGE' + )), + + array('module.remove', array( + 'acp', + false, + 'ACP_TEMPLATES', + )), + array('module.remove', array( + 'acp', + false, + 'ACP_THEMES', + )), + array('module.remove', array( + 'acp', + false, + 'ACP_IMAGESETS', + )), + + array('custom', array(array($this, 'rename_module_basenames'))), + array('custom', array(array($this, 'rename_styles_module'))), + array('custom', array(array($this, 'add_group_teampage'))), + array('custom', array(array($this, 'update_group_legend'))), + array('custom', array(array($this, 'localise_global_announcements'))), + array('custom', array(array($this, 'update_ucp_pm_basename'))), + array('custom', array(array($this, 'update_ucp_profile_auth'))), + array('custom', array(array($this, 'move_customise_modules'))), + + array('config.update', array('version', '3.1.0-dev')), + ); + } + + public function move_customise_modules() + { + // Move language management to new \location in the Customise tab + // First get language module id + $sql = 'SELECT module_id FROM ' . MODULES_TABLE . " + WHERE module_basename = 'acp_language'"; + $result = $this->db->sql_query($sql); + $language_module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + // Next get language management module id of the one just created + $sql = 'SELECT module_id FROM ' . MODULES_TABLE . " + WHERE module_langname = 'ACP_LANGUAGE'"; + $result = $this->db->sql_query($sql); + $language_management_module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + if (!class_exists('acp_modules')) + { + include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); + } + // acp_modules calls adm_back_link, which is undefined at this point + if (!function_exists('adm_back_link')) + { + include($this->phpbb_root_path . 'includes/functions_acp.' . $this->php_ext); + } + $module_manager = new \acp_modules(); + $module_manager->module_class = 'acp'; + $module_manager->move_module($language_module_id, $language_management_module_id); + } + + public function update_ucp_pm_basename() + { + $sql = 'SELECT module_id, module_basename + FROM ' . MODULES_TABLE . " + WHERE module_basename <> 'ucp_pm' AND + module_langname='UCP_PM'"; + $result = $this->db->sql_query_limit($sql, 1); + + if ($row = $this->db->sql_fetchrow($result)) + { + // This update is still not applied. Applying it + + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_basename = 'ucp_pm' + WHERE module_id = " . (int) $row['module_id']; + + $this->sql_query($sql); + } + $this->db->sql_freeresult($result); + } + + public function update_ucp_profile_auth() + { + // Update the auth setting for the module + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_auth = 'acl_u_chgprofileinfo' + WHERE module_class = 'ucp' + AND module_basename = 'ucp_profile' + AND module_mode = 'profile_info'"; + $this->sql_query($sql); + } + + public function rename_styles_module() + { + // Rename styles module to Customise + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_langname = 'ACP_CAT_CUSTOMISE' + WHERE module_langname = 'ACP_CAT_STYLES'"; + $this->sql_query($sql); + } + + public function rename_module_basenames() + { + // rename all module basenames to full classname + $sql = 'SELECT module_id, module_basename, module_class + FROM ' . MODULES_TABLE; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $module_id = (int) $row['module_id']; + unset($row['module_id']); + + if (!empty($row['module_basename']) && !empty($row['module_class'])) + { + // all the class names start with class name or with phpbb_ for auto loading + if (strpos($row['module_basename'], $row['module_class'] . '_') !== 0 && + strpos($row['module_basename'], 'phpbb_') !== 0) + { + $row['module_basename'] = $row['module_class'] . '_' . $row['module_basename']; + + $sql_update = $this->db->sql_build_array('UPDATE', $row); + + $sql = 'UPDATE ' . MODULES_TABLE . ' + SET ' . $sql_update . ' + WHERE module_id = ' . $module_id; + $this->sql_query($sql); + } + } + } + + $this->db->sql_freeresult($result); + } + + public function add_group_teampage() + { + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_teampage = 1 + WHERE group_type = ' . GROUP_SPECIAL . " + AND group_name = 'ADMINISTRATORS'"; + $this->sql_query($sql); + + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_teampage = 2 + WHERE group_type = ' . GROUP_SPECIAL . " + AND group_name = 'GLOBAL_MODERATORS'"; + $this->sql_query($sql); + } + + public function update_group_legend() + { + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . ' + WHERE group_legend = 1 + ORDER BY group_name ASC'; + $result = $this->db->sql_query($sql); + + $next_legend = 1; + while ($row = $this->db->sql_fetchrow($result)) + { + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_legend = ' . $next_legend . ' + WHERE group_id = ' . (int) $row['group_id']; + $this->sql_query($sql); + + $next_legend++; + } + $this->db->sql_freeresult($result); + } + + public function localise_global_announcements() + { + // Localise Global Announcements + $sql = 'SELECT topic_id, topic_approved, (topic_replies + 1) AS topic_posts, topic_last_post_id, topic_last_post_subject, topic_last_post_time, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour + FROM ' . TOPICS_TABLE . ' + WHERE forum_id = 0 + AND topic_type = ' . POST_GLOBAL; + $result = $this->db->sql_query($sql); + + $global_announcements = $update_lastpost_data = array(); + $update_lastpost_data['forum_last_post_time'] = 0; + $update_forum_data = array( + 'forum_posts' => 0, + 'forum_topics' => 0, + 'forum_topics_real' => 0, + ); + + while ($row = $this->db->sql_fetchrow($result)) + { + $global_announcements[] = (int) $row['topic_id']; + + $update_forum_data['forum_posts'] += (int) $row['topic_posts']; + $update_forum_data['forum_topics_real']++; + if ($row['topic_approved']) + { + $update_forum_data['forum_topics']++; + } + + if ($update_lastpost_data['forum_last_post_time'] < $row['topic_last_post_time']) + { + $update_lastpost_data = array( + 'forum_last_post_id' => (int) $row['topic_last_post_id'], + 'forum_last_post_subject' => $row['topic_last_post_subject'], + 'forum_last_post_time' => (int) $row['topic_last_post_time'], + 'forum_last_poster_id' => (int) $row['topic_last_poster_id'], + 'forum_last_poster_name' => $row['topic_last_poster_name'], + 'forum_last_poster_colour' => $row['topic_last_poster_colour'], + ); + } + } + $this->db->sql_freeresult($result); + + if (!empty($global_announcements)) + { + // Update the post/topic-count for the forum and the last-post if needed + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_type = ' . FORUM_POST; + $result = $this->db->sql_query_limit($sql, 1); + $ga_forum_id = $this->db->sql_fetchfield('forum_id'); + $this->db->sql_freeresult($result); + + $sql = 'SELECT forum_last_post_time + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $ga_forum_id; + $result = $this->db->sql_query($sql); + $lastpost = (int) $this->db->sql_fetchfield('forum_last_post_time'); + $this->db->sql_freeresult($result); + + $sql_update = 'forum_posts = forum_posts + ' . $update_forum_data['forum_posts'] . ', '; + $sql_update .= 'forum_topics_real = forum_topics_real + ' . $update_forum_data['forum_topics_real'] . ', '; + $sql_update .= 'forum_topics = forum_topics + ' . $update_forum_data['forum_topics']; + if ($lastpost < $update_lastpost_data['forum_last_post_time']) + { + $sql_update .= ', ' . $this->db->sql_build_array('UPDATE', $update_lastpost_data); + } + + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET ' . $sql_update . ' + WHERE forum_id = ' . $ga_forum_id; + $this->sql_query($sql); + + // Update some forum_ids + $table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE); + foreach ($table_ary as $table) + { + $sql = "UPDATE $table + SET forum_id = $ga_forum_id + WHERE " . $this->db->sql_in_set('topic_id', $global_announcements); + $this->sql_query($sql); + } + unset($table_ary); + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/extensions.php b/phpBB/phpbb/db/migration/data/v310/extensions.php new file mode 100644 index 0000000000..d8b38dbc9e --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/extensions.php @@ -0,0 +1,71 @@ +db_tools->sql_table_exists($this->table_prefix . 'ext'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'ext' => array( + 'COLUMNS' => array( + 'ext_name' => array('VCHAR', ''), + 'ext_active' => array('BOOL', 0), + 'ext_state' => array('TEXT', ''), + ), + 'KEYS' => array( + 'ext_name' => array('UNIQUE', 'ext_name'), + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'ext', + ), + ); + } + + public function update_data() + { + return array( + // Module will be renamed later + array('module.add', array( + 'acp', + 'ACP_CAT_STYLES', + 'ACP_EXTENSION_MANAGEMENT' + )), + array('module.add', array( + 'acp', + 'ACP_EXTENSION_MANAGEMENT', + array( + 'module_basename' => 'acp_extensions', + 'modes' => array('main'), + ), + )), + array('permission.add', array('a_extensions', true, 'a_styles')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/forgot_password.php b/phpBB/phpbb/db/migration/data/v310/forgot_password.php new file mode 100644 index 0000000000..814093caa9 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/forgot_password.php @@ -0,0 +1,30 @@ +config['allow_password_reset']); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_data() + { + return array( + array('config.add', array('allow_password_reset', 1)), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/jquery_update.php b/phpBB/phpbb/db/migration/data/v310/jquery_update.php new file mode 100644 index 0000000000..bd2de2b4d4 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/jquery_update.php @@ -0,0 +1,33 @@ +config['load_jquery_url'] !== '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'; + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + ); + } + + public function update_data() + { + return array( + array('config.update', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js')), + ); + } + +} diff --git a/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php b/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php new file mode 100644 index 0000000000..bd7614e1c2 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/notification_options_reconvert.php @@ -0,0 +1,120 @@ +table_prefix . 'user_notifications'; + $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $insert_table); + + $this->perform_conversion($insert_buffer, $insert_table); + } + + /** + * Perform the conversion (separate for testability) + * + * @param \phpbb\db\sql_insert_buffer $insert_buffer + * @param string $insert_table + */ + public function perform_conversion(\phpbb\db\sql_insert_buffer $insert_buffer, $insert_table) + { + $sql = 'DELETE FROM ' . $insert_table; + $this->db->sql_query($sql); + + $sql = 'SELECT user_id, user_notify_type, user_notify_pm + FROM ' . USERS_TABLE; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $notification_methods = array(); + + // In-board notification + $notification_methods[] = ''; + + if ($row['user_notify_type'] == NOTIFY_EMAIL || $row['user_notify_type'] == NOTIFY_BOTH) + { + $notification_methods[] = 'email'; + } + + if ($row['user_notify_type'] == NOTIFY_IM || $row['user_notify_type'] == NOTIFY_BOTH) + { + $notification_methods[] = 'jabber'; + } + + // Notifications for posts + foreach (array('post', 'topic') as $item_type) + { + $this->add_method_rows( + $insert_buffer, + $item_type, + 0, + $row['user_id'], + $notification_methods + ); + } + + if ($row['user_notify_pm']) + { + // Notifications for private messages + // User either gets all methods or no method + $this->add_method_rows( + $insert_buffer, + 'pm', + 0, + $row['user_id'], + $notification_methods + ); + } + } + $this->db->sql_freeresult($result); + + $insert_buffer->flush(); + } + + /** + * Insert method rows to DB + * + * @param \phpbb\db\sql_insert_buffer $insert_buffer + * @param string $item_type + * @param int $item_id + * @param int $user_id + * @param string $methods + */ + protected function add_method_rows(\phpbb\db\sql_insert_buffer $insert_buffer, $item_type, $item_id, $user_id, array $methods) + { + $row_base = array( + 'item_type' => $item_type, + 'item_id' => (int) $item_id, + 'user_id' => (int) $user_id, + 'notify' => 1 + ); + + foreach ($methods as $method) + { + $row_base['method'] = $method; + $insert_buffer->insert($row_base); + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/notifications.php b/phpBB/phpbb/db/migration/data/v310/notifications.php new file mode 100644 index 0000000000..10f1392094 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/notifications.php @@ -0,0 +1,98 @@ +db_tools->sql_table_exists($this->table_prefix . 'notifications'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'notification_types' => array( + 'COLUMNS' => array( + 'notification_type' => array('VCHAR:255', ''), + 'notification_type_enabled' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'), + ), + $this->table_prefix . 'notifications' => array( + 'COLUMNS' => array( + 'notification_id' => array('UINT', NULL, 'auto_increment'), + 'item_type' => array('VCHAR:255', ''), + 'item_id' => array('UINT', 0), + 'item_parent_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'notification_read' => array('BOOL', 0), + 'notification_time' => array('TIMESTAMP', 1), + 'notification_data' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'notification_id', + 'KEYS' => array( + 'item_ident' => array('INDEX', array('item_type', 'item_id')), + 'user' => array('INDEX', array('user_id', 'notification_read')), + ), + ), + $this->table_prefix . 'user_notifications' => array( + 'COLUMNS' => array( + 'item_type' => array('VCHAR:255', ''), + 'item_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'method' => array('VCHAR:255', ''), + 'notify' => array('BOOL', 1), + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'notification_types', + $this->table_prefix . 'notifications', + $this->table_prefix . 'user_notifications', + ), + ); + } + + public function update_data() + { + return array( + array('module.add', array( + 'ucp', + 'UCP_MAIN', + array( + 'module_basename' => 'ucp_notifications', + 'modes' => array('notification_list'), + ), + )), + array('module.add', array( + 'ucp', + 'UCP_PREFS', + array( + 'module_basename' => 'ucp_notifications', + 'modes' => array('notification_options'), + ), + )), + array('config.add', array('load_notifications', 1)), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php b/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php new file mode 100644 index 0000000000..8ed626d8a6 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/notifications_schema_fix.php @@ -0,0 +1,94 @@ + array( + $this->table_prefix . 'notification_types', + $this->table_prefix . 'notifications', + ), + 'add_tables' => array( + $this->table_prefix . 'notification_types' => array( + 'COLUMNS' => array( + 'notification_type_id' => array('USINT', NULL, 'auto_increment'), + 'notification_type_name' => array('VCHAR:255', ''), + 'notification_type_enabled' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => array('notification_type_id'), + 'KEYS' => array( + 'type' => array('UNIQUE', array('notification_type_name')), + ), + ), + $this->table_prefix . 'notifications' => array( + 'COLUMNS' => array( + 'notification_id' => array('UINT:10', NULL, 'auto_increment'), + 'notification_type_id' => array('USINT', 0), + 'item_id' => array('UINT', 0), + 'item_parent_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'notification_read' => array('BOOL', 0), + 'notification_time' => array('TIMESTAMP', 1), + 'notification_data' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'notification_id', + 'KEYS' => array( + 'item_ident' => array('INDEX', array('notification_type_id', 'item_id')), + 'user' => array('INDEX', array('user_id', 'notification_read')), + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'notification_types', + $this->table_prefix . 'notifications', + ), + 'add_tables' => array( + $this->table_prefix . 'notification_types' => array( + 'COLUMNS' => array( + 'notification_type' => array('VCHAR:255', ''), + 'notification_type_enabled' => array('BOOL', 1), + ), + 'PRIMARY_KEY' => array('notification_type', 'notification_type_enabled'), + ), + $this->table_prefix . 'notifications' => array( + 'COLUMNS' => array( + 'notification_id' => array('UINT', NULL, 'auto_increment'), + 'item_type' => array('VCHAR:255', ''), + 'item_id' => array('UINT', 0), + 'item_parent_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + 'notification_read' => array('BOOL', 0), + 'notification_time' => array('TIMESTAMP', 1), + 'notification_data' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'notification_id', + 'KEYS' => array( + 'item_ident' => array('INDEX', array('item_type', 'item_id')), + 'user' => array('INDEX', array('user_id', 'notification_read')), + ), + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/reported_posts_display.php b/phpBB/phpbb/db/migration/data/v310/reported_posts_display.php new file mode 100644 index 0000000000..56b7a0916c --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/reported_posts_display.php @@ -0,0 +1,49 @@ +db_tools->sql_column_exists($this->table_prefix . 'reports', 'reported_post_enable_bbcode'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'reports' => array( + 'reported_post_enable_bbcode' => array('BOOL', 1), + 'reported_post_enable_smilies' => array('BOOL', 1), + 'reported_post_enable_magic_url' => array('BOOL', 1), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'reports' => array( + 'reported_post_enable_bbcode', + 'reported_post_enable_smilies', + 'reported_post_enable_magic_url', + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php b/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php new file mode 100644 index 0000000000..494125ea5c --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/signature_module_auth.php @@ -0,0 +1,53 @@ +db->sql_query($sql); + $module_auth = $this->db_sql_fetchfield('module_auth'); + $this->db->sql_freeresult($result); + + return $module_auth === 'acl_u_sig' || $module_auth === false; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v31x\dev'); + } + + public function update_data() + { + return array( + array('custom', array( + array($this, 'update_signature_module_auth'), + ), + ), + ); + } + + public function update_signature_module_auth() + { + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_auth = 'acl_u_sig' + WHERE module_class = 'ucp' + AND module_basename = 'ucp_profile' + AND module_mode = 'signature' + AND module_auth = ''"; + $this->db->sql_query($sql); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php new file mode 100644 index 0000000000..0418d5cc2b --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php @@ -0,0 +1,173 @@ +db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_visibility'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'forums' => array( + 'forum_posts_approved' => array('UINT', 0), + 'forum_posts_unapproved' => array('UINT', 0), + 'forum_posts_softdeleted' => array('UINT', 0), + 'forum_topics_approved' => array('UINT', 0), + 'forum_topics_unapproved' => array('UINT', 0), + 'forum_topics_softdeleted' => array('UINT', 0), + ), + $this->table_prefix . 'posts' => array( + 'post_visibility' => array('TINT:3', 0), + 'post_delete_time' => array('TIMESTAMP', 0), + 'post_delete_reason' => array('STEXT_UNI', ''), + 'post_delete_user' => array('UINT', 0), + ), + $this->table_prefix . 'topics' => array( + 'topic_visibility' => array('TINT:3', 0), + 'topic_delete_time' => array('TIMESTAMP', 0), + 'topic_delete_reason' => array('STEXT_UNI', ''), + 'topic_delete_user' => array('UINT', 0), + 'topic_posts_approved' => array('UINT', 0), + 'topic_posts_unapproved' => array('UINT', 0), + 'topic_posts_softdeleted' => array('UINT', 0), + ), + ), + 'add_index' => array( + $this->table_prefix . 'posts' => array( + 'post_visibility' => array('post_visibility'), + ), + $this->table_prefix . 'topics' => array( + 'topic_visibility' => array('topic_visibility'), + 'forum_vis_last' => array('forum_id', 'topic_visibility', 'topic_last_post_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array( + 'forum_posts_approved', + 'forum_posts_unapproved', + 'forum_posts_softdeleted', + 'forum_topics_approved', + 'forum_topics_unapproved', + 'forum_topics_softdeleted', + ), + $this->table_prefix . 'posts' => array( + 'post_visibility', + 'post_delete_time', + 'post_delete_reason', + 'post_delete_user', + ), + $this->table_prefix . 'topics' => array( + 'topic_visibility', + 'topic_delete_time', + 'topic_delete_reason', + 'topic_delete_user', + 'topic_posts_approved', + 'topic_posts_unapproved', + 'topic_posts_softdeleted', + ), + ), + 'drop_keys' => array( + $this->table_prefix . 'posts' => array('post_visibility'), + $this->table_prefix . 'topics' => array('topic_visibility', 'forum_vis_last'), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_post_visibility'))), + array('custom', array(array($this, 'update_topic_visibility'))), + array('custom', array(array($this, 'update_topic_forum_counts'))), + + array('permission.add', array('f_softdelete', false)), + array('permission.add', array('m_softdelete', false)), + ); + } + + public function update_post_visibility() + { + $sql = 'UPDATE ' . $this->table_prefix . 'posts + SET post_visibility = post_approved'; + $this->sql_query($sql); + } + + public function update_topic_visibility() + { + $sql = 'UPDATE ' . $this->table_prefix . 'topics + SET topic_visibility = topic_approved'; + $this->sql_query($sql); + } + + public function update_topic_forum_counts() + { + $sql = 'UPDATE ' . $this->table_prefix . 'topics + SET topic_posts_approved = topic_replies + 1, + topic_posts_unapproved = topic_replies_real - topic_replies + WHERE topic_visibility = ' . ITEM_APPROVED; + $this->sql_query($sql); + + $sql = 'UPDATE ' . $this->table_prefix . 'topics + SET topic_posts_approved = 0, + topic_posts_unapproved = (topic_replies_real - topic_replies) + 1 + WHERE topic_visibility = ' . ITEM_UNAPPROVED; + $this->sql_query($sql); + + $sql = 'SELECT forum_id, topic_visibility, COUNT(topic_id) AS sum_topics, SUM(topic_posts_approved) AS sum_posts_approved, SUM(topic_posts_unapproved) AS sum_posts_unapproved + FROM ' . $this->table_prefix . 'topics + GROUP BY forum_id, topic_visibility'; + $result = $this->db->sql_query($sql); + + $update_forums = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $forum_id = (int) $row['forum_id']; + if (!isset($update_forums[$forum_id])) + { + $update_forums[$forum_id] = array( + 'forum_posts_approved' => 0, + 'forum_posts_unapproved' => 0, + 'forum_topics_approved' => 0, + 'forum_topics_unapproved' => 0, + ); + } + + $update_forums[$forum_id]['forum_posts_approved'] += (int) $row['sum_posts_approved']; + $update_forums[$forum_id]['forum_posts_unapproved'] += (int) $row['sum_posts_unapproved']; + + $update_forums[$forum_id][(($row['topic_visibility'] == ITEM_APPROVED) ? 'forum_topics_approved' : 'forum_topics_unapproved')] += (int) $row['sum_topics']; + } + $this->db->sql_freeresult($result); + + foreach ($update_forums as $forum_id => $forum_data) + { + $sql = 'UPDATE ' . FORUMS_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $forum_data) . ' + WHERE forum_id = ' . $forum_id; + $this->sql_query($sql); + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php b/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php new file mode 100644 index 0000000000..0c32e474f4 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/softdelete_p2.php @@ -0,0 +1,70 @@ +db_tools->sql_column_exists($this->table_prefix . 'posts', 'post_approved'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + '\phpbb\db\migration\data\v310\softdelete_p1', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array('forum_posts', 'forum_topics', 'forum_topics_real'), + $this->table_prefix . 'posts' => array('post_approved'), + $this->table_prefix . 'topics' => array('topic_approved', 'topic_replies', 'topic_replies_real'), + ), + 'drop_keys' => array( + $this->table_prefix . 'posts' => array('post_approved'), + $this->table_prefix . 'topics' => array('forum_appr_last'), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'forums' => array( + 'forum_posts' => array('UINT', 0), + 'forum_topics' => array('UINT', 0), + 'forum_topics_real' => array('UINT', 0), + ), + $this->table_prefix . 'posts' => array( + 'post_approved' => array('BOOL', 1), + ), + $this->table_prefix . 'topics' => array( + 'topic_approved' => array('BOOL', 1), + 'topic_replies' => array('UINT', 0), + 'topic_replies_real' => array('UINT', 0), + ), + ), + 'add_index' => array( + $this->table_prefix . 'posts' => array( + 'post_approved' => array('post_approved'), + ), + $this->table_prefix . 'topics' => array( + 'forum_appr_last' => array('forum_id', 'topic_approved', 'topic_last_post_id'), + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php new file mode 100644 index 0000000000..26f1046287 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -0,0 +1,187 @@ +db_tools->sql_table_exists($this->table_prefix . 'styles_imageset'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'styles' => array( + 'style_path' => array('VCHAR:100', ''), + 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), + 'style_parent_id' => array('UINT', 0), + 'style_parent_tree' => array('TEXT', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'styles' => array( + 'style_path', + 'bbcode_bitfield', + 'style_parent_id', + 'style_parent_tree', + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'styles_update'))), + ); + } + + public function styles_update() + { + // Get list of valid 3.1 styles + $available_styles = array('prosilver'); + + $iterator = new \DirectoryIterator($this->phpbb_root_path . 'styles'); + $skip_dirs = array('.', '..', 'prosilver'); + foreach ($iterator as $fileinfo) + { + if ($fileinfo->isDir() && !in_array($fileinfo->getFilename(), $skip_dirs) && file_exists($fileinfo->getPathname() . '/style.cfg')) + { + $style_cfg = parse_cfg_file($fileinfo->getPathname() . '/style.cfg'); + if (isset($style_cfg['phpbb_version']) && version_compare($style_cfg['phpbb_version'], '3.1.0-dev', '>=')) + { + // 3.1 style + $available_styles[] = $fileinfo->getFilename(); + } + } + } + + // Get all installed styles + if ($this->db_tools->sql_table_exists($this->table_prefix . 'styles_imageset')) + { + $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_id, i.imageset_path + FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . 'styles_theme c, ' . $this->table_prefix . "styles_imageset i + WHERE t.template_id = s.template_id + AND c.theme_id = s.theme_id + AND i.imageset_id = s.imageset_id"; + } + else + { + $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_id + FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . "stles_theme c + WHERE t.template_id = s.template_id + AND c.theme_id = s.theme_id"; + } + $result = $this->db->sql_query($sql); + + $styles = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $styles[] = $row; + } + $this->db->sql_freeresult($result); + + // Decide which styles to keep, all others will be deleted + $valid_styles = array(); + foreach ($styles as $style_row) + { + if ( + // Delete styles with parent style (not supported yet) + $style_row['template_inherits_id'] == 0 && + // Check if components match + $style_row['template_path'] == $style_row['theme_path'] && (!isset($style_row['imageset_path']) || $style_row['template_path'] == $style_row['imageset_path']) && + // Check if components are valid + in_array($style_row['template_path'], $available_styles) + ) + { + // Valid style. Keep it + $sql_ary = array( + 'style_path' => $style_row['template_path'], + 'bbcode_bitfield' => $style_row['bbcode_bitfield'], + 'style_parent_id' => 0, + 'style_parent_tree' => '', + ); + $this->sql_query('UPDATE ' . STYLES_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE style_id = ' . $style_row['style_id']); + $valid_styles[] = (int) $style_row['style_id']; + } + } + + // Remove old entries from styles table + if (!sizeof($valid_styles)) + { + // No valid styles: remove everything and add prosilver + $this->sql_query('DELETE FROM ' . STYLES_TABLE, $errored, $error_ary); + + $sql_ary = array( + 'style_name' => 'prosilver', + 'style_copyright' => '© phpBB Group', + 'style_active' => 1, + 'style_path' => 'prosilver', + 'bbcode_bitfield' => 'lNg=', + 'style_parent_id' => 0, + 'style_parent_tree' => '', + + // Will be removed in the next step + 'imageset_id' => 0, + 'template_id' => 0, + 'theme_id' => 0, + ); + + $sql = 'INSERT INTO ' . STYLES_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); + $this->sql_query($sql); + + $sql = 'SELECT style_id + FROM ' . $table . " + WHERE style_name = 'prosilver'"; + $result = $this->sql_query($sql); + $default_style = $this->db->sql_fetchfield($result); + $this->db->sql_freeresult($result); + + set_config('default_style', $default_style); + + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0'; + $this->sql_query($sql); + } + else + { + // There are valid styles in styles table. Remove styles that are outdated + $this->sql_query('DELETE FROM ' . STYLES_TABLE . ' + WHERE ' . $this->db->sql_in_set('style_id', $valid_styles, true)); + + // Change default style + if (!in_array($this->config['default_style'], $valid_styles)) + { + $this->sql_query('UPDATE ' . CONFIG_TABLE . " + SET config_value = '" . $valid_styles[0] . "' + WHERE config_name = 'default_style'"); + } + + // Reset styles for users + $this->sql_query('UPDATE ' . USERS_TABLE . ' + SET user_style = 0 + WHERE ' . $this->db->sql_in_set('user_style', $valid_styles, true)); + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php new file mode 100644 index 0000000000..3f6477b7cb --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php @@ -0,0 +1,131 @@ +db_tools->sql_table_exists($this->table_prefix . 'styles_imageset'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data0\style_update_p1'); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'styles' => array( + 'imageset_id', + 'template_id', + 'theme_id', + ), + ), + + 'drop_tables' => array( + $this->table_prefix . 'styles_imageset', + $this->table_prefix . 'styles_imageset_data', + $this->table_prefix . 'styles_template', + $this->table_prefix . 'styles_template_data', + $this->table_prefix . 'styles_theme', + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'styles' => array( + 'imageset_id' => array('UINT', 0), + 'template_id' => array('UINT', 0), + 'theme_id' => array('UINT', 0), + ), + ), + + 'add_tables' => array( + $this->table_prefix . 'styles_imageset' => array( + 'COLUMNS' => array( + 'imageset_id' => array('UINT', NULL, 'auto_increment'), + 'imageset_name' => array('VCHAR_UNI:255', ''), + 'imageset_copyright' => array('VCHAR_UNI', ''), + 'imageset_path' => array('VCHAR:100', ''), + ), + 'PRIMARY_KEY' => 'imageset_id', + 'KEYS' => array( + 'imgset_nm' => array('UNIQUE', 'imageset_name'), + ), + ), + $this->table_prefix . 'styles_imageset_data' => array( + 'COLUMNS' => array( + 'image_id' => array('UINT', NULL, 'auto_increment'), + 'image_name' => array('VCHAR:200', ''), + 'image_filename' => array('VCHAR:200', ''), + 'image_lang' => array('VCHAR:30', ''), + 'image_height' => array('USINT', 0), + 'image_width' => array('USINT', 0), + 'imageset_id' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'image_id', + 'KEYS' => array( + 'i_d' => array('INDEX', 'imageset_id'), + ), + ), + $this->table_prefix . 'styles_template' => array( + 'COLUMNS' => array( + 'template_id' => array('UINT', NULL, 'auto_increment'), + 'template_name' => array('VCHAR_UNI:255', ''), + 'template_copyright' => array('VCHAR_UNI', ''), + 'template_path' => array('VCHAR:100', ''), + 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), + 'template_storedb' => array('BOOL', 0), + 'template_inherits_id' => array('UINT:4', 0), + 'template_inherit_path' => array('VCHAR', ''), + ), + 'PRIMARY_KEY' => 'template_id', + 'KEYS' => array( + 'tmplte_nm' => array('UNIQUE', 'template_name'), + ), + ), + $this->table_prefix . 'styles_template_data' => array( + 'COLUMNS' => array( + 'template_id' => array('UINT', 0), + 'template_filename' => array('VCHAR:100', ''), + 'template_included' => array('TEXT', ''), + 'template_mtime' => array('TIMESTAMP', 0), + 'template_data' => array('MTEXT_UNI', ''), + ), + 'KEYS' => array( + 'tid' => array('INDEX', 'template_id'), + 'tfn' => array('INDEX', 'template_filename'), + ), + ), + $this->table_prefix . 'styles_theme' => array( + 'COLUMNS' => array( + 'theme_id' => array('UINT', NULL, 'auto_increment'), + 'theme_name' => array('VCHAR_UNI:255', ''), + 'theme_copyright' => array('VCHAR_UNI', ''), + 'theme_path' => array('VCHAR:100', ''), + 'theme_storedb' => array('BOOL', 0), + 'theme_mtime' => array('TIMESTAMP', 0), + 'theme_data' => array('MTEXT_UNI', ''), + ), + 'PRIMARY_KEY' => 'theme_id', + 'KEYS' => array( + 'theme_name' => array('UNIQUE', 'theme_name'), + ), + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/teampage.php b/phpBB/phpbb/db/migration/data/v310/teampage.php new file mode 100644 index 0000000000..80cc4be1c0 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/teampage.php @@ -0,0 +1,106 @@ +db_tools->sql_table_exists($this->table_prefix . 'teampage'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'teampage' => array( + 'COLUMNS' => array( + 'teampage_id' => array('UINT', NULL, 'auto_increment'), + 'group_id' => array('UINT', 0), + 'teampage_name' => array('VCHAR_UNI:255', ''), + 'teampage_position' => array('UINT', 0), + 'teampage_parent' => array('UINT', 0), + ), + 'PRIMARY_KEY' => 'teampage_id', + ), + ), + 'drop_columns' => array( + $this->table_prefix . 'groups' => array( + 'group_teampage', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'teampage', + ), + 'add_columns' => array( + $this->table_prefix . 'groups' => array( + 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'), + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'add_groups_teampage'))), + ); + } + + public function add_groups_teampage() + { + $sql = 'SELECT teampage_id + FROM ' . TEAMPAGE_TABLE; + $result = $this->db->sql_query_limit($sql, 1); + $added_groups_teampage = (bool) $this->db->sql_fetchfield('teampage_id'); + $this->db->sql_freeresult($result); + + if (!$added_groups_teampage) + { + $sql = 'SELECT * + FROM ' . GROUPS_TABLE . ' + WHERE group_type = ' . GROUP_SPECIAL . " + AND (group_name = 'ADMINISTRATORS' + OR group_name = 'GLOBAL_MODERATORS') + ORDER BY group_name ASC"; + $result = $this->db->sql_query($sql); + + $teampage_entries = array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $teampage_entries[] = array( + 'group_id' => (int) $row['group_id'], + 'teampage_name' => '', + 'teampage_position' => sizeof($teampage_entries) + 1, + 'teampage_parent' => 0, + ); + } + $this->db->sql_freeresult($result); + + if (sizeof($teampage_entries)) + { + $this->db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_entries); + } + unset($teampage_entries); + } + + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/timezone.php b/phpBB/phpbb/db/migration/data/v310/timezone.php new file mode 100644 index 0000000000..93c58819ce --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/timezone.php @@ -0,0 +1,165 @@ +db_tools->sql_column_exists($this->table_prefix . 'users', 'user_dst'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'users' => array( + 'user_timezone' => array('VCHAR:100', ''), + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_timezones'))), + ); + } + + public function update_timezones() + { + // Update user timezones + $sql = 'SELECT user_dst, user_timezone + FROM ' . $this->table_prefix . 'users + GROUP BY user_timezone, user_dst'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $sql = 'UPDATE ' . $this->table_prefix . "users + SET user_timezone = '" . $this->db->sql_escape($this->convert_phpbb30_timezone($row['user_timezone'], $row['user_dst'])) . "' + WHERE user_timezone = '" . $this->db->sql_escape($row['user_timezone']) . "' + AND user_dst = " . (int) $row['user_dst']; + $this->sql_query($sql); + } + $this->db->sql_freeresult($result); + + // Update board default timezone + $sql = 'UPDATE ' . $this->table_prefix . "config + SET config_value = '" . $this->convert_phpbb30_timezone($this->config['board_timezone'], $this->config['board_dst']) . "' + WHERE config_name = 'board_timezone'"; + $this->sql_query($sql); + } + + /** + * Determine the new \timezone for a given phpBB 3.0 timezone and + * "Daylight Saving Time" option + * + * @param $timezone float Users timezone in 3.0 + * @param $dst int Users daylight saving time + * @return string Users new \php Timezone which is used since 3.1 + */ + public function convert_phpbb30_timezone($timezone, $dst) + { + $offset = $timezone + $dst; + + switch ($timezone) + { + case '-12': + return 'Etc/GMT+' . abs($offset); //'[UTC - 12] Baker Island Time' + case '-11': + return 'Etc/GMT+' . abs($offset); //'[UTC - 11] Niue Time, Samoa Standard Time' + case '-10': + return 'Etc/GMT+' . abs($offset); //'[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time' + case '-9.5': + return 'Pacific/Marquesas'; //'[UTC - 9:30] Marquesas Islands Time' + case '-9': + return 'Etc/GMT+' . abs($offset); //'[UTC - 9] Alaska Standard Time, Gambier Island Time' + case '-8': + return 'Etc/GMT+' . abs($offset); //'[UTC - 8] Pacific Standard Time' + case '-7': + return 'Etc/GMT+' . abs($offset); //'[UTC - 7] Mountain Standard Time' + case '-6': + return 'Etc/GMT+' . abs($offset); //'[UTC - 6] Central Standard Time' + case '-5': + return 'Etc/GMT+' . abs($offset); //'[UTC - 5] Eastern Standard Time' + case '-4.5': + return 'America/Caracas'; //'[UTC - 4:30] Venezuelan Standard Time' + case '-4': + return 'Etc/GMT+' . abs($offset); //'[UTC - 4] Atlantic Standard Time' + case '-3.5': + return 'America/St_Johns'; //'[UTC - 3:30] Newfoundland Standard Time' + case '-3': + return 'Etc/GMT+' . abs($offset); //'[UTC - 3] Amazon Standard Time, Central Greenland Time' + case '-2': + return 'Etc/GMT+' . abs($offset); //'[UTC - 2] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time' + case '-1': + return 'Etc/GMT+' . abs($offset); //'[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time' + case '0': + return (!$dst) ? 'UTC' : 'Etc/GMT-1'; //'[UTC] Western European Time, Greenwich Mean Time' + case '1': + return 'Etc/GMT-' . $offset; //'[UTC + 1] Central European Time, West African Time' + case '2': + return 'Etc/GMT-' . $offset; //'[UTC + 2] Eastern European Time, Central African Time' + case '3': + return 'Etc/GMT-' . $offset; //'[UTC + 3] Moscow Standard Time, Eastern African Time' + case '3.5': + return 'Asia/Tehran'; //'[UTC + 3:30] Iran Standard Time' + case '4': + return 'Etc/GMT-' . $offset; //'[UTC + 4] Gulf Standard Time, Samara Standard Time' + case '4.5': + return 'Asia/Kabul'; //'[UTC + 4:30] Afghanistan Time' + case '5': + return 'Etc/GMT-' . $offset; //'[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time' + case '5.5': + return 'Asia/Kolkata'; //'[UTC + 5:30] Indian Standard Time, Sri Lanka Time' + case '5.75': + return 'Asia/Kathmandu'; //'[UTC + 5:45] Nepal Time' + case '6': + return 'Etc/GMT-' . $offset; //'[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time' + case '6.5': + return 'Indian/Cocos'; //'[UTC + 6:30] Cocos Islands Time, Myanmar Time' + case '7': + return 'Etc/GMT-' . $offset; //'[UTC + 7] Indochina Time, Krasnoyarsk Standard Time' + case '8': + return 'Etc/GMT-' . $offset; //'[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time' + case '8.75': + return 'Australia/Eucla'; //'[UTC + 8:45] Southeastern Western Australia Standard Time' + case '9': + return 'Etc/GMT-' . $offset; //'[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time' + case '9.5': + return 'Australia/ACT'; //'[UTC + 9:30] Australian Central Standard Time' + case '10': + return 'Etc/GMT-' . $offset; //'[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time' + case '10.5': + return 'Australia/Lord_Howe'; //'[UTC + 10:30] Lord Howe Standard Time' + case '11': + return 'Etc/GMT-' . $offset; //'[UTC + 11] Solomon Island Time, Magadan Standard Time' + case '11.5': + return 'Pacific/Norfolk'; //'[UTC + 11:30] Norfolk Island Time' + case '12': + return 'Etc/GMT-12'; //'[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time' + case '12.75': + return 'Pacific/Chatham'; //'[UTC + 12:45] Chatham Islands Time' + case '13': + return 'Pacific/Tongatapu'; //'[UTC + 13] Tonga Time, Phoenix Islands Time' + case '14': + return 'Pacific/Kiritimati'; //'[UTC + 14] Line Island Time' + default: + return 'UTC'; + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/timezone_p2.php b/phpBB/phpbb/db/migration/data/v310/timezone_p2.php new file mode 100644 index 0000000000..1066ab8571 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/timezone_p2.php @@ -0,0 +1,45 @@ +db_tools->sql_column_exists($this->table_prefix . 'users', 'user_dst'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\timezone'); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_dst', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_dst' => array('BOOL', 0), + ), + ), + ); + } +} -- cgit v1.2.1 From ee735685ac98d9b1ebb11cfcce6958a5266f3e39 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 14:37:32 +0200 Subject: [ticket/11700] Fix number class names in 3.0.x migrations PHPBB3-11700 --- phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php | 4 ++-- phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php | 4 ++-- phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php | 6 +++--- phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php | 6 +++--- 37 files changed, 109 insertions(+), 109 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php b/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php index 360daed437..5e6ba90336 100644 --- a/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php +++ b/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php @@ -7,13 +7,13 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; class local_url_bbcode extends \phpbb\db\migration\migration { static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_12_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_12_rc1'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php index 2fe0addc06..26f90a18f3 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_1 extends \phpbb\db\migration\migration +class release_3_0_1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_1_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_1_rc1'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php index cdf824a9ff..5da406e115 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_10 extends \phpbb\db\migration\migration +class release_3_0_10 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_10 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_10_rc3'); + return array('\phpbb\db\migration\data\v30x\release_3_0_10_rc3'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php index ee05fcabaa..4cde65dd72 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_10_rc1 extends \phpbb\db\migration\migration +class release_3_0_10_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_10_rc1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_9'); + return array('\phpbb\db\migration\data\v30x\release_3_0_9'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php index f53a4b0d97..a729f45ed1 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc2.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_10_rc2 extends \phpbb\db\migration\migration +class release_3_0_10_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_10_rc2 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_10_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_10_rc1'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php index 20456e0458..4c47868c19 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_10_rc3.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_10_rc3 extends \phpbb\db\migration\migration +class release_3_0_10_rc3 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_10_rc3 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_10_rc2'); + return array('\phpbb\db\migration\data\v30x\release_3_0_10_rc2'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php index 5b842cba4b..f65fe178c0 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_11 extends \phpbb\db\migration\migration +class release_3_0_11 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_11 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_11_rc2'); + return array('\phpbb\db\migration\data\v30x\release_3_0_11_rc2'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php index 1d484a97ca..860a65052f 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_11_rc1 extends \phpbb\db\migration\migration +class release_3_0_11_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_11_rc1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_10'); + return array('\phpbb\db\migration\data\v30x\release_3_0_10'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php index b7e475a87b..62e267ac01 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_11_rc2.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_11_rc2 extends \phpbb\db\migration\migration +class release_3_0_11_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_11_rc2 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_11_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_11_rc1'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php index 3f851967df..69db096cb0 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php @@ -7,11 +7,11 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 **/ -class 3_0_12_rc1 extends \phpbb\db\migration\migration +class release_3_0_12_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -20,7 +20,7 @@ class 3_0_12_rc1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_11'); + return array('\phpbb\db\migration\data\v30x\release_3_0_11'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php index 0444de4ac2..990b82141e 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_1_rc1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_1_rc1 extends \phpbb\db\migration\migration +class release_3_0_1_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php index 4f9278e2fa..abb41f38cf 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_2 extends \phpbb\db\migration\migration +class release_3_0_2 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_2 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_2_rc2'); + return array('\phpbb\db\migration\data\v30x\release_3_0_2_rc2'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php index 8f709fb769..8661531dd9 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_2_rc1 extends \phpbb\db\migration\migration +class release_3_0_2_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_2_rc1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_1'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php index ecbe8bf808..55055ca0a2 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_2_rc2.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_2_rc2 extends \phpbb\db\migration\migration +class release_3_0_2_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_2_rc2 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_2_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_2_rc1'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php index 5f94bd9018..49e37e9386 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_3 extends \phpbb\db\migration\migration +class release_3_0_3 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_3 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_3_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_3_rc1'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php index 631d382135..4b87933b11 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_3_rc1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_3_rc1 extends \phpbb\db\migration\migration +class release_3_0_3_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_3_rc1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_2'); + return array('\phpbb\db\migration\data\v30x\release_3_0_2'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php index 369f23f7e7..f15f806cee 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_4 extends \phpbb\db\migration\migration +class release_3_0_4 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_4 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_4_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_4_rc1'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php index f98d7a59d0..752dfd2576 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_4_rc1 extends \phpbb\db\migration\migration +class release_3_0_4_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_4_rc1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_3'); + return array('\phpbb\db\migration\data\v30x\release_3_0_3'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php index 9265f09b39..f2d458e9c5 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_5 extends \phpbb\db\migration\migration +class release_3_0_5 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_5 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_5_rc1part2'); + return array('\phpbb\db\migration\data\v30x\release_3_0_5_rc1part2'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php index b99313de5d..81bd3db975 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_5_rc1 extends \phpbb\db\migration\migration +class release_3_0_5_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_5_rc1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_4'); + return array('\phpbb\db\migration\data\v30x\release_3_0_4'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php index 65787f9310..1c04d814fd 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1part2.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_5_rc1part2 extends \phpbb\db\migration\migration +class release_3_0_5_rc1part2 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_5_rc1part2 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_5_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_5_rc1'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php index 382fb6cde2..24b7dc51a5 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_6 extends \phpbb\db\migration\migration +class release_3_0_6 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_6 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_6_rc4'); + return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc4'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php index 0b54c3b195..d78a0b7eed 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_6_rc1 extends \phpbb\db\migration\migration +class release_3_0_6_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_6_rc1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_5'); + return array('\phpbb\db\migration\data\v30x\release_3_0_5'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php index 041224d19a..d5dbf2e2a9 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc2.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_6_rc2 extends \phpbb\db\migration\migration +class release_3_0_6_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_6_rc2 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_6_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc1'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php index 3183c16efd..40fd076ff1 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc3.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_6_rc3 extends \phpbb\db\migration\migration +class release_3_0_6_rc3 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_6_rc3 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_6_rc2'); + return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc2'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php index 7d75b12130..93b01c888f 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc4.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_6_rc4 extends \phpbb\db\migration\migration +class release_3_0_6_rc4 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_6_rc4 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_6_rc3'); + return array('\phpbb\db\migration\data\v30x\release_3_0_6_rc3'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php index 1b1e5d0373..e19cbb04fa 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_7 extends \phpbb\db\migration\migration +class release_3_0_7 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_7 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_7_rc2'); + return array('\phpbb\db\migration\data\v30x\release_3_0_7_rc2'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php index a45c9c3c14..0fad5f5ff5 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_pl1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_7_pl1 extends \phpbb\db\migration\migration +class release_3_0_7_pl1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_7_pl1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_7'); + return array('\phpbb\db\migration\data\v30x\release_3_0_7'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php index dab90512ab..17f97c7043 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_7_rc1 extends \phpbb\db\migration\migration +class release_3_0_7_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_7_rc1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_6'); + return array('\phpbb\db\migration\data\v30x\release_3_0_6'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php index ea430740c6..0437e7aa7c 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc2.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_7_rc2 extends \phpbb\db\migration\migration +class release_3_0_7_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_7_rc2 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_7_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_7_rc1'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php index c08a74e5ee..ccd1b94bef 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_8 extends \phpbb\db\migration\migration +class release_3_0_8 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_8 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_8_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_8_rc1'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php index dce88e249e..be32ec0384 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_8_rc1 extends \phpbb\db\migration\migration +class release_3_0_8_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_8_rc1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_7_pl1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_7_pl1'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php index 8254ac8561..1783ee8a34 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_9 extends \phpbb\db\migration\migration +class release_3_0_9 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_9 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_9_rc4'); + return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc4'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php index 14e0fe6013..12a8c341d0 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_9_rc1 extends \phpbb\db\migration\migration +class release_3_0_9_rc1 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_9_rc1 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_8'); + return array('\phpbb\db\migration\data\v30x\release_3_0_8'); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php index 44fd789353..f6e05361b3 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc2.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_9_rc2 extends \phpbb\db\migration\migration +class release_3_0_9_rc2 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_9_rc2 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_9_rc1'); + return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc1'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php index e4102fb193..29b53e56c9 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc3.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_9_rc3 extends \phpbb\db\migration\migration +class release_3_0_9_rc3 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_9_rc3 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_9_rc2'); + return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc2'); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php index 5896d11ba5..4921330fdd 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc4.php @@ -7,9 +7,9 @@ * */ -namespace phpbb\db\migration\datax; +namespace phpbb\db\migration\data\v30x; -class 3_0_9_rc4 extends \phpbb\db\migration\migration +class release_3_0_9_rc4 extends \phpbb\db\migration\migration { public function effectively_installed() { @@ -18,7 +18,7 @@ class 3_0_9_rc4 extends \phpbb\db\migration\migration static public function depends_on() { - return array('phpbb_db_migration_data_30x_3_0_9_rc3'); + return array('\phpbb\db\migration\data\v30x\release_3_0_9_rc3'); } public function update_data() -- cgit v1.2.1 From d297eb4aecc6e658987c9647d76fed4210ef77f5 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 17:13:29 +0200 Subject: [ticket/11700] Get the installer to run with namespaces PHPBB3-11700 --- phpBB/phpbb/db/migration/data/v310/style_update_p2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php index 3f6477b7cb..6c3b0de2a1 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php @@ -7,7 +7,7 @@ * */ -namespace phpbb\db\migration\data0; +namespace phpbb\db\migration\data\v310; class style_update_p2 extends \phpbb\db\migration\migration { -- cgit v1.2.1 From 09cfa01d589ead86cf811e27b52167539e0478ec Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 16 Sep 2013 03:14:39 +0200 Subject: [ticket/11700] Fix installation after develop merge PHPBB3-11700 --- .../db/migration/data/310/auth_provider_oauth.php | 71 --------------------- phpBB/phpbb/db/migration/data/310/mod_rewrite.php | 25 -------- .../db/migration/data/310/notifications_cron.php | 25 -------- .../migration/data/310/softdelete_mcp_modules.php | 55 ---------------- .../db/migration/data/v310/auth_provider_oauth.php | 73 ++++++++++++++++++++++ phpBB/phpbb/db/migration/data/v310/mod_rewrite.php | 27 ++++++++ .../db/migration/data/v310/notifications_cron.php | 27 ++++++++ .../migration/data/v310/softdelete_mcp_modules.php | 57 +++++++++++++++++ 8 files changed, 184 insertions(+), 176 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php delete mode 100644 phpBB/phpbb/db/migration/data/310/mod_rewrite.php delete mode 100644 phpBB/phpbb/db/migration/data/310/notifications_cron.php delete mode 100644 phpBB/phpbb/db/migration/data/310/softdelete_mcp_modules.php create mode 100644 phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php create mode 100644 phpBB/phpbb/db/migration/data/v310/mod_rewrite.php create mode 100644 phpBB/phpbb/db/migration/data/v310/notifications_cron.php create mode 100644 phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php deleted file mode 100644 index cad1c16bb2..0000000000 --- a/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php +++ /dev/null @@ -1,71 +0,0 @@ -db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth'); - } - - public function update_schema() - { - return array( - 'add_tables' => array( - $this->table_prefix . 'oauth_tokens' => array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), // phpbb_users.user_id - 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set - 'provider' => array('VCHAR', ''), // Name of the OAuth provider - 'oauth_token' => array('MTEXT', ''), // Serialized token - ), - 'KEYS' => array( - 'user_id' => array('INDEX', 'user_id'), - 'provider' => array('INDEX', 'provider'), - ), - ), - $this->table_prefix . 'oauth_accounts' => array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), - 'provider' => array('VCHAR', ''), - 'oauth_provider_id' => array('TEXT_UNI', ''), - ), - 'PRIMARY_KEY' => array( - 'user_id', - 'provider', - ), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_tables' => array( - $this->table_prefix . 'oauth_tokens', - $this->table_prefix . 'oauth_accounts', - ), - ); - } - - public function update_data() - { - return array( - array('module.add', array( - 'ucp', - 'UCP_PROFILE', - array( - 'module_basename' => 'ucp_auth_link', - 'modes' => array('auth_link'), - ), - )), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/mod_rewrite.php b/phpBB/phpbb/db/migration/data/310/mod_rewrite.php deleted file mode 100644 index 85ce25abf3..0000000000 --- a/phpBB/phpbb/db/migration/data/310/mod_rewrite.php +++ /dev/null @@ -1,25 +0,0 @@ -db->sql_query($sql); - $module_id = $this->db->sql_fetchfield('module_id'); - $this->db->sql_freeresult($result); - - return $module_id !== false; - } - - static public function depends_on() - { - return array( - 'phpbb_db_migration_data_310_dev', - 'phpbb_db_migration_data_310_softdelete_p2', - ); - } - - public function update_data() - { - return array( - array('module.add', array( - 'mcp', - 'MCP_QUEUE', - array( - 'module_basename' => 'mcp_queue', - 'modes' => array('deleted_topics'), - ), - )), - array('module.add', array( - 'mcp', - 'MCP_QUEUE', - array( - 'module_basename' => 'mcp_queue', - 'modes' => array('deleted_posts'), - ), - )), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php new file mode 100644 index 0000000000..971a7e8504 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php @@ -0,0 +1,73 @@ +db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'oauth_tokens' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), // phpbb_users.user_id + 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set + 'provider' => array('VCHAR', ''), // Name of the OAuth provider + 'oauth_token' => array('MTEXT', ''), // Serialized token + ), + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + 'provider' => array('INDEX', 'provider'), + ), + ), + $this->table_prefix . 'oauth_accounts' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'provider' => array('VCHAR', ''), + 'oauth_provider_id' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => array( + 'user_id', + 'provider', + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'oauth_tokens', + $this->table_prefix . 'oauth_accounts', + ), + ); + } + + public function update_data() + { + return array( + array('module.add', array( + 'ucp', + 'UCP_PROFILE', + array( + 'module_basename' => 'ucp_auth_link', + 'modes' => array('auth_link'), + ), + )), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php b/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php new file mode 100644 index 0000000000..ffb790b135 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php @@ -0,0 +1,27 @@ +db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + return $module_id !== false; + } + + static public function depends_on() + { + return array( + 'phpbb\db\migration\data\v310\dev', + 'phpbb\db\migration\data\v310\softdelete_p2', + ); + } + + public function update_data() + { + return array( + array('module.add', array( + 'mcp', + 'MCP_QUEUE', + array( + 'module_basename' => 'mcp_queue', + 'modes' => array('deleted_topics'), + ), + )), + array('module.add', array( + 'mcp', + 'MCP_QUEUE', + array( + 'module_basename' => 'mcp_queue', + 'modes' => array('deleted_posts'), + ), + )), + ); + } +} -- cgit v1.2.1 From 3860b37741c21576dae2f02e3754aa322c24567f Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 16 Sep 2013 03:50:47 +0200 Subject: [ticket/11700] Actually "one" in comments is not a class PHPBB3-11700 --- phpBB/phpbb/db/tools.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index f594fbe63f..8ae58e2d4b 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -1072,7 +1072,7 @@ class tools { $new_table_cols[] = 'PRIMARY KEY (' . implode(', ', $sql_schema_changes['primary_key']) . ')'; } - // Add a new \one or the old primary key + // Add a new one or the old primary key else if ($primary_key !== false) { $new_table_cols[] = $primary_key; -- cgit v1.2.1 From d626ebaf1e3d993ba3474c8dd403b18d5faf8863 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 16 Sep 2013 04:45:58 +0200 Subject: [ticket/11700] Fix a few more comments PHPBB3-11700 --- phpBB/phpbb/db/driver/driver.php | 4 ++-- phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php | 8 ++++---- phpBB/phpbb/db/migration/data/v310/dev.php | 2 +- phpBB/phpbb/db/migration/data/v310/timezone.php | 2 +- phpBB/phpbb/db/migration/exception.php | 6 +++--- phpBB/phpbb/db/migration/tool/config.php | 2 +- phpBB/phpbb/db/migration/tool/module.php | 2 +- phpBB/phpbb/db/migration/tool/permission.php | 2 +- phpBB/phpbb/db/migrator.php | 2 +- phpBB/phpbb/db/tools.php | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index a266b2aa48..cd960bc65a 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -274,7 +274,7 @@ class driver * Correctly adjust LIKE expression for special characters * Some DBMS are handling them in a different way * - * @param string $expression The expression to use. Every wildcard is escaped, \except $this->any_char and $this->one_char + * @param string $expression The expression to use. Every wildcard is escaped, except $this->any_char and $this->one_char * @return string LIKE expression including the keyword! */ function sql_like_expression($expression) @@ -452,7 +452,7 @@ class driver * @param string $field name of the sql column that shall be compared * @param array $array array of values that are allowed (IN) or not allowed (NOT IN) * @param bool $negate true for NOT IN (), false for IN () (default) - * @param bool $allow_empty_set If true, \allow $array to be empty, this function will return 1=1 or 1=0 then. Default to false. + * @param bool $allow_empty_set If true, allow $array to be empty, this function will return 1=1 or 1=0 then. Default to false. */ function sql_in_set($field, $array, $negate = false, $allow_empty_set = false) { diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php index 712d54a723..87d5e490f8 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php @@ -216,7 +216,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration $group_id = $this->db->sql_nextid(); } - // Insert new \user role... at the end of the chain + // Insert new user role... at the end of the chain $sql = 'SELECT role_id FROM ' . ACL_ROLES_TABLE . " WHERE role_name = 'ROLE_USER_NEW_MEMBER' @@ -241,7 +241,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration $u_role = $this->db->sql_nextid(); // Now add the correct data to the roles... - // The standard role says that new \users are not able to send a PM, Mass PM, are not able to PM groups + // The standard role says that new users are not able to send a PM, Mass PM, are not able to PM groups $sql = 'INSERT INTO ' . ACL_ROLES_DATA_TABLE . " (role_id, auth_option_id, auth_setting) SELECT $u_role, auth_option_id, 0 FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group')"; $this->sql_query($sql); @@ -250,7 +250,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration $this->sql_query($sql); } - // Insert new \forum role + // Insert new forum role $sql = 'SELECT role_id FROM ' . ACL_ROLES_TABLE . " WHERE role_name = 'ROLE_FORUM_NEW_MEMBER' @@ -278,7 +278,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration $this->sql_query($sql); } - // Set every members user_new \column to 0 (old users) only if there is no one yet (this makes sure we do not execute this more than once) + // Set every members user_new column to 0 (old users) only if there is no one yet (this makes sure we do not execute this more than once) $sql = 'SELECT 1 FROM ' . USERS_TABLE . ' WHERE user_new = 0'; diff --git a/phpBB/phpbb/db/migration/data/v310/dev.php b/phpBB/phpbb/db/migration/data/v310/dev.php index 5a10e7c236..c1db883616 100644 --- a/phpBB/phpbb/db/migration/data/v310/dev.php +++ b/phpBB/phpbb/db/migration/data/v310/dev.php @@ -185,7 +185,7 @@ class dev extends \phpbb\db\migration\migration public function move_customise_modules() { - // Move language management to new \location in the Customise tab + // Move language management to new location in the Customise tab // First get language module id $sql = 'SELECT module_id FROM ' . MODULES_TABLE . " WHERE module_basename = 'acp_language'"; diff --git a/phpBB/phpbb/db/migration/data/v310/timezone.php b/phpBB/phpbb/db/migration/data/v310/timezone.php index 93c58819ce..e3b1912049 100644 --- a/phpBB/phpbb/db/migration/data/v310/timezone.php +++ b/phpBB/phpbb/db/migration/data/v310/timezone.php @@ -65,7 +65,7 @@ class timezone extends \phpbb\db\migration\migration } /** - * Determine the new \timezone for a given phpBB 3.0 timezone and + * Determine the new timezone for a given phpBB 3.0 timezone and * "Daylight Saving Time" option * * @param $timezone float Users timezone in 3.0 diff --git a/phpBB/phpbb/db/migration/exception.php b/phpBB/phpbb/db/migration/exception.php index 8bf18dec68..58e29b5218 100644 --- a/phpBB/phpbb/db/migration/exception.php +++ b/phpBB/phpbb/db/migration/exception.php @@ -18,7 +18,7 @@ if (!defined('IN_PHPBB')) } /** -* The migrator is responsible for applying new \migrations in the correct order. +* The migrator is responsible for applying new migrations in the correct order. * * @package db */ @@ -66,8 +66,8 @@ class exception extends \Exception } /** - * Get localised message (\with $user->lang()) - * + * Get localised message (with $user->lang()) + * * @param \phpbb\user $user * @return string */ diff --git a/phpBB/phpbb/db/migration/tool/config.php b/phpBB/phpbb/db/migration/tool/config.php index 6ff69bbd2b..f2149dc59a 100644 --- a/phpBB/phpbb/db/migration/tool/config.php +++ b/phpBB/phpbb/db/migration/tool/config.php @@ -80,7 +80,7 @@ class config implements \phpbb\db\migration\tool\tool_interface * current config value * * @param string $compare If equal to the current config value, will be - * updated to the new \config value, otherwise not + * updated to the new config value, otherwise not * @param string $config_name The name of the config setting you would * like to update * @param mixed $config_value The value of the config setting diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index ecb1176bd4..9869dd4230 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -131,7 +131,7 @@ class module implements \phpbb\db\migration\tool\tool_interface /** * Module Add * - * Add a new \module + * Add a new module * * @param string $class The module class(acp|mcp|ucp) * @param int|string $parent The parent module_id|module_langname (0 for no parent) diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index 51b0996c30..dfb32f79f4 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -238,7 +238,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface } /** - * Add a new \permission role + * Add a new permission role * * @param string $role_name The new \role name * @param sting $role_type The type (u_, m_, a_) diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index 0b9463a622..d7d2b3df59 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -18,7 +18,7 @@ if (!defined('IN_PHPBB')) } /** -* The migrator is responsible for applying new \migrations in the correct order. +* The migrator is responsible for applying new migrations in the correct order. * * @package db */ diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index 8ae58e2d4b..d6ea7cc97b 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -1703,7 +1703,7 @@ class tools } /** - * Add new \column + * Add new column */ function sql_column_add($table_name, $column_name, $column_data, $inline = false) { -- cgit v1.2.1 From 390dc86344c23b658085bae4a719399e5eb579f0 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 16 Sep 2013 05:00:18 +0200 Subject: [ticket/11700] And some last comments with backslashes PHPBB3-11700 --- phpBB/phpbb/db/tools.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index d6ea7cc97b..1f156fbb04 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -505,7 +505,7 @@ class tools trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR); } - // here we add the definition of the new \column to the list of columns + // here we add the definition of the new column to the list of columns switch ($this->sql_layer) { case 'mssql': @@ -992,7 +992,7 @@ class tools $column_list[] = $entities[0]; } - // note down the primary key notation because sqlite only supports adding it to the end for the new \table + // note down the primary key notation because sqlite only supports adding it to the end for the new table $primary_key = false; $_new_cols = array(); @@ -1080,7 +1080,7 @@ class tools $columns = implode(',', $column_list); - // create a new \table and fill it up. destroy the temp one + // create a new table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $new_table_cols) . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -1812,7 +1812,7 @@ class tools $new_table_cols = $column_name . ' ' . $column_data['column_type_sql'] . ',' . $new_table_cols; - // create a new \table and fill it up. destroy the temp one + // create a new table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -1927,7 +1927,7 @@ class tools $new_table_cols = preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols); - // create a new \table and fill it up. destroy the temp one + // create a new table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -2119,7 +2119,7 @@ class tools $columns = implode(',', $column_list); - // create a new \table and fill it up. destroy the temp one + // create a new table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ', PRIMARY KEY (' . implode(', ', $column) . '));'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; @@ -2485,7 +2485,7 @@ class tools $columns = implode(',', $column_list); - // create a new \table and fill it up. destroy the temp one + // create a new table and fill it up. destroy the temp one $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $old_table_cols) . ');'; $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'; $statements[] = 'DROP TABLE ' . $table_name . '_temp'; -- cgit v1.2.1 From d905358e2be11cc3fe040036b1138e54be7f30dc Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 16 Sep 2013 05:20:27 +0200 Subject: [ticket/11700] Fix leftover backslashes in comments PHPBB3-11700 --- phpBB/phpbb/db/migration/data/v310/timezone.php | 2 +- phpBB/phpbb/db/migration/tool/permission.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/timezone.php b/phpBB/phpbb/db/migration/data/v310/timezone.php index e3b1912049..dd0c6a2093 100644 --- a/phpBB/phpbb/db/migration/data/v310/timezone.php +++ b/phpBB/phpbb/db/migration/data/v310/timezone.php @@ -70,7 +70,7 @@ class timezone extends \phpbb\db\migration\migration * * @param $timezone float Users timezone in 3.0 * @param $dst int Users daylight saving time - * @return string Users new \php Timezone which is used since 3.1 + * @return string Users new php Timezone which is used since 3.1 */ public function convert_phpbb30_timezone($timezone, $dst) { diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index dfb32f79f4..fd2de9c8fb 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -240,7 +240,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface /** * Add a new permission role * - * @param string $role_name The new \role name + * @param string $role_name The new role name * @param sting $role_type The type (u_, m_, a_) * @return null */ @@ -279,7 +279,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface * Update the name on a permission role * * @param string $old_role_name The old role name - * @param string $new_role_name The new \role name + * @param string $new_role_name The new role name * @return null */ public function role_update($old_role_name, $new_role_name) -- cgit v1.2.1 From f205c4fad4c3a82cc4a47beb7f9a8025669a3acb Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 19 Sep 2013 17:03:05 +0200 Subject: [ticket/11700] Change search backend db entry to namespaces PHPBB3-11700 --- phpBB/phpbb/db/migration/data/v310/namespaces.php | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v310/namespaces.php (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/namespaces.php b/phpBB/phpbb/db/migration/data/v310/namespaces.php new file mode 100644 index 0000000000..6da015d0da --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/namespaces.php @@ -0,0 +1,30 @@ +config['search_type'])), + array('config.update', array('search_type', str_replace('phpbb_search_', 'phpbb\\search\\', $this->config['search_type']))), + )), + ); + } +} -- cgit v1.2.1 From ed55626165ad402507864ab21bb2ee64a0d70cbd Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 25 Sep 2013 10:01:44 +0200 Subject: [ticket/11700] Fix unresolvable condition in migration PHPBB3-11700 --- phpBB/phpbb/db/migration/data/v310/style_update_p2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php index 6c3b0de2a1..202a8409fb 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p2.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p2.php @@ -18,7 +18,7 @@ class style_update_p2 extends \phpbb\db\migration\migration static public function depends_on() { - return array('\phpbb\db\migration\data0\style_update_p1'); + return array('\phpbb\db\migration\data\v310\style_update_p1'); } public function update_schema() -- cgit v1.2.1 From 9373c0db9683dc0659545a28f904cc34c13d6be8 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 25 Sep 2013 14:40:12 +0200 Subject: [ticket/11700] Only replace phpbb_search in strings that match PHPBB3-11700 --- phpBB/phpbb/db/migration/data/v310/namespaces.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/namespaces.php b/phpBB/phpbb/db/migration/data/v310/namespaces.php index 6da015d0da..9b182f88b8 100644 --- a/phpBB/phpbb/db/migration/data/v310/namespaces.php +++ b/phpBB/phpbb/db/migration/data/v310/namespaces.php @@ -22,7 +22,7 @@ class namespaces extends \phpbb\db\migration\migration { return array( array('if', array( - (preg_match('#^phpbb_#', $this->config['search_type'])), + (preg_match('#^phpbb_search_#', $this->config['search_type'])), array('config.update', array('search_type', str_replace('phpbb_search_', 'phpbb\\search\\', $this->config['search_type']))), )), ); -- cgit v1.2.1 From cbc458e4768107e30688224e173c26493b971a41 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 25 Sep 2013 16:09:14 +0200 Subject: [ticket/11700] Update migrations table for namespaces PHPBB3-11700 --- phpBB/phpbb/db/migration/data/v310/namespaces.php | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/namespaces.php b/phpBB/phpbb/db/migration/data/v310/namespaces.php index 9b182f88b8..3dd65e09e4 100644 --- a/phpBB/phpbb/db/migration/data/v310/namespaces.php +++ b/phpBB/phpbb/db/migration/data/v310/namespaces.php @@ -25,6 +25,61 @@ class namespaces extends \phpbb\db\migration\migration (preg_match('#^phpbb_search_#', $this->config['search_type'])), array('config.update', array('search_type', str_replace('phpbb_search_', 'phpbb\\search\\', $this->config['search_type']))), )), + array('custom', array(array($this, 'update_migrations'))), ); } + + public function update_migrations() + { + $table = $this->table_prefix . 'migrations'; + + $sql = 'SELECT * + FROM migrations'; + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $migration_name = $row['migration_name']; + + $row['migration_name'] = $this->namespacify($row['migration_name']); + + $depends_on = ($row['migration_depends_on']) ? unserialize($row['migration_depends_on']) : false; + + if ($depends_on) + { + $depends_on_new = array(); + + foreach ($depends_on as $migration) + { + $depends_on_new[] = $this->namespacify($migration); + } + + $depends_on = serialize($depends_on_new); + $row['migration_depends_on'] = $depends_on; + } + + $sql_update = $this->db->sql_build_array('UPDATE', $row); + + $sql = 'UPDATE ' . MODULES_TABLE . ' + SET ' . $sql_update . ' + WHERE module_id = ' . $migration_name; + $this->sql_query($sql); + } + } + + public function namespacify($migration_name) + { + $parts = explode('_', $migration_name); + + $namespace = ''; + $class = ''; + + while (count($parts) > 1 && (!$class || !class_exists($class))) + { + $namespace = $namespace . '\\' . array_shift($parts); + $class = $namespace . '\\' . implode('_', $parts); + } + + return $class; + } } -- cgit v1.2.1 From 645bd127dd53300b7877b779226ac53a4891620c Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 25 Sep 2013 16:20:26 +0200 Subject: [ticket/11700] Undo migrations migration, as not an issue for new installs PHPBB3-11700 --- phpBB/phpbb/db/migration/data/v310/namespaces.php | 55 ----------------------- 1 file changed, 55 deletions(-) (limited to 'phpBB/phpbb/db') diff --git a/phpBB/phpbb/db/migration/data/v310/namespaces.php b/phpBB/phpbb/db/migration/data/v310/namespaces.php index 3dd65e09e4..9b182f88b8 100644 --- a/phpBB/phpbb/db/migration/data/v310/namespaces.php +++ b/phpBB/phpbb/db/migration/data/v310/namespaces.php @@ -25,61 +25,6 @@ class namespaces extends \phpbb\db\migration\migration (preg_match('#^phpbb_search_#', $this->config['search_type'])), array('config.update', array('search_type', str_replace('phpbb_search_', 'phpbb\\search\\', $this->config['search_type']))), )), - array('custom', array(array($this, 'update_migrations'))), ); } - - public function update_migrations() - { - $table = $this->table_prefix . 'migrations'; - - $sql = 'SELECT * - FROM migrations'; - $result = $this->db->sql_query($sql); - - while ($row = $this->db->sql_fetchrow($result)) - { - $migration_name = $row['migration_name']; - - $row['migration_name'] = $this->namespacify($row['migration_name']); - - $depends_on = ($row['migration_depends_on']) ? unserialize($row['migration_depends_on']) : false; - - if ($depends_on) - { - $depends_on_new = array(); - - foreach ($depends_on as $migration) - { - $depends_on_new[] = $this->namespacify($migration); - } - - $depends_on = serialize($depends_on_new); - $row['migration_depends_on'] = $depends_on; - } - - $sql_update = $this->db->sql_build_array('UPDATE', $row); - - $sql = 'UPDATE ' . MODULES_TABLE . ' - SET ' . $sql_update . ' - WHERE module_id = ' . $migration_name; - $this->sql_query($sql); - } - } - - public function namespacify($migration_name) - { - $parts = explode('_', $migration_name); - - $namespace = ''; - $class = ''; - - while (count($parts) > 1 && (!$class || !class_exists($class))) - { - $namespace = $namespace . '\\' . array_shift($parts); - $class = $namespace . '\\' . implode('_', $parts); - } - - return $class; - } } -- cgit v1.2.1