aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/develop
diff options
context:
space:
mode:
authorMaat <maat-pub@mageia.biz>2020-05-08 18:29:30 +0200
committerMaat <maat-pub@mageia.biz>2020-05-08 21:36:04 +0200
commit36bc1870f21fac04736a1049c1d5b8e127d729f4 (patch)
tree9d102331eeaf1ef3cd23e656320d7c08e65757ed /phpBB/develop
parent8875d385d0579b451dac4d9bda465172b4f69ee0 (diff)
parent149375253685b3a38996f63015a74b7a0f53aa14 (diff)
downloadforums-36bc1870f21fac04736a1049c1d5b8e127d729f4.tar
forums-36bc1870f21fac04736a1049c1d5b8e127d729f4.tar.gz
forums-36bc1870f21fac04736a1049c1d5b8e127d729f4.tar.bz2
forums-36bc1870f21fac04736a1049c1d5b8e127d729f4.tar.xz
forums-36bc1870f21fac04736a1049c1d5b8e127d729f4.zip
Merge remote-tracking branch 'upstream/prep-release-3.1.11'
Diffstat (limited to 'phpBB/develop')
-rw-r--r--phpBB/develop/add_permissions.php19
-rw-r--r--phpBB/develop/adjust_avatars.php2
-rw-r--r--phpBB/develop/adjust_bbcodes.php2
-rw-r--r--phpBB/develop/adjust_magic_urls.php2
-rw-r--r--phpBB/develop/adjust_sizes.php2
-rw-r--r--phpBB/develop/adjust_smilies.php2
-rw-r--r--phpBB/develop/adjust_uids.php1
-rw-r--r--phpBB/develop/adjust_usernames.php2
-rw-r--r--phpBB/develop/benchmark.php26
-rw-r--r--phpBB/develop/blank.gif0
-rw-r--r--phpBB/develop/blank.jpg0
-rw-r--r--phpBB/develop/calc_email_hash.php12
-rw-r--r--phpBB/develop/change_smiley_ref.php12
-rw-r--r--phpBB/develop/check_flash_bbcodes.php14
-rw-r--r--phpBB/develop/create_schema_files.php2116
-rw-r--r--phpBB/develop/create_search_index.php11
-rw-r--r--phpBB/develop/create_variable_overview.php28
-rw-r--r--phpBB/develop/export_events_for_wiki.php138
-rw-r--r--phpBB/develop/fill.php18
-rw-r--r--phpBB/develop/generate_utf_casefold.php12
-rw-r--r--phpBB/develop/generate_utf_confusables.php12
-rw-r--r--phpBB/develop/generate_utf_tables.php12
-rw-r--r--phpBB/develop/imageset_to_css.php374
-rw-r--r--phpBB/develop/lang_duplicates.php9
-rw-r--r--phpBB/develop/merge_attachment_tables.php14
-rw-r--r--phpBB/develop/merge_post_tables.php20
-rw-r--r--phpBB/develop/mysql_upgrader.php1245
-rw-r--r--phpBB/develop/namespacify.php194
-rw-r--r--phpBB/develop/nuke-db.php2
-rw-r--r--phpBB/develop/regex.php2
-rw-r--r--phpBB/develop/regex_idn.php151
-rwxr-xr-xphpBB/develop/remove-php-end-tags.py65
-rw-r--r--phpBB/develop/rename_interfaces.php56
-rw-r--r--phpBB/develop/repair_bots.php4
-rw-r--r--phpBB/develop/search_fill.php6
-rwxr-xr-xphpBB/develop/strip_icc_profiles.sh9
-rw-r--r--phpBB/develop/unicode_testing.php2
-rw-r--r--phpBB/develop/update_email_hash.php1
-rw-r--r--phpBB/develop/utf_normalizer_test.php12
39 files changed, 1173 insertions, 3436 deletions
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php
index 6f26bf6ac6..a5279f8f13 100644
--- a/phpBB/develop/add_permissions.php
+++ b/phpBB/develop/add_permissions.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2004 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -194,9 +198,9 @@ $prefixes = array('f_', 'a_', 'm_', 'u_');
foreach ($prefixes as $prefix)
{
$var = $prefix . 'permissions';
- if (sizeof($$var))
+ if (sizeof(${$var}))
{
- foreach ($$var as $auth_option => $l_ary)
+ foreach (${$var} as $auth_option => $l_ary)
{
$sql_ary = array(
'auth_option' => $auth_option,
@@ -367,7 +371,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
switch ($sql_type)
{
case 'insert':
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -376,6 +380,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
case 'mssql':
case 'sqlite':
+ case 'sqlite3':
$sql = implode(' UNION ALL ', preg_replace('#^(.*?)$#', 'SELECT \1', $sql_subary));
break;
@@ -409,5 +414,3 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
unset($sql_ary);
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_avatars.php b/phpBB/develop/adjust_avatars.php
index 81599e694b..dc4ae88f37 100644
--- a/phpBB/develop/adjust_avatars.php
+++ b/phpBB/develop/adjust_avatars.php
@@ -143,5 +143,3 @@ function adjust_avatar($old_name, $midfix)
}
return false;
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_bbcodes.php b/phpBB/develop/adjust_bbcodes.php
index f06f0112ab..5a7f065d7f 100644
--- a/phpBB/develop/adjust_bbcodes.php
+++ b/phpBB/develop/adjust_bbcodes.php
@@ -170,5 +170,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_magic_urls.php b/phpBB/develop/adjust_magic_urls.php
index 1430a47a12..c417c755cf 100644
--- a/phpBB/develop/adjust_magic_urls.php
+++ b/phpBB/develop/adjust_magic_urls.php
@@ -122,5 +122,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_sizes.php b/phpBB/develop/adjust_sizes.php
index 7d72813056..9b58389163 100644
--- a/phpBB/develop/adjust_sizes.php
+++ b/phpBB/develop/adjust_sizes.php
@@ -128,5 +128,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_smilies.php b/phpBB/develop/adjust_smilies.php
index 774c8834f6..ecc3461670 100644
--- a/phpBB/develop/adjust_smilies.php
+++ b/phpBB/develop/adjust_smilies.php
@@ -126,5 +126,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_uids.php b/phpBB/develop/adjust_uids.php
index d301f3cadb..3468475b8f 100644
--- a/phpBB/develop/adjust_uids.php
+++ b/phpBB/develop/adjust_uids.php
@@ -126,4 +126,3 @@ $db->sql_freeresult($result);
// Done
$db->sql_close();
echo 'done';
-?> \ No newline at end of file
diff --git a/phpBB/develop/adjust_usernames.php b/phpBB/develop/adjust_usernames.php
index 1afa77af16..111a9a30d7 100644
--- a/phpBB/develop/adjust_usernames.php
+++ b/phpBB/develop/adjust_usernames.php
@@ -48,5 +48,3 @@ echo 'FINISHED';
// Done
$db->sql_close();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php
index 5bbe6f53be..c3cf90773e 100644
--- a/phpBB/develop/benchmark.php
+++ b/phpBB/develop/benchmark.php
@@ -192,13 +192,13 @@ function get_topic_count($forum_id)
{
global $db;
- $sql = "SELECT forum_topics
+ $sql = "SELECT forum_topics_approved
FROM " . FORUMS_TABLE . "
WHERE (forum_id = $forum_id)";
if($result = $db->sql_query($sql))
{
$row = $db->sql_fetchrow($result);
- $topic_count = $row['forum_topics'];
+ $topic_count = $row['forum_topics_approved'];
unset($result);
unset($row);
@@ -263,7 +263,7 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
$post_message = prepare_message($text, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
- $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, attach_id, icon_id, post_username, post_time, poster_ip, post_approved, bbcode_uid, enable_bbcode, enable_html, enable_smilies, enable_sig, post_subject, post_text)
+ $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, attach_id, icon_id, post_username, post_time, poster_ip, post_visibility, bbcode_uid, enable_bbcode, enable_html, enable_smilies, enable_sig, post_subject, post_text)
VALUES ($new_topic_id, $forum_id, $user_id, 0, 0, '$post_username', $current_time, '$user_ip', 1, '$bbcode_uid', $bbcode_on, $html_on, $smilies_on, $attach_sig, '$post_subject', '$post_message')";
$result = $db->sql_query($sql);
@@ -282,10 +282,10 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
if($db->sql_query($sql))
{
$sql = "UPDATE " . FORUMS_TABLE . "
- SET forum_last_post_id = $new_post_id, forum_posts = forum_posts + 1";
+ SET forum_last_post_id = $new_post_id, forum_posts_approved = forum_posts_approved + 1";
if($mode == "newtopic")
{
- $sql .= ", forum_topics = forum_topics + 1";
+ $sql .= ", forum_topics_approved = forum_topics_approved + 1";
}
$sql .= " WHERE forum_id = $forum_id";
@@ -313,7 +313,7 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
else
{
// Rollback
- if($db->sql_layer == "mysql")
+ if($db->get_sql_layer() == "mysql")
{
$sql = "DELETE FROM " . POSTS_TABLE . "
WHERE post_id = $new_post_id";
@@ -366,18 +366,10 @@ function make_user($username)
$password = md5("benchpass");
$email = "nobody@localhost";
- $icq = "12345678";
- $website = "http://www.phpbb.com";
- $occupation = "phpBB tester";
- $location = "phpBB world hq";
- $interests = "Eating, sleeping, living, and breathing phpBB";
$signature = "$username: phpBB tester.";
$signature_bbcode_uid = "";
$avatar_filename = "";
$viewemail = 0;
- $aim = 0;
- $yim = 0;
- $msn = 0;
$attachsig = 1;
$allowsmilies = 1;
$allowhtml = 1;
@@ -422,8 +414,8 @@ function make_user($username)
}
- $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
- VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$icq', '$website', '$occupation', '$location', '$interests', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, '$aim', '$yim', '$msn', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, ";
+ $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
+ VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, ";
$sql .= "1, '')";
@@ -458,5 +450,3 @@ function make_user($username)
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/blank.gif b/phpBB/develop/blank.gif
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/phpBB/develop/blank.gif
diff --git a/phpBB/develop/blank.jpg b/phpBB/develop/blank.jpg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/phpBB/develop/blank.jpg
diff --git a/phpBB/develop/calc_email_hash.php b/phpBB/develop/calc_email_hash.php
index fccdfdfca9..740f9158cf 100644
--- a/phpBB/develop/calc_email_hash.php
+++ b/phpBB/develop/calc_email_hash.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2004 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -68,5 +72,3 @@ do
while ($start);
echo "<p><b>Done</b></p>\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/change_smiley_ref.php b/phpBB/develop/change_smiley_ref.php
index 59ee77b7b1..a2315bc382 100644
--- a/phpBB/develop/change_smiley_ref.php
+++ b/phpBB/develop/change_smiley_ref.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2003 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -46,5 +50,3 @@ while ($row = $db->sql_fetchrow($result))
$db->sql_freeresult($result);
echo "<p><b>Done</b></p>\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/check_flash_bbcodes.php b/phpBB/develop/check_flash_bbcodes.php
index 5946f685b8..6e1b415bb6 100644
--- a/phpBB/develop/check_flash_bbcodes.php
+++ b/phpBB/develop/check_flash_bbcodes.php
@@ -1,14 +1,20 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2009, 2010 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
*
-* This script will check your database for potentially dangerous flash BBCode tags
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
+/**
+* This script will check your database for potentially dangerous flash BBCode tags
+*/
+
//
// Security message:
//
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index b5f1202c0d..60ffe04330 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -1,10 +1,17 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
* This file creates new schema files for every database.
* The filenames will be prefixed with an underscore to not overwrite the current schema files.
*
@@ -12,2090 +19,41 @@
*/
$schema_path = dirname(__FILE__) . '/../install/schemas/';
+$supported_dbms = array(
+ 'mssql',
+ 'mysql_40',
+ 'mysql_41',
+ 'oracle',
+ 'postgres',
+ 'sqlite',
+);
+$table_prefix = 'phpbb_';
if (!is_writable($schema_path))
{
die('Schema path not writable');
}
-$schema_data = get_schema_struct();
-$dbms_type_map = array(
- 'mysql_41' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT' => 'text',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT' => 'text',
- 'TEXT_UNI' => 'text',
- 'MTEXT' => 'mediumtext',
- 'MTEXT_UNI' => 'mediumtext',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'mysql_40' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varbinary(255)',
- 'VCHAR:' => 'varbinary(%d)',
- 'CHAR:' => 'binary(%d)',
- 'XSTEXT' => 'blob',
- 'XSTEXT_UNI'=> 'blob',
- 'STEXT' => 'blob',
- 'STEXT_UNI' => 'blob',
- 'TEXT' => 'blob',
- 'TEXT_UNI' => 'blob',
- 'MTEXT' => 'mediumblob',
- 'MTEXT_UNI' => 'mediumblob',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'blob',
- 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
- 'VCHAR_CI' => 'blob',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'firebird' => array(
- 'INT:' => 'INTEGER',
- 'BINT' => 'DOUBLE PRECISION',
- 'UINT' => 'INTEGER',
- 'UINT:' => 'INTEGER',
- 'TINT:' => 'INTEGER',
- 'USINT' => 'INTEGER',
- 'BOOL' => 'INTEGER',
- 'VCHAR' => 'VARCHAR(255) CHARACTER SET NONE',
- 'VCHAR:' => 'VARCHAR(%d) CHARACTER SET NONE',
- 'CHAR:' => 'CHAR(%d) CHARACTER SET NONE',
- 'XSTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'STEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'TEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'MTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'XSTEXT_UNI'=> 'VARCHAR(100) CHARACTER SET UTF8',
- 'STEXT_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'TEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'MTEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'TIMESTAMP' => 'INTEGER',
- 'DECIMAL' => 'DOUBLE PRECISION',
- 'DECIMAL:' => 'DOUBLE PRECISION',
- 'PDECIMAL' => 'DOUBLE PRECISION',
- 'PDECIMAL:' => 'DOUBLE PRECISION',
- 'VCHAR_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VCHAR_UNI:'=> 'VARCHAR(%d) CHARACTER SET UTF8',
- 'VCHAR_CI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VARBINARY' => 'CHAR(255) CHARACTER SET NONE',
- ),
-
- 'mssql' => array(
- 'INT:' => '[int]',
- 'BINT' => '[float]',
- 'UINT' => '[int]',
- 'UINT:' => '[int]',
- 'TINT:' => '[int]',
- 'USINT' => '[int]',
- 'BOOL' => '[int]',
- 'VCHAR' => '[varchar] (255)',
- 'VCHAR:' => '[varchar] (%d)',
- 'CHAR:' => '[char] (%d)',
- 'XSTEXT' => '[varchar] (1000)',
- 'STEXT' => '[varchar] (3000)',
- 'TEXT' => '[varchar] (8000)',
- 'MTEXT' => '[text]',
- 'XSTEXT_UNI'=> '[varchar] (100)',
- 'STEXT_UNI' => '[varchar] (255)',
- 'TEXT_UNI' => '[varchar] (4000)',
- 'MTEXT_UNI' => '[text]',
- 'TIMESTAMP' => '[int]',
- 'DECIMAL' => '[float]',
- 'DECIMAL:' => '[float]',
- 'PDECIMAL' => '[float]',
- 'PDECIMAL:' => '[float]',
- 'VCHAR_UNI' => '[varchar] (255)',
- 'VCHAR_UNI:'=> '[varchar] (%d)',
- 'VCHAR_CI' => '[varchar] (255)',
- 'VARBINARY' => '[varchar] (255)',
- ),
-
- 'oracle' => array(
- 'INT:' => 'number(%d)',
- 'BINT' => 'number(20)',
- 'UINT' => 'number(8)',
- 'UINT:' => 'number(%d)',
- 'TINT:' => 'number(%d)',
- 'USINT' => 'number(4)',
- 'BOOL' => 'number(1)',
- 'VCHAR' => 'varchar2(255)',
- 'VCHAR:' => 'varchar2(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar2(1000)',
- 'STEXT' => 'varchar2(3000)',
- 'TEXT' => 'clob',
- 'MTEXT' => 'clob',
- 'XSTEXT_UNI'=> 'varchar2(300)',
- 'STEXT_UNI' => 'varchar2(765)',
- 'TEXT_UNI' => 'clob',
- 'MTEXT_UNI' => 'clob',
- 'TIMESTAMP' => 'number(11)',
- 'DECIMAL' => 'number(5, 2)',
- 'DECIMAL:' => 'number(%d, 2)',
- 'PDECIMAL' => 'number(6, 3)',
- 'PDECIMAL:' => 'number(%d, 3)',
- 'VCHAR_UNI' => 'varchar2(765)',
- 'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')),
- 'VCHAR_CI' => 'varchar2(255)',
- 'VARBINARY' => 'raw(255)',
- ),
-
- 'sqlite' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'INTEGER UNSIGNED', //'mediumint(8) UNSIGNED',
- 'UINT:' => 'INTEGER UNSIGNED', // 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'INTEGER UNSIGNED', //'mediumint(4) UNSIGNED',
- 'BOOL' => 'INTEGER UNSIGNED', //'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text(65535)',
- 'STEXT' => 'text(65535)',
- 'TEXT' => 'text(65535)',
- 'MTEXT' => 'mediumtext(16777215)',
- 'XSTEXT_UNI'=> 'text(65535)',
- 'STEXT_UNI' => 'text(65535)',
- 'TEXT_UNI' => 'text(65535)',
- 'MTEXT_UNI' => 'mediumtext(16777215)',
- 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'blob',
- ),
-
- 'postgres' => array(
- 'INT:' => 'INT4',
- 'BINT' => 'INT8',
- 'UINT' => 'INT4', // unsigned
- 'UINT:' => 'INT4', // unsigned
- 'USINT' => 'INT2', // unsigned
- 'BOOL' => 'INT2', // unsigned
- 'TINT:' => 'INT2',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar(1000)',
- 'STEXT' => 'varchar(3000)',
- 'TEXT' => 'varchar(8000)',
- 'MTEXT' => 'TEXT',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT_UNI' => 'varchar(4000)',
- 'MTEXT_UNI' => 'TEXT',
- 'TIMESTAMP' => 'INT4', // unsigned
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar_ci',
- 'VARBINARY' => 'bytea',
- ),
-);
-
-// A list of types being unsigned for better reference in some db's
-$unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
-$supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
-
-foreach ($supported_dbms as $dbms)
-{
- $schema_data = get_schema_struct();
- if ($dbms == 'mssql')
- {
- foreach ($schema_data as $table_name => $table_data)
- {
- if (!isset($table_data['PRIMARY_KEY']))
- {
- $schema_data[$table_name]['COLUMNS']['mssqlindex'] = array('UINT', NULL, 'auto_increment');
- $schema_data[$table_name]['PRIMARY_KEY'] = 'mssqlindex';
- }
- }
- }
-
- $fp = fopen($schema_path . $dbms . '_schema.sql', 'wb');
-
- $line = '';
-
- // Write Header
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- case 'firebird':
- case 'sqlite':
- fwrite($fp, "# DO NOT EDIT THIS FILE, IT IS GENERATED\n");
- fwrite($fp, "#\n");
- fwrite($fp, "# To change the contents of this file, edit\n");
- fwrite($fp, "# phpBB/develop/create_schema_files.php and\n");
- fwrite($fp, "# run it.\n");
- break;
-
- case 'mssql':
- case 'oracle':
- case 'postgres':
- fwrite($fp, "/*\n");
- fwrite($fp, " * DO NOT EDIT THIS FILE, IT IS GENERATED\n");
- fwrite($fp, " *\n");
- fwrite($fp, " * To change the contents of this file, edit\n");
- fwrite($fp, " * phpBB/develop/create_schema_files.php and\n");
- fwrite($fp, " * run it.\n");
- fwrite($fp, " */\n\n");
- break;
- }
-
- switch ($dbms)
- {
- case 'firebird':
- $line .= custom_data('firebird') . "\n";
- break;
-
- case 'sqlite':
- $line .= "BEGIN TRANSACTION;\n\n";
- break;
-
- case 'oracle':
- $line .= custom_data('oracle') . "\n";
- break;
-
- case 'postgres':
- $line .= "BEGIN;\n\n";
- $line .= custom_data('postgres') . "\n";
- break;
- }
-
- fwrite($fp, $line);
-
- foreach ($schema_data as $table_name => $table_data)
- {
- // Write comment about table
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- case 'firebird':
- case 'sqlite':
- fwrite($fp, "# Table: '{$table_name}'\n");
- break;
-
- case 'mssql':
- case 'oracle':
- case 'postgres':
- fwrite($fp, "/*\n\tTable: '{$table_name}'\n*/\n");
- break;
- }
-
- // Create Table statement
- $generator = $textimage = false;
- $line = '';
-
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- case 'firebird':
- case 'oracle':
- case 'sqlite':
- case 'postgres':
- $line = "CREATE TABLE {$table_name} (\n";
- break;
-
- case 'mssql':
- $line = "CREATE TABLE [{$table_name}] (\n";
- break;
- }
-
- // Table specific so we don't get overlap
- $modded_array = array();
-
- // Write columns one by one...
- foreach ($table_data['COLUMNS'] as $column_name => $column_data)
- {
- if (strlen($column_name) > 30)
- {
- trigger_error("Column name '$column_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
- }
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment' && strlen($column_name) > 26) // "${column_name}_gen"
- {
- trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
- }
-
- // Get type
- if (strpos($column_data[0], ':') !== false)
- {
- list($orig_column_type, $column_length) = explode(':', $column_data[0]);
- if (!is_array($dbms_type_map[$dbms][$orig_column_type . ':']))
- {
- $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'], $column_length);
- }
- else
- {
- if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['rule']))
- {
- switch ($dbms_type_map[$dbms][$orig_column_type . ':']['rule'][0])
- {
- case 'div':
- $column_length /= $dbms_type_map[$dbms][$orig_column_type . ':']['rule'][1];
- $column_length = ceil($column_length);
- $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length);
- break;
- }
- }
-
- if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['limit']))
- {
- switch ($dbms_type_map[$dbms][$orig_column_type . ':']['limit'][0])
- {
- case 'mult':
- $column_length *= $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][1];
- if ($column_length > $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][2])
- {
- $column_type = $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][3];
- $modded_array[$column_name] = $column_type;
- }
- else
- {
- $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length);
- }
- break;
- }
- }
- }
- $orig_column_type .= ':';
- }
- else
- {
- $orig_column_type = $column_data[0];
- $column_type = $dbms_type_map[$dbms][$column_data[0]];
- if ($column_type == 'text' || $column_type == 'blob')
- {
- $modded_array[$column_name] = $column_type;
- }
- }
-
- // Adjust default value if db-dependant specified
- if (is_array($column_data[1]))
- {
- $column_data[1] = (isset($column_data[1][$dbms])) ? $column_data[1][$dbms] : $column_data[1]['default'];
- }
-
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- $line .= "\t{$column_name} {$column_type} ";
-
- // For hexadecimal values do not use single quotes
- if (!is_null($column_data[1]) && substr($column_type, -4) !== 'text' && substr($column_type, -4) !== 'blob')
- {
- $line .= (strpos($column_data[1], '0x') === 0) ? "DEFAULT {$column_data[1]} " : "DEFAULT '{$column_data[1]}' ";
- }
- $line .= 'NOT NULL';
-
- if (isset($column_data[2]))
- {
- if ($column_data[2] == 'auto_increment')
- {
- $line .= ' auto_increment';
- }
- else if ($dbms === 'mysql_41' && $column_data[2] == 'true_sort')
- {
- $line .= ' COLLATE utf8_unicode_ci';
- }
- }
-
- $line .= ",\n";
- break;
-
- case 'sqlite':
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $line .= "\t{$column_name} INTEGER PRIMARY KEY ";
- $generator = $column_name;
- }
- else
- {
- $line .= "\t{$column_name} {$column_type} ";
- }
-
- $line .= 'NOT NULL ';
- $line .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}'" : '';
- $line .= ",\n";
- break;
-
- case 'firebird':
- $line .= "\t{$column_name} {$column_type} ";
-
- if (!is_null($column_data[1]))
- {
- $line .= 'DEFAULT ' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' ';
- }
-
- $line .= 'NOT NULL';
-
- // This is a UNICODE column and thus should be given it's fair share
- if (preg_match('/^X?STEXT_UNI|VCHAR_(CI|UNI:?)/', $column_data[0]))
- {
- $line .= ' COLLATE UNICODE';
- }
-
- $line .= ",\n";
-
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $generator = $column_name;
- }
- break;
-
- case 'mssql':
- if ($column_type == '[text]')
- {
- $textimage = true;
- }
-
- $line .= "\t[{$column_name}] {$column_type} ";
+define('IN_PHPBB', true);
+$phpbb_root_path = dirname(__FILE__) . '/../';
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
- if (!is_null($column_data[1]))
- {
- // For hexadecimal values do not use single quotes
- if (strpos($column_data[1], '0x') === 0)
- {
- $line .= 'DEFAULT (' . $column_data[1] . ') ';
- }
- else
- {
- $line .= 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
- }
- }
-
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $line .= 'IDENTITY (1, 1) ';
- }
-
- $line .= 'NOT NULL';
- $line .= " ,\n";
- break;
-
- case 'oracle':
- $line .= "\t{$column_name} {$column_type} ";
- $line .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : '';
-
- // In Oracle empty strings ('') are treated as NULL.
- // Therefore in oracle we allow NULL's for all DEFAULT '' entries
- $line .= ($column_data[1] === '') ? ",\n" : "NOT NULL,\n";
-
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $generator = $column_name;
- }
- break;
-
- case 'postgres':
- $line .= "\t{$column_name} {$column_type} ";
-
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $line .= "DEFAULT nextval('{$table_name}_seq'),\n";
-
- // Make sure the sequence will be created before creating the table
- $line = "CREATE SEQUENCE {$table_name}_seq;\n\n" . $line;
- }
- else
- {
- $line .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : '';
- $line .= "NOT NULL";
-
- // Unsigned? Then add a CHECK contraint
- if (in_array($orig_column_type, $unsigned_types))
- {
- $line .= " CHECK ({$column_name} >= 0)";
- }
-
- $line .= ",\n";
- }
- break;
- }
- }
-
- switch ($dbms)
- {
- case 'firebird':
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n);;\n\n";
- break;
-
- case 'mssql':
- $line = substr($line, 0, -2);
- $line .= "\n)";// ON [PRIMARY]" . (($textimage) ? ' TEXTIMAGE_ON [PRIMARY]' : '') . "\n";
- $line .= "GO\n\n";
- break;
- }
-
- // Write primary key
- if (isset($table_data['PRIMARY_KEY']))
- {
- if (!is_array($table_data['PRIMARY_KEY']))
- {
- $table_data['PRIMARY_KEY'] = array($table_data['PRIMARY_KEY']);
- }
-
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- case 'postgres':
- $line .= "\tPRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n";
- break;
-
- case 'firebird':
- $line .= "ALTER TABLE {$table_name} ADD PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ");;\n\n";
- break;
-
- case 'sqlite':
- if ($generator === false || !in_array($generator, $table_data['PRIMARY_KEY']))
- {
- $line .= "\tPRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n";
- }
- break;
-
- case 'mssql':
- $line .= "ALTER TABLE [{$table_name}] WITH NOCHECK ADD \n";
- $line .= "\tCONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED \n";
- $line .= "\t(\n";
- $line .= "\t\t[" . implode("],\n\t\t[", $table_data['PRIMARY_KEY']) . "]\n";
- $line .= "\t)\n";
- $line .= "GO\n\n";
- break;
-
- case 'oracle':
- $line .= "\tCONSTRAINT pk_{$table_name} PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n";
- break;
- }
- }
-
- switch ($dbms)
- {
- case 'oracle':
- // UNIQUE contrains to be added?
- if (isset($table_data['KEYS']))
- {
- foreach ($table_data['KEYS'] as $key_name => $key_data)
- {
- if (!is_array($key_data[1]))
- {
- $key_data[1] = array($key_data[1]);
- }
-
- if ($key_data[0] == 'UNIQUE')
- {
- $line .= "\tCONSTRAINT u_phpbb_{$key_name} UNIQUE (" . implode(', ', $key_data[1]) . "),\n";
- }
- }
- }
-
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n)\n/\n\n";
- break;
-
- case 'postgres':
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n);\n\n";
- break;
-
- case 'sqlite':
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n);\n\n";
- break;
- }
-
- // Write Keys
- if (isset($table_data['KEYS']))
- {
- foreach ($table_data['KEYS'] as $key_name => $key_data)
- {
- if (!is_array($key_data[1]))
- {
- $key_data[1] = array($key_data[1]);
- }
-
- if (strlen($table_name . $key_name) > 30)
- {
- trigger_error("Index name '${table_name}_$key_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
- }
-
- switch ($dbms)
- {
- case 'mysql_40':
- case 'mysql_41':
- $line .= ($key_data[0] == 'INDEX') ? "\tKEY" : '';
- $line .= ($key_data[0] == 'UNIQUE') ? "\tUNIQUE" : '';
- foreach ($key_data[1] as $key => $col_name)
- {
- if (isset($modded_array[$col_name]))
- {
- switch ($modded_array[$col_name])
- {
- case 'text':
- case 'blob':
- $key_data[1][$key] = $col_name . '(255)';
- break;
- }
- }
- }
- $line .= ' ' . $key_name . ' (' . implode(', ', $key_data[1]) . "),\n";
- break;
-
- case 'firebird':
- $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
- $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
-
- $line .= ' ' . $table_name . '_' . $key_name . ' ON ' . $table_name . '(' . implode(', ', $key_data[1]) . ");;\n";
- break;
-
- case 'mssql':
- $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
- $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
- $line .= " [{$key_name}] ON [{$table_name}]([" . implode('], [', $key_data[1]) . "])\n";
- $line .= "GO\n\n";
- break;
-
- case 'oracle':
- if ($key_data[0] == 'UNIQUE')
- {
- continue;
- }
-
- $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
-
- $line .= " {$table_name}_{$key_name} ON {$table_name} (" . implode(', ', $key_data[1]) . ")\n";
- $line .= "/\n";
- break;
-
- case 'sqlite':
- $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
- $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
-
- $line .= " {$table_name}_{$key_name} ON {$table_name} (" . implode(', ', $key_data[1]) . ");\n";
- break;
-
- case 'postgres':
- $line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
- $line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
-
- $line .= " {$table_name}_{$key_name} ON {$table_name} (" . implode(', ', $key_data[1]) . ");\n";
- break;
- }
- }
- }
-
- switch ($dbms)
- {
- case 'mysql_40':
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n);\n\n";
- break;
-
- case 'mysql_41':
- // Remove last line delimiter...
- $line = substr($line, 0, -2);
- $line .= "\n) CHARACTER SET `utf8` COLLATE `utf8_bin`;\n\n";
- break;
-
- // Create Generator
- case 'firebird':
- if ($generator !== false)
- {
- $line .= "\nCREATE GENERATOR {$table_name}_gen;;\n";
- $line .= 'SET GENERATOR ' . $table_name . "_gen TO 0;;\n\n";
-
- $line .= 'CREATE TRIGGER t_' . $table_name . ' FOR ' . $table_name . "\n";
- $line .= "BEFORE INSERT\nAS\nBEGIN\n";
- $line .= "\tNEW.{$generator} = GEN_ID({$table_name}_gen, 1);\nEND;;\n\n";
- }
- break;
-
- case 'oracle':
- if ($generator !== false)
- {
- $line .= "\nCREATE SEQUENCE {$table_name}_seq\n/\n\n";
-
- $line .= "CREATE OR REPLACE TRIGGER t_{$table_name}\n";
- $line .= "BEFORE INSERT ON {$table_name}\n";
- $line .= "FOR EACH ROW WHEN (\n";
- $line .= "\tnew.{$generator} IS NULL OR new.{$generator} = 0\n";
- $line .= ")\nBEGIN\n";
- $line .= "\tSELECT {$table_name}_seq.nextval\n";
- $line .= "\tINTO :new.{$generator}\n";
- $line .= "\tFROM dual;\nEND;\n/\n\n";
- }
- break;
- }
-
- fwrite($fp, $line . "\n");
- }
-
- $line = '';
-
- // Write custom function at the end for some db's
- switch ($dbms)
- {
- case 'mssql':
- // No need to do this, no transaction support for schema changes
- //$line = "\nCOMMIT\nGO\n\n";
- break;
-
- case 'sqlite':
- $line = "\nCOMMIT;";
- break;
-
- case 'postgres':
- $line = "\nCOMMIT;";
- break;
- }
-
- fwrite($fp, $line);
- fclose($fp);
-}
+include($phpbb_root_path . 'includes/constants.' . $phpEx);
+require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+$phpbb_class_loader->register();
+$finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path);
+$classes = $finder->core_path('phpbb/')
+ ->directory('/db/migration/data')
+ ->get_classes();
-/**
-* Define the basic structure
-* The format:
-* array('{TABLE_NAME}' => {TABLE_DATA})
-* {TABLE_DATA}:
-* COLUMNS = array({column_name} = array({column_type}, {default}, {auto_increment}))
-* PRIMARY_KEY = {column_name(s)}
-* KEYS = array({key_name} = array({key_type}, {column_name(s)})),
-*
-* Column Types:
-* INT:x => SIGNED int(x)
-* BINT => BIGINT
-* UINT => mediumint(8) UNSIGNED
-* UINT:x => int(x) UNSIGNED
-* TINT:x => tinyint(x)
-* USINT => smallint(4) UNSIGNED (for _order columns)
-* BOOL => tinyint(1) UNSIGNED
-* VCHAR => varchar(255)
-* CHAR:x => char(x)
-* XSTEXT_UNI => text for storing 100 characters (topic_title for example)
-* STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI
-* TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.)
-* MTEXT_UNI => mediumtext (post text, large text)
-* VCHAR:x => varchar(x)
-* TIMESTAMP => int(11) UNSIGNED
-* DECIMAL => decimal number (5,2)
-* DECIMAL: => decimal number (x,2)
-* PDECIMAL => precision decimal number (6,3)
-* PDECIMAL: => precision decimal number (x,3)
-* VCHAR_UNI => varchar(255) BINARY
-* VCHAR_CI => varchar_ci for postgresql, others VCHAR
-*/
-function get_schema_struct()
-{
- $schema_data = array();
-
- $schema_data['phpbb_attachments'] = array(
- 'COLUMNS' => array(
- 'attach_id' => array('UINT', NULL, 'auto_increment'),
- 'post_msg_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'in_message' => array('BOOL', 0),
- 'poster_id' => array('UINT', 0),
- 'is_orphan' => array('BOOL', 1),
- 'physical_filename' => array('VCHAR', ''),
- 'real_filename' => array('VCHAR', ''),
- 'download_count' => array('UINT', 0),
- 'attach_comment' => array('TEXT_UNI', ''),
- 'extension' => array('VCHAR:100', ''),
- 'mimetype' => array('VCHAR:100', ''),
- 'filesize' => array('UINT:20', 0),
- 'filetime' => array('TIMESTAMP', 0),
- 'thumbnail' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'attach_id',
- 'KEYS' => array(
- 'filetime' => array('INDEX', 'filetime'),
- 'post_msg_id' => array('INDEX', 'post_msg_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'is_orphan' => array('INDEX', 'is_orphan'),
- ),
- );
-
- $schema_data['phpbb_acl_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'auth_opt_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_acl_options'] = array(
- 'COLUMNS' => array(
- 'auth_option_id' => array('UINT', NULL, 'auto_increment'),
- 'auth_option' => array('VCHAR:50', ''),
- 'is_global' => array('BOOL', 0),
- 'is_local' => array('BOOL', 0),
- 'founder_only' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'auth_option_id',
- 'KEYS' => array(
- 'auth_option' => array('UNIQUE', 'auth_option'),
- ),
- );
-
- $schema_data['phpbb_acl_roles'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', NULL, 'auto_increment'),
- 'role_name' => array('VCHAR_UNI', ''),
- 'role_description' => array('TEXT_UNI', ''),
- 'role_type' => array('VCHAR:10', ''),
- 'role_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'role_id',
- 'KEYS' => array(
- 'role_type' => array('INDEX', 'role_type'),
- 'role_order' => array('INDEX', 'role_order'),
- ),
- );
-
- $schema_data['phpbb_acl_roles_data'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'PRIMARY_KEY' => array('role_id', 'auth_option_id'),
- 'KEYS' => array(
- 'ath_op_id' => array('INDEX', 'auth_option_id'),
- ),
- );
-
- $schema_data['phpbb_acl_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- 'auth_option_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_banlist'] = array(
- 'COLUMNS' => array(
- 'ban_id' => array('UINT', NULL, 'auto_increment'),
- 'ban_userid' => array('UINT', 0),
- 'ban_ip' => array('VCHAR:40', ''),
- 'ban_email' => array('VCHAR_UNI:100', ''),
- 'ban_start' => array('TIMESTAMP', 0),
- 'ban_end' => array('TIMESTAMP', 0),
- 'ban_exclude' => array('BOOL', 0),
- 'ban_reason' => array('VCHAR_UNI', ''),
- 'ban_give_reason' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'ban_id',
- 'KEYS' => array(
- 'ban_end' => array('INDEX', 'ban_end'),
- 'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')),
- 'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')),
- 'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')),
- ),
- );
-
- $schema_data['phpbb_bbcodes'] = array(
- 'COLUMNS' => array(
- 'bbcode_id' => array('USINT', 0),
- 'bbcode_tag' => array('VCHAR:16', ''),
- 'bbcode_helpline' => array('VCHAR_UNI', ''),
- 'display_on_posting' => array('BOOL', 0),
- 'bbcode_match' => array('TEXT_UNI', ''),
- 'bbcode_tpl' => array('MTEXT_UNI', ''),
- 'first_pass_match' => array('MTEXT_UNI', ''),
- 'first_pass_replace' => array('MTEXT_UNI', ''),
- 'second_pass_match' => array('MTEXT_UNI', ''),
- 'second_pass_replace' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'bbcode_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_bookmarks'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('topic_id', 'user_id'),
- );
-
- $schema_data['phpbb_bots'] = array(
- 'COLUMNS' => array(
- 'bot_id' => array('UINT', NULL, 'auto_increment'),
- 'bot_active' => array('BOOL', 1),
- 'bot_name' => array('STEXT_UNI', ''),
- 'user_id' => array('UINT', 0),
- 'bot_agent' => array('VCHAR', ''),
- 'bot_ip' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'bot_id',
- 'KEYS' => array(
- 'bot_active' => array('INDEX', 'bot_active'),
- ),
- );
-
- $schema_data['phpbb_config'] = array(
- 'COLUMNS' => array(
- 'config_name' => array('VCHAR', ''),
- 'config_value' => array('VCHAR_UNI', ''),
- 'is_dynamic' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'config_name',
- 'KEYS' => array(
- 'is_dynamic' => array('INDEX', 'is_dynamic'),
- ),
- );
-
- $schema_data['phpbb_confirm'] = array(
- 'COLUMNS' => array(
- 'confirm_id' => array('CHAR:32', ''),
- 'session_id' => array('CHAR:32', ''),
- 'confirm_type' => array('TINT:3', 0),
- 'code' => array('VCHAR:8', ''),
- 'seed' => array('UINT:10', 0),
- 'attempts' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('session_id', 'confirm_id'),
- 'KEYS' => array(
- 'confirm_type' => array('INDEX', 'confirm_type'),
- ),
- );
-
- $schema_data['phpbb_disallow'] = array(
- 'COLUMNS' => array(
- 'disallow_id' => array('UINT', NULL, 'auto_increment'),
- 'disallow_username' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'disallow_id',
- );
-
- $schema_data['phpbb_drafts'] = array(
- 'COLUMNS' => array(
- 'draft_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'save_time' => array('TIMESTAMP', 0),
- 'draft_subject' => array('STEXT_UNI', ''),
- 'draft_message' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'draft_id',
- 'KEYS' => array(
- 'save_time' => array('INDEX', 'save_time'),
- ),
- );
-
- $schema_data['phpbb_extensions'] = array(
- 'COLUMNS' => array(
- 'extension_id' => array('UINT', NULL, 'auto_increment'),
- 'group_id' => array('UINT', 0),
- 'extension' => array('VCHAR:100', ''),
- ),
- 'PRIMARY_KEY' => 'extension_id',
- );
-
- $schema_data['phpbb_extension_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_name' => array('VCHAR_UNI', ''),
- 'cat_id' => array('TINT:2', 0),
- 'allow_group' => array('BOOL', 0),
- 'download_mode' => array('BOOL', 1),
- 'upload_icon' => array('VCHAR', ''),
- 'max_filesize' => array('UINT:20', 0),
- 'allowed_forums' => array('TEXT', ''),
- 'allow_in_pm' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'group_id',
- );
-
- $schema_data['phpbb_forums'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', NULL, 'auto_increment'),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'forum_parents' => array('MTEXT', ''),
- 'forum_name' => array('STEXT_UNI', ''),
- 'forum_desc' => array('TEXT_UNI', ''),
- 'forum_desc_bitfield' => array('VCHAR:255', ''),
- 'forum_desc_options' => array('UINT:11', 7),
- 'forum_desc_uid' => array('VCHAR:8', ''),
- 'forum_link' => array('VCHAR_UNI', ''),
- 'forum_password' => array('VCHAR_UNI:40', ''),
- 'forum_style' => array('UINT', 0),
- 'forum_image' => array('VCHAR', ''),
- 'forum_rules' => array('TEXT_UNI', ''),
- 'forum_rules_link' => array('VCHAR_UNI', ''),
- 'forum_rules_bitfield' => array('VCHAR:255', ''),
- 'forum_rules_options' => array('UINT:11', 7),
- 'forum_rules_uid' => array('VCHAR:8', ''),
- 'forum_topics_per_page' => array('TINT:4', 0),
- 'forum_type' => array('TINT:4', 0),
- 'forum_status' => array('TINT:4', 0),
- 'forum_posts' => array('UINT', 0),
- 'forum_topics' => array('UINT', 0),
- 'forum_topics_real' => array('UINT', 0),
- 'forum_last_post_id' => array('UINT', 0),
- 'forum_last_poster_id' => array('UINT', 0),
- 'forum_last_post_subject' => array('STEXT_UNI', ''),
- 'forum_last_post_time' => array('TIMESTAMP', 0),
- 'forum_last_poster_name'=> array('VCHAR_UNI', ''),
- 'forum_last_poster_colour'=> array('VCHAR:6', ''),
- 'forum_flags' => array('TINT:4', 32),
- 'forum_options' => array('UINT:20', 0),
- 'display_subforum_list' => array('BOOL', 1),
- 'display_on_index' => array('BOOL', 1),
- 'enable_indexing' => array('BOOL', 1),
- 'enable_icons' => array('BOOL', 1),
- 'enable_prune' => array('BOOL', 0),
- 'prune_next' => array('TIMESTAMP', 0),
- 'prune_days' => array('UINT', 0),
- 'prune_viewed' => array('UINT', 0),
- 'prune_freq' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'forum_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'forum_lastpost_id' => array('INDEX', 'forum_last_post_id'),
- ),
- );
-
- $schema_data['phpbb_forums_access'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'session_id' => array('CHAR:32', ''),
- ),
- 'PRIMARY_KEY' => array('forum_id', 'user_id', 'session_id'),
- );
-
- $schema_data['phpbb_forums_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'forum_id'),
- );
-
- $schema_data['phpbb_forums_watch'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_type' => array('TINT:4', 1),
- 'group_founder_manage' => array('BOOL', 0),
- 'group_skip_auth' => array('BOOL', 0),
- 'group_name' => array('VCHAR_CI', ''),
- 'group_desc' => array('TEXT_UNI', ''),
- 'group_desc_bitfield' => array('VCHAR:255', ''),
- 'group_desc_options' => array('UINT:11', 7),
- 'group_desc_uid' => array('VCHAR:8', ''),
- 'group_display' => array('BOOL', 0),
- 'group_avatar' => array('VCHAR', ''),
- 'group_avatar_type' => array('TINT:2', 0),
- 'group_avatar_width' => array('USINT', 0),
- 'group_avatar_height' => array('USINT', 0),
- 'group_rank' => array('UINT', 0),
- 'group_colour' => array('VCHAR:6', ''),
- 'group_sig_chars' => array('UINT', 0),
- 'group_receive_pm' => array('BOOL', 0),
- 'group_message_limit' => array('UINT', 0),
- 'group_max_recipients' => array('UINT', 0),
- 'group_legend' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'group_id',
- 'KEYS' => array(
- 'group_legend_name' => array('INDEX', array('group_legend', 'group_name')),
- ),
- );
-
- $schema_data['phpbb_icons'] = array(
- 'COLUMNS' => array(
- 'icons_id' => array('UINT', NULL, 'auto_increment'),
- 'icons_url' => array('VCHAR', ''),
- 'icons_width' => array('TINT:4', 0),
- 'icons_height' => array('TINT:4', 0),
- 'icons_order' => array('UINT', 0),
- 'display_on_posting' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'icons_id',
- 'KEYS' => array(
- 'display_on_posting' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_lang'] = array(
- 'COLUMNS' => array(
- 'lang_id' => array('TINT:4', NULL, 'auto_increment'),
- 'lang_iso' => array('VCHAR:30', ''),
- 'lang_dir' => array('VCHAR:30', ''),
- 'lang_english_name' => array('VCHAR_UNI:100', ''),
- 'lang_local_name' => array('VCHAR_UNI:255', ''),
- 'lang_author' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'lang_id',
- 'KEYS' => array(
- 'lang_iso' => array('INDEX', 'lang_iso'),
- ),
- );
-
- $schema_data['phpbb_log'] = array(
- 'COLUMNS' => array(
- 'log_id' => array('UINT', NULL, 'auto_increment'),
- 'log_type' => array('TINT:4', 0),
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'reportee_id' => array('UINT', 0),
- 'log_ip' => array('VCHAR:40', ''),
- 'log_time' => array('TIMESTAMP', 0),
- 'log_operation' => array('TEXT_UNI', ''),
- 'log_data' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'log_id',
- 'KEYS' => array(
- 'log_type' => array('INDEX', 'log_type'),
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'reportee_id' => array('INDEX', 'reportee_id'),
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_login_attempts'] = array(
- 'COLUMNS' => array(
- '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),
- ),
- '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'),
- ),
- );
-
- $schema_data['phpbb_moderator_cache'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'username' => array('VCHAR_UNI:255', ''),
- 'group_id' => array('UINT', 0),
- 'group_name' => array('VCHAR_UNI', ''),
- 'display_on_index' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'disp_idx' => array('INDEX', 'display_on_index'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_modules'] = array(
- 'COLUMNS' => array(
- 'module_id' => array('UINT', NULL, 'auto_increment'),
- 'module_enabled' => array('BOOL', 1),
- 'module_display' => array('BOOL', 1),
- 'module_basename' => array('VCHAR', ''),
- 'module_class' => array('VCHAR:10', ''),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'module_langname' => array('VCHAR', ''),
- 'module_mode' => array('VCHAR', ''),
- 'module_auth' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'module_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'module_enabled' => array('INDEX', 'module_enabled'),
- 'class_left_id' => array('INDEX', array('module_class', 'left_id')),
- ),
- );
-
- $schema_data['phpbb_poll_options'] = array(
- 'COLUMNS' => array(
- 'poll_option_id' => array('TINT:4', 0),
- 'topic_id' => array('UINT', 0),
- 'poll_option_text' => array('TEXT_UNI', ''),
- 'poll_option_total' => array('UINT', 0),
- ),
- 'KEYS' => array(
- 'poll_opt_id' => array('INDEX', 'poll_option_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- ),
- );
-
- $schema_data['phpbb_poll_votes'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'poll_option_id' => array('TINT:4', 0),
- 'vote_user_id' => array('UINT', 0),
- 'vote_user_ip' => array('VCHAR:40', ''),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'vote_user_id' => array('INDEX', 'vote_user_id'),
- 'vote_user_ip' => array('INDEX', 'vote_user_ip'),
- ),
- );
-
- $schema_data['phpbb_posts'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', NULL, 'auto_increment'),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'poster_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'poster_ip' => array('VCHAR:40', ''),
- 'post_time' => array('TIMESTAMP', 0),
- 'post_approved' => array('BOOL', 1),
- 'post_reported' => array('BOOL', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'post_username' => array('VCHAR_UNI:255', ''),
- 'post_subject' => array('STEXT_UNI', '', 'true_sort'),
- 'post_text' => array('MTEXT_UNI', ''),
- 'post_checksum' => array('VCHAR:32', ''),
- 'post_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'post_postcount' => array('BOOL', 1),
- 'post_edit_time' => array('TIMESTAMP', 0),
- 'post_edit_reason' => array('STEXT_UNI', ''),
- 'post_edit_user' => array('UINT', 0),
- 'post_edit_count' => array('USINT', 0),
- 'post_edit_locked' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'post_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_ip' => array('INDEX', 'poster_ip'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'post_approved' => array('INDEX', 'post_approved'),
- 'post_username' => array('INDEX', 'post_username'),
- 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
- ),
- );
-
- $schema_data['phpbb_privmsgs'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', NULL, 'auto_increment'),
- 'root_level' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'author_ip' => array('VCHAR:40', ''),
- 'message_time' => array('TIMESTAMP', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'message_subject' => array('STEXT_UNI', ''),
- 'message_text' => array('MTEXT_UNI', ''),
- 'message_edit_reason' => array('STEXT_UNI', ''),
- 'message_edit_user' => array('UINT', 0),
- 'message_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'message_edit_time' => array('TIMESTAMP', 0),
- 'message_edit_count' => array('USINT', 0),
- 'to_address' => array('TEXT_UNI', ''),
- 'bcc_address' => array('TEXT_UNI', ''),
- 'message_reported' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'msg_id',
- 'KEYS' => array(
- 'author_ip' => array('INDEX', 'author_ip'),
- 'message_time' => array('INDEX', 'message_time'),
- 'author_id' => array('INDEX', 'author_id'),
- 'root_level' => array('INDEX', 'root_level'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_folder'] = array(
- 'COLUMNS' => array(
- 'folder_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'folder_name' => array('VCHAR_UNI', ''),
- 'pm_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'folder_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_rules'] = array(
- 'COLUMNS' => array(
- 'rule_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'rule_check' => array('UINT', 0),
- 'rule_connection' => array('UINT', 0),
- 'rule_string' => array('VCHAR_UNI', ''),
- 'rule_user_id' => array('UINT', 0),
- 'rule_group_id' => array('UINT', 0),
- 'rule_action' => array('UINT', 0),
- 'rule_folder_id' => array('INT:11', 0),
- ),
- 'PRIMARY_KEY' => 'rule_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_to'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'pm_deleted' => array('BOOL', 0),
- 'pm_new' => array('BOOL', 1),
- 'pm_unread' => array('BOOL', 1),
- 'pm_replied' => array('BOOL', 0),
- 'pm_marked' => array('BOOL', 0),
- 'pm_forwarded' => array('BOOL', 0),
- 'folder_id' => array('INT:11', 0),
- ),
- 'KEYS' => array(
- 'msg_id' => array('INDEX', 'msg_id'),
- 'author_id' => array('INDEX', 'author_id'),
- 'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')),
- ),
- );
-
- $schema_data['phpbb_profile_fields'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', NULL, 'auto_increment'),
- 'field_name' => array('VCHAR_UNI', ''),
- 'field_type' => array('TINT:4', 0),
- 'field_ident' => array('VCHAR:20', ''),
- 'field_length' => array('VCHAR:20', ''),
- 'field_minlen' => array('VCHAR', ''),
- 'field_maxlen' => array('VCHAR', ''),
- 'field_novalue' => array('VCHAR_UNI', ''),
- 'field_default_value' => array('VCHAR_UNI', ''),
- 'field_validation' => array('VCHAR_UNI:20', ''),
- 'field_required' => array('BOOL', 0),
- 'field_show_novalue' => array('BOOL', 0),
- 'field_show_on_reg' => array('BOOL', 0),
- 'field_show_on_vt' => array('BOOL', 0),
- 'field_show_profile' => array('BOOL', 0),
- 'field_hide' => array('BOOL', 0),
- 'field_no_view' => array('BOOL', 0),
- 'field_active' => array('BOOL', 0),
- 'field_order' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'field_id',
- 'KEYS' => array(
- 'fld_type' => array('INDEX', 'field_type'),
- 'fld_ordr' => array('INDEX', 'field_order'),
- ),
- );
-
- $schema_data['phpbb_profile_fields_data'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- );
-
- $schema_data['phpbb_profile_fields_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'option_id' => array('UINT', 0),
- 'field_type' => array('TINT:4', 0),
- 'lang_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'),
- );
-
- $schema_data['phpbb_profile_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'lang_name' => array('VCHAR_UNI', ''),
- 'lang_explain' => array('TEXT_UNI', ''),
- 'lang_default_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id'),
- );
-
- $schema_data['phpbb_ranks'] = array(
- 'COLUMNS' => array(
- 'rank_id' => array('UINT', NULL, 'auto_increment'),
- 'rank_title' => array('VCHAR_UNI', ''),
- 'rank_min' => array('UINT', 0),
- 'rank_special' => array('BOOL', 0),
- 'rank_image' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'rank_id',
- );
-
- $schema_data['phpbb_reports'] = array(
- 'COLUMNS' => array(
- 'report_id' => array('UINT', NULL, 'auto_increment'),
- 'reason_id' => array('USINT', 0),
- 'post_id' => array('UINT', 0),
- 'pm_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'user_notify' => array('BOOL', 0),
- 'report_closed' => array('BOOL', 0),
- 'report_time' => array('TIMESTAMP', 0),
- 'report_text' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'report_id',
- 'KEYS' => array(
- 'post_id' => array('INDEX', 'post_id'),
- 'pm_id' => array('INDEX', 'pm_id'),
- ),
- );
-
- $schema_data['phpbb_reports_reasons'] = array(
- 'COLUMNS' => array(
- 'reason_id' => array('USINT', NULL, 'auto_increment'),
- 'reason_title' => array('VCHAR_UNI', ''),
- 'reason_description' => array('MTEXT_UNI', ''),
- 'reason_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'reason_id',
- );
-
- $schema_data['phpbb_search_results'] = array(
- 'COLUMNS' => array(
- 'search_key' => array('VCHAR:32', ''),
- 'search_time' => array('TIMESTAMP', 0),
- 'search_keywords' => array('MTEXT_UNI', ''),
- 'search_authors' => array('MTEXT', ''),
- ),
- 'PRIMARY_KEY' => 'search_key',
- );
-
- $schema_data['phpbb_search_wordlist'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word_text' => array('VCHAR_UNI', ''),
- 'word_common' => array('BOOL', 0),
- 'word_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'word_id',
- 'KEYS' => array(
- 'wrd_txt' => array('UNIQUE', 'word_text'),
- 'wrd_cnt' => array('INDEX', 'word_count'),
- ),
- );
-
- $schema_data['phpbb_search_wordmatch'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', 0),
- 'word_id' => array('UINT', 0),
- 'title_match' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')),
- 'word_id' => array('INDEX', 'word_id'),
- 'post_id' => array('INDEX', 'post_id'),
- ),
- );
-
- $schema_data['phpbb_sessions'] = array(
- 'COLUMNS' => array(
- 'session_id' => array('CHAR:32', ''),
- 'session_user_id' => array('UINT', 0),
- 'session_forum_id' => array('UINT', 0),
- 'session_last_visit' => array('TIMESTAMP', 0),
- 'session_start' => array('TIMESTAMP', 0),
- 'session_time' => array('TIMESTAMP', 0),
- 'session_ip' => array('VCHAR:40', ''),
- 'session_browser' => array('VCHAR:150', ''),
- 'session_forwarded_for' => array('VCHAR:255', ''),
- 'session_page' => array('VCHAR_UNI', ''),
- 'session_viewonline' => array('BOOL', 1),
- 'session_autologin' => array('BOOL', 0),
- 'session_admin' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'session_id',
- 'KEYS' => array(
- 'session_time' => array('INDEX', 'session_time'),
- 'session_user_id' => array('INDEX', 'session_user_id'),
- 'session_fid' => array('INDEX', 'session_forum_id'),
- ),
- );
-
- $schema_data['phpbb_sessions_keys'] = array(
- 'COLUMNS' => array(
- 'key_id' => array('CHAR:32', ''),
- 'user_id' => array('UINT', 0),
- 'last_ip' => array('VCHAR:40', ''),
- 'last_login' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('key_id', 'user_id'),
- 'KEYS' => array(
- 'last_login' => array('INDEX', 'last_login'),
- ),
- );
-
- $schema_data['phpbb_sitelist'] = array(
- 'COLUMNS' => array(
- 'site_id' => array('UINT', NULL, 'auto_increment'),
- 'site_ip' => array('VCHAR:40', ''),
- 'site_hostname' => array('VCHAR', ''),
- 'ip_exclude' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'site_id',
- );
-
- $schema_data['phpbb_smilies'] = array(
- 'COLUMNS' => array(
- 'smiley_id' => array('UINT', NULL, 'auto_increment'),
- // We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed.
- 'code' => array('VCHAR_UNI:50', ''),
- 'emotion' => array('VCHAR_UNI:50', ''),
- 'smiley_url' => array('VCHAR:50', ''),
- 'smiley_width' => array('USINT', 0),
- 'smiley_height' => array('USINT', 0),
- 'smiley_order' => array('UINT', 0),
- 'display_on_posting'=> array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'smiley_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_styles'] = array(
- 'COLUMNS' => array(
- 'style_id' => array('UINT', NULL, 'auto_increment'),
- 'style_name' => array('VCHAR_UNI:255', ''),
- 'style_copyright' => array('VCHAR_UNI', ''),
- 'style_active' => array('BOOL', 1),
- 'template_id' => array('UINT', 0),
- 'theme_id' => array('UINT', 0),
- 'imageset_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'style_id',
- 'KEYS' => array(
- 'style_name' => array('UNIQUE', 'style_name'),
- 'template_id' => array('INDEX', 'template_id'),
- 'theme_id' => array('INDEX', 'theme_id'),
- 'imageset_id' => array('INDEX', 'imageset_id'),
- ),
- );
-
- $schema_data['phpbb_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'),
- ),
- );
-
- $schema_data['phpbb_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'),
- ),
- );
-
- $schema_data['phpbb_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'),
- ),
- );
-
- $schema_data['phpbb_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'),
- ),
- );
-
- $schema_data['phpbb_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'),
- ),
- );
-
- $schema_data['phpbb_topics'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', NULL, 'auto_increment'),
- 'forum_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'topic_attachment' => array('BOOL', 0),
- 'topic_approved' => array('BOOL', 1),
- 'topic_reported' => array('BOOL', 0),
- 'topic_title' => array('STEXT_UNI', '', 'true_sort'),
- 'topic_poster' => array('UINT', 0),
- 'topic_time' => array('TIMESTAMP', 0),
- 'topic_time_limit' => array('TIMESTAMP', 0),
- 'topic_views' => array('UINT', 0),
- 'topic_replies' => array('UINT', 0),
- 'topic_replies_real' => array('UINT', 0),
- 'topic_status' => array('TINT:3', 0),
- 'topic_type' => array('TINT:3', 0),
- 'topic_first_post_id' => array('UINT', 0),
- 'topic_first_poster_name' => array('VCHAR_UNI', ''),
- 'topic_first_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_id' => array('UINT', 0),
- 'topic_last_poster_id' => array('UINT', 0),
- 'topic_last_poster_name' => array('VCHAR_UNI', ''),
- 'topic_last_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_subject' => array('STEXT_UNI', ''),
- 'topic_last_post_time' => array('TIMESTAMP', 0),
- 'topic_last_view_time' => array('TIMESTAMP', 0),
- 'topic_moved_id' => array('UINT', 0),
- 'topic_bumped' => array('BOOL', 0),
- 'topic_bumper' => array('UINT', 0),
- 'poll_title' => array('STEXT_UNI', ''),
- 'poll_start' => array('TIMESTAMP', 0),
- 'poll_length' => array('TIMESTAMP', 0),
- 'poll_max_options' => array('TINT:4', 1),
- 'poll_last_vote' => array('TIMESTAMP', 0),
- 'poll_vote_change' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'topic_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
- 'last_post_time' => array('INDEX', 'topic_last_post_time'),
- 'topic_approved' => array('INDEX', 'topic_approved'),
- 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_approved', 'topic_last_post_id')),
- 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
- ),
- );
-
- $schema_data['phpbb_topics_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_topics_posted'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'topic_posted' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- );
-
- $schema_data['phpbb_topics_watch'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_user_group'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'group_leader' => array('BOOL', 0),
- 'user_pending' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'group_leader' => array('INDEX', 'group_leader'),
- ),
- );
-
- $schema_data['phpbb_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', NULL, 'auto_increment'),
- 'user_type' => array('TINT:2', 0),
- 'group_id' => array('UINT', 3),
- 'user_permissions' => array('MTEXT', ''),
- 'user_perm_from' => array('UINT', 0),
- 'user_ip' => array('VCHAR:40', ''),
- 'user_regdate' => array('TIMESTAMP', 0),
- 'username' => array('VCHAR_CI', ''),
- 'username_clean' => array('VCHAR_CI', ''),
- 'user_password' => array('VCHAR_UNI:40', ''),
- 'user_passchg' => array('TIMESTAMP', 0),
- 'user_pass_convert' => array('BOOL', 0),
- 'user_email' => array('VCHAR_UNI:100', ''),
- 'user_email_hash' => array('BINT', 0),
- 'user_birthday' => array('VCHAR:10', ''),
- 'user_lastvisit' => array('TIMESTAMP', 0),
- 'user_lastmark' => array('TIMESTAMP', 0),
- 'user_lastpost_time' => array('TIMESTAMP', 0),
- 'user_lastpage' => array('VCHAR_UNI:200', ''),
- 'user_last_confirm_key' => array('VCHAR:10', ''),
- 'user_last_search' => array('TIMESTAMP', 0),
- 'user_warnings' => array('TINT:4', 0),
- 'user_last_warning' => array('TIMESTAMP', 0),
- 'user_login_attempts' => array('TINT:4', 0),
- 'user_inactive_reason' => array('TINT:2', 0),
- 'user_inactive_time' => array('TIMESTAMP', 0),
- 'user_posts' => array('UINT', 0),
- 'user_lang' => array('VCHAR:30', ''),
- 'user_timezone' => array('DECIMAL', 0),
- 'user_dst' => array('BOOL', 0),
- 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
- 'user_style' => array('UINT', 0),
- 'user_rank' => array('UINT', 0),
- 'user_colour' => array('VCHAR:6', ''),
- 'user_new_privmsg' => array('INT:4', 0),
- 'user_unread_privmsg' => array('INT:4', 0),
- 'user_last_privmsg' => array('TIMESTAMP', 0),
- 'user_message_rules' => array('BOOL', 0),
- 'user_full_folder' => array('INT:11', -3),
- 'user_emailtime' => array('TIMESTAMP', 0),
- 'user_topic_show_days' => array('USINT', 0),
- 'user_topic_sortby_type' => array('VCHAR:1', 't'),
- 'user_topic_sortby_dir' => array('VCHAR:1', 'd'),
- 'user_post_show_days' => array('USINT', 0),
- 'user_post_sortby_type' => array('VCHAR:1', 't'),
- 'user_post_sortby_dir' => array('VCHAR:1', 'a'),
- 'user_notify' => array('BOOL', 0),
- 'user_notify_pm' => array('BOOL', 1),
- 'user_notify_type' => array('TINT:4', 0),
- 'user_allow_pm' => array('BOOL', 1),
- 'user_allow_viewonline' => array('BOOL', 1),
- 'user_allow_viewemail' => array('BOOL', 1),
- 'user_allow_massemail' => array('BOOL', 1),
- 'user_options' => array('UINT:11', 230271),
- 'user_avatar' => array('VCHAR', ''),
- 'user_avatar_type' => array('TINT:2', 0),
- 'user_avatar_width' => array('USINT', 0),
- 'user_avatar_height' => array('USINT', 0),
- 'user_sig' => array('MTEXT_UNI', ''),
- 'user_sig_bbcode_uid' => array('VCHAR:8', ''),
- 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''),
- 'user_from' => array('VCHAR_UNI:100', ''),
- 'user_icq' => array('VCHAR:15', ''),
- 'user_aim' => array('VCHAR_UNI', ''),
- 'user_yim' => array('VCHAR_UNI', ''),
- 'user_msnm' => array('VCHAR_UNI', ''),
- 'user_jabber' => array('VCHAR_UNI', ''),
- 'user_website' => array('VCHAR_UNI:200', ''),
- 'user_occ' => array('TEXT_UNI', ''),
- 'user_interests' => array('TEXT_UNI', ''),
- 'user_actkey' => array('VCHAR:32', ''),
- 'user_newpasswd' => array('VCHAR_UNI:40', ''),
- 'user_form_salt' => array('VCHAR_UNI:32', ''),
- 'user_new' => array('BOOL', 1),
- 'user_reminded' => array('TINT:4', 0),
- 'user_reminded_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- 'KEYS' => array(
- 'user_birthday' => array('INDEX', 'user_birthday'),
- 'user_email_hash' => array('INDEX', 'user_email_hash'),
- 'user_type' => array('INDEX', 'user_type'),
- 'username_clean' => array('UNIQUE', 'username_clean'),
- ),
- );
-
- $schema_data['phpbb_warnings'] = array(
- 'COLUMNS' => array(
- 'warning_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'post_id' => array('UINT', 0),
- 'log_id' => array('UINT', 0),
- 'warning_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'warning_id',
- );
-
- $schema_data['phpbb_words'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word' => array('VCHAR_UNI', ''),
- 'replacement' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'word_id',
- );
-
- $schema_data['phpbb_zebra'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'zebra_id' => array('UINT', 0),
- 'friend' => array('BOOL', 0),
- 'foe' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'zebra_id'),
- );
-
- return $schema_data;
-}
-
-
-/**
-* Data put into the header for various dbms
-*/
-function custom_data($dbms)
-{
- switch ($dbms)
- {
- case 'oracle':
- return <<<EOF
-/*
- This first section is optional, however its probably the best method
- of running phpBB on Oracle. If you already have a tablespace and user created
- for phpBB you can leave this section commented out!
-
- The first set of statements create a phpBB tablespace and a phpBB user,
- make sure you change the password of the phpBB user before you run this script!!
-*/
-
-/*
-CREATE TABLESPACE "PHPBB"
- LOGGING
- DATAFILE 'E:\ORACLE\ORADATA\LOCAL\PHPBB.ora'
- SIZE 10M
- AUTOEXTEND ON NEXT 10M
- MAXSIZE 100M;
-
-CREATE USER "PHPBB"
- PROFILE "DEFAULT"
- IDENTIFIED BY "phpbb_password"
- DEFAULT TABLESPACE "PHPBB"
- QUOTA UNLIMITED ON "PHPBB"
- ACCOUNT UNLOCK;
-
-GRANT ANALYZE ANY TO "PHPBB";
-GRANT CREATE SEQUENCE TO "PHPBB";
-GRANT CREATE SESSION TO "PHPBB";
-GRANT CREATE TABLE TO "PHPBB";
-GRANT CREATE TRIGGER TO "PHPBB";
-GRANT CREATE VIEW TO "PHPBB";
-GRANT "CONNECT" TO "PHPBB";
-
-COMMIT;
-DISCONNECT;
-
-CONNECT phpbb/phpbb_password;
-*/
-EOF;
-
- break;
-
- case 'postgres':
- return <<<EOF
-/*
- Domain definition
-*/
-CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying;
-
-/*
- Operation Functions
-*/
-CREATE FUNCTION _varchar_ci_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) = LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_not_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) != LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_less_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) < LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_less_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) <= LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_greater_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) > LOWER($2)' LANGUAGE SQL STRICT;
-CREATE FUNCTION _varchar_ci_greater_equals(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) >= LOWER($2)' LANGUAGE SQL STRICT;
-
-/*
- Operators
-*/
-CREATE OPERATOR <(
- PROCEDURE = _varchar_ci_less_than,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = >,
- NEGATOR = >=,
- RESTRICT = scalarltsel,
- JOIN = scalarltjoinsel);
-
-CREATE OPERATOR <=(
- PROCEDURE = _varchar_ci_less_equal,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = >=,
- NEGATOR = >,
- RESTRICT = scalarltsel,
- JOIN = scalarltjoinsel);
-
-CREATE OPERATOR >(
- PROCEDURE = _varchar_ci_greater_than,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = <,
- NEGATOR = <=,
- RESTRICT = scalargtsel,
- JOIN = scalargtjoinsel);
-
-CREATE OPERATOR >=(
- PROCEDURE = _varchar_ci_greater_equals,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = <=,
- NEGATOR = <,
- RESTRICT = scalargtsel,
- JOIN = scalargtjoinsel);
-
-CREATE OPERATOR <>(
- PROCEDURE = _varchar_ci_not_equal,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = <>,
- NEGATOR = =,
- RESTRICT = neqsel,
- JOIN = neqjoinsel);
-
-CREATE OPERATOR =(
- PROCEDURE = _varchar_ci_equal,
- LEFTARG = varchar_ci,
- RIGHTARG = varchar_ci,
- COMMUTATOR = =,
- NEGATOR = <>,
- RESTRICT = eqsel,
- JOIN = eqjoinsel,
- HASHES,
- MERGES,
- SORT1= <);
-
-EOF;
- break;
- }
-
- return '';
-}
+$db = new \phpbb\db\driver\sqlite();
+$schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
+$schema_data = $schema_generator->get_schema();
-echo 'done';
+$fp = fopen($schema_path . 'schema.json', 'wb');
+fwrite($fp, json_encode($schema_data, JSON_PRETTY_PRINT));
+fclose($fp);
+echo 'Successfully created schema file';
diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php
index c1a7125d61..9b79a35a84 100644
--- a/phpBB/develop/create_search_index.php
+++ b/phpBB/develop/create_search_index.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2011 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -25,7 +29,6 @@ $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);
require($phpbb_root_path . 'includes/acp/acp_search.' . $phpEx);
-require($phpbb_root_path . 'includes/search/' . $class_name . '.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
diff --git a/phpBB/develop/create_variable_overview.php b/phpBB/develop/create_variable_overview.php
index f926d79eb5..ace2e4d953 100644
--- a/phpBB/develop/create_variable_overview.php
+++ b/phpBB/develop/create_variable_overview.php
@@ -1,13 +1,19 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2003 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
* This script generates an index of some template vars and their use within the templates.
* It writes down all language variables used by various templates.
-*
*/
//
@@ -38,7 +44,7 @@ fwrite($fp, $contents);
fclose($fp);
$html_skeleton = '
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="subSilver.css" type="text/css">
@@ -77,7 +83,7 @@ $html_skeleton .= '<br><br><a name="ref"></a><b>References: </b>{SEE_FILES}';
$html_skeleton .= '
<br><br>
-<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group</div>
+<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited</div>
<br clear="all" /></td>
</tr>
@@ -356,7 +362,7 @@ echo '<br>Store Files';
$fp = fopen($store_dir . 'index.html', 'w');
$html_data = '
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="subSilver.css" type="text/css">
@@ -399,7 +405,7 @@ $html_data .= '<br><li><a href="./lang_index.html" class="gen">Appendix A: Langu
$html_data .= '
</ol><br><br>
-<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group</div>
+<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited</div>
<br clear="all" /></td>
</tr>
@@ -421,7 +427,7 @@ fwrite($common_fp, "<?php\n\n \$lang = array(\n");
$fp = fopen($store_dir . 'lang_index.html', 'w');
$html_data = '
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="subSilver.css" type="text/css">
@@ -522,7 +528,7 @@ foreach ($lang_fp as $filepointer)
$html_data .= '
<br><br>
-<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group</div>
+<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited</div>
<br clear="all" /></td>
</tr>
@@ -537,5 +543,3 @@ fclose($fp);
echo '<br>Finished!';
flush();
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/export_events_for_wiki.php b/phpBB/develop/export_events_for_wiki.php
new file mode 100644
index 0000000000..be16e5e7cd
--- /dev/null
+++ b/phpBB/develop/export_events_for_wiki.php
@@ -0,0 +1,138 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+if (php_sapi_name() != 'cli')
+{
+ die("This program must be run from the command line.\n");
+}
+
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+$phpbb_root_path = __DIR__ . '/../';
+define('IN_PHPBB', true);
+
+function usage()
+{
+ echo "Usage: export_events_for_wiki.php COMMAND [VERSION] [EXTENSION]\n";
+ echo "\n";
+ echo "COMMAND:\n";
+ echo " all:\n";
+ echo " Generate the complete wikipage for https://wiki.phpbb.com/Event_List\n";
+ echo "\n";
+ echo " diff:\n";
+ echo " Generate the Event Diff for the release highlights\n";
+ echo "\n";
+ echo " php:\n";
+ echo " Generate the PHP event section of Event_List\n";
+ echo "\n";
+ echo " adm:\n";
+ echo " Generate the ACP Template event section of Event_List\n";
+ echo "\n";
+ echo " styles:\n";
+ echo " Generate the Styles Template event section of Event_List\n";
+ echo "\n";
+ echo "VERSION (diff only):\n";
+ echo " Filter events (minimum version)\n";
+ echo "\n";
+ echo "EXTENSION (Optional):\n";
+ echo " If not given, only core events will be exported.\n";
+ echo " Otherwise only events from the extension will be exported.\n";
+ echo "\n";
+ exit(2);
+}
+
+function validate_argument_count($arguments, $count)
+{
+ if ($arguments <= $count)
+ {
+ usage();
+ }
+}
+
+validate_argument_count($argc, 1);
+
+$action = $argv[1];
+$extension = isset($argv[2]) ? $argv[2] : null;
+$min_version = null;
+require __DIR__ . '/../phpbb/event/php_exporter.' . $phpEx;
+require __DIR__ . '/../phpbb/event/md_exporter.' . $phpEx;
+require __DIR__ . '/../includes/functions.' . $phpEx;
+require __DIR__ . '/../phpbb/event/recursive_event_filter_iterator.' . $phpEx;
+require __DIR__ . '/../phpbb/recursive_dot_prefix_filter_iterator.' . $phpEx;
+
+switch ($action)
+{
+
+ case 'diff':
+ echo '== Event changes ==' . "\n";
+ $min_version = $extension;
+ $extension = isset($argv[3]) ? $argv[3] : null;
+
+ case 'all':
+ if ($action === 'all')
+ {
+ echo '__FORCETOC__' . "\n";
+ }
+
+
+ case 'php':
+ $exporter = new \phpbb\event\php_exporter($phpbb_root_path, $extension, $min_version);
+ $exporter->crawl_phpbb_directory_php();
+ echo $exporter->export_events_for_wiki($action);
+
+ if ($action === 'php')
+ {
+ break;
+ }
+ echo "\n";
+ // no break;
+
+ case 'styles':
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension, $min_version);
+ if ($min_version && $action === 'diff')
+ {
+ $exporter->crawl_eventsmd('docs/events.md', 'styles');
+ }
+ else
+ {
+ $exporter->crawl_phpbb_directory_styles('docs/events.md');
+ }
+ echo $exporter->export_events_for_wiki($action);
+
+ if ($action === 'styles')
+ {
+ break;
+ }
+ echo "\n";
+ // no break;
+
+ case 'adm':
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension, $min_version);
+ if ($min_version && $action === 'diff')
+ {
+ $exporter->crawl_eventsmd('docs/events.md', 'adm');
+ }
+ else
+ {
+ $exporter->crawl_phpbb_directory_adm('docs/events.md');
+ }
+ echo $exporter->export_events_for_wiki($action);
+
+ if ($action === 'all')
+ {
+ echo "\n" . '[[Category:Events and Listeners]]' . "\n";
+ }
+ break;
+
+ default:
+ usage();
+}
diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php
index e0d054d073..6d08e9c206 100644
--- a/phpBB/develop/fill.php
+++ b/phpBB/develop/fill.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2001, 2003 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -38,8 +42,8 @@ $posts_per_topic = 500;
// general vars
-$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : 'generate';
-$start = (isset($_REQUEST['start'])) ? intval($_REQUEST['start']) : 0;
+$mode = request_var('mode', 'generate');
+$start = request_var('start', 0);
switch ($mode)
{
@@ -86,7 +90,7 @@ switch ($mode)
$topic_rows[] = "($topic_id, $forum_id, '$forum_id-$topic_id', " . (($topic_id % 34) ? '0' : '1') . ')';
- $sql = 'INSERT IGNORE INTO ' . POSTS_TABLE . ' (topic_id, forum_id, poster_id, post_subject, post_text, post_username, post_approved, post_time, post_reported)
+ $sql = 'INSERT IGNORE INTO ' . POSTS_TABLE . ' (topic_id, forum_id, poster_id, post_subject, post_text, post_username, post_visibility, post_time, post_reported)
VALUES ';
$rows = array();
@@ -183,5 +187,3 @@ function rndm_username()
return $usernames[array_rand($usernames)];
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/generate_utf_casefold.php b/phpBB/develop/generate_utf_casefold.php
index 08f67c3eb6..3412ddd106 100644
--- a/phpBB/develop/generate_utf_casefold.php
+++ b/phpBB/develop/generate_utf_casefold.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -151,5 +155,3 @@ function download($url)
echo "\n";
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/generate_utf_confusables.php b/phpBB/develop/generate_utf_confusables.php
index fd0439a4bb..9c9109259b 100644
--- a/phpBB/develop/generate_utf_confusables.php
+++ b/phpBB/develop/generate_utf_confusables.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -239,5 +243,3 @@ function download($url)
echo "\n";
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php
index 6372270b78..16a449679b 100644
--- a/phpBB/develop/generate_utf_tables.php
+++ b/phpBB/develop/generate_utf_tables.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -568,4 +572,4 @@ function cp_to_utf($cp)
{
return chr($cp);
}
-} \ No newline at end of file
+}
diff --git a/phpBB/develop/imageset_to_css.php b/phpBB/develop/imageset_to_css.php
new file mode 100644
index 0000000000..d49fe9c741
--- /dev/null
+++ b/phpBB/develop/imageset_to_css.php
@@ -0,0 +1,374 @@
+<?php
+
+/*
+ Converts imageset to CSS code
+
+ Change style name and path below, open in browser.
+*/
+
+$phpbb_root_path = '../';
+$style = 'subsilver2';
+
+$imageset_path = $phpbb_root_path . 'styles/' . $style . '/imageset';
+$theme_path = $phpbb_root_path . 'styles/' . $style . '/theme';
+
+// Start output buffering
+ob_start();
+
+// Get global and English images
+$images_global = get_imageset($imageset_path);
+if ($images_global === false)
+{
+ echo 'imageset.cfg was not found.';
+ echo ob_get_clean();
+ return;
+}
+$images_en = get_imageset($imageset_path, 'en');
+if ($images_en === false)
+{
+ echo 'English imageset.cfg was not found.';
+ echo ob_get_clean();
+ return;
+}
+
+// Remove duplicate images
+foreach ($images_en as $key => $row)
+{
+ unset($images_global[$key]);
+}
+
+// CSS replacements
+$not_compatible = array(
+ '{T_TEMPLATE_PATH}',
+ '{T_IMAGESET_PATH}',
+ '{T_IMAGESET_LANG_PATH}',
+ '{T_STYLESHEET_NAME}',
+ '{S_USER_LANG}'
+);
+$replace = array(
+ '{T_THEME_PATH}' => '.',
+);
+// Enable/disable one of lines below to enable/disable replacement of English buttons
+// $replace = array_merge($replace, get_replacements($images_global));
+$replace = array_merge($replace, get_replacements($images_global), get_replacements($images_en));
+
+// BIDI code
+$bidi_code = css($images_global, './images/', true);
+
+// Get all CSS files, parse them
+$files = list_files($theme_path, 'css');
+if ($files === false || !count($files))
+{
+ echo 'No CSS files found in theme directory.<br />';
+}
+else for ($i=0; $i<count($files); $i++)
+{
+ $file = $theme_path . '/' . $files[$i];
+ $data = file_get_contents($file);
+ $hash = md5($data);
+ $data = strtr($data, $replace);
+ $errors = false;
+ for($j=0; $j<count($not_compatible); $j++)
+ {
+ if (strpos($data, $not_compatible[$j]) !== false)
+ {
+ echo 'Error: ', $file, ' contains ', $not_compatible[$j], '. That variable cannot be converted.<br />';
+ continue;
+ }
+ }
+ if (basename($file) == 'bidi.css' && strpos($data, '/* Former imageset */') === false && strlen($bidi_code))
+ {
+ // Add bidi data
+ $data .= "\n/* Former imageset */\n" . $bidi_code;
+ $bidi_code = '';
+ echo 'Note: RTL imageset entries were added at the end of file below:<br />';
+ }
+ if (md5($data) == $hash)
+ {
+ echo 'Nothing to replace in ', $file, '<br />';
+ }
+ else
+ {
+ echo 'Updated ', $file, ':', dump_code($data, $files[$i]);
+ }
+}
+
+// Check if there are invalid images in imageset
+$list = array_merge($images_global, $images_en);
+foreach ($list as $key => $row)
+{
+ if ($row['skip'])
+ {
+ echo 'Unable to generate code to add to CSS files because some images are missing or invalid. See errors above.';
+ echo ob_get_clean();
+ return;
+ }
+}
+
+// Code to add to CSS files
+$code = '
+/* Former imageset */
+span.imageset {
+ display: inline-block;
+ background: transparent none 0 0 no-repeat;
+ margin: 0;
+ padding: 0;
+ width: 0;
+ height: 0;
+ overflow: hidden;
+}
+
+/* Global imageset items */
+' . css($images_global, './images/') . '
+
+/* English images for fallback */
+' . css($images_en, './en/');
+if (strlen($bidi_code))
+{
+ $code .= "\n/* RTL imageset entries */\n" . $bidi_code;
+}
+echo 'Code to add to CSS file:', dump_code($code, 'imageset.css');
+
+
+$list = list_languages($imageset_path);
+for ($i=0; $i<count($list); $i++)
+{
+ $lang = $list[$i];
+ $images = get_imageset($imageset_path . '/' . $lang);
+ if (!count($images))
+ {
+ continue;
+ }
+ $code = '/* ' . strtoupper($lang) . ' Language Pack */
+' . css($images, './');
+ echo 'New CSS file: ', $theme_path, '/', $lang, '/stylesheet.css', dump_code($code, 'stylesheet_' . $lang . '.css');
+}
+
+echo ob_get_clean();
+return;
+
+
+/*
+ Functions
+*/
+function get_imageset($path, $lang = '')
+{
+ $cfg = $path . ($lang ? '/' . $lang : '') . '/imageset.cfg';
+ if (!@file_exists($cfg))
+ {
+ return false;
+ }
+ $data = file($cfg);
+ $result = array();
+ for ($i=0; $i<count($data); $i++)
+ {
+ $str = trim($data[$i]);
+ if (substr($str, 0, 4) != 'img_')
+ {
+ continue;
+ }
+ $list = explode('=', $data[$i]);
+ if (count($list) != 2)
+ {
+ continue;
+ }
+ $key = trim($list[0]);
+ $row = explode('*', trim($list[1]));
+ $file = trim($row[0]);
+ $height = isset($row[1]) && intval($row[1]) ? intval($row[1]) : false;
+ $width = isset($row[2]) && intval($row[2]) ? intval($row[2]) : false;
+ $skip = false;
+ if (strlen($file) && (!$width || !$height))
+ {
+ // Try to detect width/height
+ $filename = $path . ($lang ? '/' . $lang : '') . '/' . $file;
+ if (!@file_exists($filename))
+ {
+ echo 'Error: file ', $filename, ' does not exist and its dimensions are not available in imageset.cfg<br />';
+ $skip = true;
+ }
+ else
+ {
+ $size = @getimagesize($filename);
+ if ($size === false)
+ {
+ echo 'Error: file ', $filename, ' is not a valid image<br />';
+ $skip = true;
+ }
+ else
+ {
+ if(!$width) $width = intval($size[0]);
+ if(!$height) $height = intval($size[1]);
+ }
+ }
+ }
+ $result[$key] = array(
+ 'lang' => $lang,
+ 'file' => $file,
+ 'height' => $height,
+ 'width' => $width,
+ 'skip' => $skip
+ );
+ }
+ return $result;
+}
+
+function get_replacements($list)
+{
+ $result = array();
+ foreach ($list as $key => $row)
+ {
+ $key = '{' . strtoupper($key);
+ $result[$key . '_SRC}'] = strlen($row['file']) ? ($row['lang'] ? './' . $row['lang'] : './images') . '/' . $row['file'] : '';
+ $result[$key . '_WIDTH}'] = intval($row['width']);
+ $result[$key . '_HEIGHT}'] = intval($row['height']);
+ }
+ return $result;
+}
+
+function list_files($dir, $ext)
+{
+ $res = @opendir($dir);
+ if ($res === false)
+ {
+ return false;
+ }
+ $files = array();
+ while (($file = readdir($res)) !== false)
+ {
+ $list = explode('.', $file);
+ if(count($list) > 1 && strtolower($list[count($list) - 1]) == $ext)
+ {
+ $files[] = $file;
+ }
+ }
+ closedir($res);
+ return $files;
+}
+
+function list_languages($dir)
+{
+ $res = @opendir($dir);
+ if ($res === false)
+ {
+ return array();
+ }
+ $files = array();
+ while (($file = readdir($res)) !== false)
+ {
+ if (substr($file, 0, 1) == '.')
+ {
+ continue;
+ }
+ $filename = $dir . '/' . $file;
+ if (is_dir($filename) && file_exists($filename . '/imageset.cfg'))
+ {
+ $files[] = $file;
+ }
+ }
+ closedir($res);
+ return $files;
+}
+
+function dump_code($code, $filename = 'file.txt')
+{
+ $hash = md5($code);
+ if (isset($_GET['download']) && $_GET['download'] === $hash)
+ {
+ // Download file
+ ob_end_clean();
+ header('Pragma: public');
+ header('Expires: 0');
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+ header('Content-Type: application/force-download');
+ header('Content-Disposition: attachment; filename="' . $filename . '";');
+ header('Content-Transfer-Encoding: binary');
+ header('Content-Length: ' . strlen($code));
+ echo $code;
+ exit;
+ }
+ $list = explode("\n", $code);
+ $height = 15 * count($list);
+ echo ' [ <a href="?download=', $hash, '">download</a> <a href="javascript:void(0);" onclick="document.getElementById(\'code-', $hash, '\').style.height = \'', $height, 'px\'; this.style.display = \'none\'; return false;">expand</a> ]<br />';
+ echo '<textarea id="code-', $hash, '" onfocus="this.select();" style="width: 98%; height: 200px;">', htmlspecialchars($code), '</textarea><br />';
+}
+
+function css($list, $path = './', $bidi = false)
+{
+ $code = '';
+ // Change value to true if you want images to be grouped up by size
+ $group = $bidi;
+ if ($group)
+ {
+ // group up images by size
+ $groups = array();
+ foreach ($list as $key => $row)
+ {
+ if (!strlen($row['file']))
+ {
+ continue;
+ }
+ $groups[$row['width'] . '*' . $row['height']][] = $key;
+ }
+ foreach ($groups as $size => $keys)
+ {
+ $extra = '';
+ for ($i=0; $i<count($keys); $i++)
+ {
+ $code .= ($i == 0 ? '' : ', ') . ($bidi ? '.rtl ' : '') . '.imageset.' . substr($keys[$i], 4);
+ if (!$bidi)
+ {
+ $extra .= '.imageset.' . substr($keys[$i], 4) . ' { background-image: url("' . $path . $list[$keys[$i]]['file'] . "\"); }\n";
+ }
+ }
+ $row = $list[$keys[0]];
+ $code .= ' {';
+ if ($bidi)
+ {
+ $code .= '
+ padding-right: ' . $row['width'] . 'px;
+ padding-left: 0;
+}
+';
+ }
+ else
+ {
+ $code .= '
+ padding-left: ' . $row['width'] . 'px;
+ padding-top: ' . $row['height'] . 'px;
+}
+' . $extra;
+ }
+ }
+ }
+ else
+ {
+ foreach ($list as $key => $row)
+ {
+ if (!strlen($row['file']))
+ {
+ continue;
+ }
+ $code .= ($bidi ? '.rtl ' : '') . '.imageset.' . substr($key, 4) . ' {';
+ if ($bidi)
+ {
+ $code .= '
+ padding-right: ' . $row['width'] . 'px;
+ padding-left: 0;
+}
+';
+ }
+ else
+ {
+ $code .= '
+ background-image: url("' . $path . $row['file'] . '");
+ padding-left: ' . $row['width'] . 'px;
+ padding-top: ' . $row['height'] . 'px;
+}
+';
+ }
+ }
+ }
+ return $code;
+}
+
diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php
index 5be48f69f0..5981882292 100644
--- a/phpBB/develop/lang_duplicates.php
+++ b/phpBB/develop/lang_duplicates.php
@@ -15,10 +15,11 @@ die("Please read the first lines of this script for instructions on how to enabl
// -------------------------------------------------------------
//
-// $Id$
+// @copyright (c) phpBB Limited <https://www.phpbb.com>
+// @license GNU General Public License, version 2 (GPL-2.0)
//
-// @copyright (c) 2005 phpBB Group
-// @license http://opensource.org/licenses/gpl-license.php GNU Public License
+// For full copyright and license information, please see
+// the docs/CREDITS.txt file.
//
// -------------------------------------------------------------
// Thanks to arod-1
@@ -137,4 +138,4 @@ function find_modules($dirname)
?>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/phpBB/develop/merge_attachment_tables.php b/phpBB/develop/merge_attachment_tables.php
index 0186b3cc8b..dd6e12172e 100644
--- a/phpBB/develop/merge_attachment_tables.php
+++ b/phpBB/develop/merge_attachment_tables.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2001, 2003 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -44,7 +48,7 @@ $sql = "CREATE TABLE {$table_prefix}attachments
AND a.post_id = p.post_id";
$db->sql_query($sql);
-switch ($db->sql_layer)
+switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -72,5 +76,3 @@ $db->sql_query($sql);
//$db->sql_query("DROP TABLE {$table_prefix}attach_temp");
echo "<p><b>Done</b></p>\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/merge_post_tables.php b/phpBB/develop/merge_post_tables.php
index 2d99d725d0..9e81917108 100644
--- a/phpBB/develop/merge_post_tables.php
+++ b/phpBB/develop/merge_post_tables.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2003 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -42,7 +46,7 @@ $sql = "CREATE TABLE {$table_prefix}posts
WHERE pt.post_id = p.post_id";
$db->sql_query($sql);
-switch ($db->sql_layer)
+switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -50,7 +54,7 @@ switch ($db->sql_layer)
ADD PRIMARY KEY (post_id),
ADD INDEX topic_id (topic_id),
ADD INDEX poster_ip (poster_ip),
- ADD INDEX post_approved (post_approved),
+ ADD INDEX post_visibility (post_visibility),
MODIFY COLUMN post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
ADD COLUMN post_encoding varchar(11) DEFAULT \'iso-8859-15\' NOT NULL';
break;
@@ -138,7 +142,7 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
-switch ($db->sql_layer)
+switch ($db->get_sql_layer())
{
case 'oracle':
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
@@ -162,7 +166,7 @@ while ($row = $db->sql_fetchrow($result))
$forum_id = $row['forum_id'];
$sql_ary[] = "UPDATE " . $table_prefix . "forums
- SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . "
+ SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts_approved = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics_approved = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . "
WHERE forum_id = $forum_id";
$sql = "SELECT t.topic_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
@@ -193,5 +197,3 @@ foreach ($sql_ary as $sql)
}
echo "<p><b>Done</b></p>\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index dcf2f2c88b..698be9d303 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -1,14 +1,20 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2006 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
*
-* This file creates SQL statements to upgrade phpBB on MySQL 3.x/4.0.x to 4.1.x/5.x
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
+/**
+* This file creates SQL statements to upgrade phpBB on MySQL 3.x/4.0.x to 4.1.x/5.x
+*/
+
//
// Security message:
//
@@ -56,68 +62,14 @@ echo "USE $dbname;$newline$newline";
@set_time_limit(0);
-$schema_data = get_schema_struct();
-$dbms_type_map = array(
- 'mysql_41' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT' => 'text',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT' => 'text',
- 'TEXT_UNI' => 'text',
- 'MTEXT' => 'mediumtext',
- 'MTEXT_UNI' => 'mediumtext',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'varbinary(255)',
- ),
+$finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path);
+$classes = $finder->core_path('phpbb/')
+ ->directory('/db/migration/data')
+ ->get_classes();
- 'mysql_40' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varbinary(255)',
- 'VCHAR:' => 'varbinary(%d)',
- 'CHAR:' => 'binary(%d)',
- 'XSTEXT' => 'blob',
- 'XSTEXT_UNI'=> 'blob',
- 'STEXT' => 'blob',
- 'STEXT_UNI' => 'blob',
- 'TEXT' => 'blob',
- 'TEXT_UNI' => 'blob',
- 'MTEXT' => 'mediumblob',
- 'MTEXT_UNI' => 'mediumblob',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'blob',
- 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
- 'VCHAR_CI' => 'blob',
- 'VARBINARY' => 'varbinary(255)',
- ),
-);
+$schema_generator = new \phpbb\db\migration\schema_generator($classes, $config, $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
+$schema_data = $schema_generator->get_schema();
+$dbms_type_map = \phpbb\db\tools::get_dbms_type_map();
foreach ($schema_data as $table_name => $table_data)
{
@@ -176,7 +128,7 @@ foreach ($schema_data as $table_name => $table_data)
$column_type = $dbms_type_map['mysql_41'][$column_data[0]];
}
- // Adjust default value if db-dependant specified
+ // Adjust default value if db-dependent specified
if (is_array($column_data[1]))
{
$column_data[1] = (isset($column_data[1][$dbms])) ? $column_data[1][$dbms] : $column_data[1]['default'];
@@ -255,1164 +207,3 @@ foreach ($schema_data as $table_name => $table_data)
echo "ALTER TABLE $table_name ADD FULLTEXT (post_subject), ADD FULLTEXT (post_text), ADD FULLTEXT post_content (post_subject, post_text);{$newline}";
}
}
-
-/**
-* Define the basic structure
-* The format:
-* array('{TABLE_NAME}' => {TABLE_DATA})
-* {TABLE_DATA}:
-* COLUMNS = array({column_name} = array({column_type}, {default}, {auto_increment}))
-* PRIMARY_KEY = {column_name(s)}
-* KEYS = array({key_name} = array({key_type}, {column_name(s)})),
-*
-* Column Types:
-* INT:x => SIGNED int(x)
-* BINT => BIGINT
-* UINT => mediumint(8) UNSIGNED
-* UINT:x => int(x) UNSIGNED
-* TINT:x => tinyint(x)
-* USINT => smallint(4) UNSIGNED (for _order columns)
-* BOOL => tinyint(1) UNSIGNED
-* VCHAR => varchar(255)
-* CHAR:x => char(x)
-* XSTEXT_UNI => text for storing 100 characters (topic_title for example)
-* STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI
-* TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.)
-* MTEXT_UNI => mediumtext (post text, large text)
-* VCHAR:x => varchar(x)
-* TIMESTAMP => int(11) UNSIGNED
-* DECIMAL => decimal number (5,2)
-* DECIMAL: => decimal number (x,2)
-* PDECIMAL => precision decimal number (6,3)
-* PDECIMAL: => precision decimal number (x,3)
-* VCHAR_UNI => varchar(255) BINARY
-* VCHAR_CI => varchar_ci for postgresql, others VCHAR
-*/
-function get_schema_struct()
-{
- $schema_data = array();
-
- $schema_data['phpbb_attachments'] = array(
- 'COLUMNS' => array(
- 'attach_id' => array('UINT', NULL, 'auto_increment'),
- 'post_msg_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'in_message' => array('BOOL', 0),
- 'poster_id' => array('UINT', 0),
- 'is_orphan' => array('BOOL', 1),
- 'physical_filename' => array('VCHAR', ''),
- 'real_filename' => array('VCHAR', ''),
- 'download_count' => array('UINT', 0),
- 'attach_comment' => array('TEXT_UNI', ''),
- 'extension' => array('VCHAR:100', ''),
- 'mimetype' => array('VCHAR:100', ''),
- 'filesize' => array('UINT:20', 0),
- 'filetime' => array('TIMESTAMP', 0),
- 'thumbnail' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'attach_id',
- 'KEYS' => array(
- 'filetime' => array('INDEX', 'filetime'),
- 'post_msg_id' => array('INDEX', 'post_msg_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'is_orphan' => array('INDEX', 'is_orphan'),
- ),
- );
-
- $schema_data['phpbb_acl_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'auth_opt_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_acl_options'] = array(
- 'COLUMNS' => array(
- 'auth_option_id' => array('UINT', NULL, 'auto_increment'),
- 'auth_option' => array('VCHAR:50', ''),
- 'is_global' => array('BOOL', 0),
- 'is_local' => array('BOOL', 0),
- 'founder_only' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'auth_option_id',
- 'KEYS' => array(
- 'auth_option' => array('UNIQUE', 'auth_option'),
- ),
- );
-
- $schema_data['phpbb_acl_roles'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', NULL, 'auto_increment'),
- 'role_name' => array('VCHAR_UNI', ''),
- 'role_description' => array('TEXT_UNI', ''),
- 'role_type' => array('VCHAR:10', ''),
- 'role_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'role_id',
- 'KEYS' => array(
- 'role_type' => array('INDEX', 'role_type'),
- 'role_order' => array('INDEX', 'role_order'),
- ),
- );
-
- $schema_data['phpbb_acl_roles_data'] = array(
- 'COLUMNS' => array(
- 'role_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'PRIMARY_KEY' => array('role_id', 'auth_option_id'),
- 'KEYS' => array(
- 'ath_op_id' => array('INDEX', 'auth_option_id'),
- ),
- );
-
- $schema_data['phpbb_acl_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'auth_option_id' => array('UINT', 0),
- 'auth_role_id' => array('UINT', 0),
- 'auth_setting' => array('TINT:2', 0),
- ),
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- 'auth_option_id' => array('INDEX', 'auth_option_id'),
- 'auth_role_id' => array('INDEX', 'auth_role_id'),
- ),
- );
-
- $schema_data['phpbb_banlist'] = array(
- 'COLUMNS' => array(
- 'ban_id' => array('UINT', NULL, 'auto_increment'),
- 'ban_userid' => array('UINT', 0),
- 'ban_ip' => array('VCHAR:40', ''),
- 'ban_email' => array('VCHAR_UNI:100', ''),
- 'ban_start' => array('TIMESTAMP', 0),
- 'ban_end' => array('TIMESTAMP', 0),
- 'ban_exclude' => array('BOOL', 0),
- 'ban_reason' => array('VCHAR_UNI', ''),
- 'ban_give_reason' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'ban_id',
- 'KEYS' => array(
- 'ban_end' => array('INDEX', 'ban_end'),
- 'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')),
- 'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')),
- 'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')),
- ),
- );
-
- $schema_data['phpbb_bbcodes'] = array(
- 'COLUMNS' => array(
- 'bbcode_id' => array('USINT', 0),
- 'bbcode_tag' => array('VCHAR:16', ''),
- 'bbcode_helpline' => array('VCHAR_UNI', ''),
- 'display_on_posting' => array('BOOL', 0),
- 'bbcode_match' => array('TEXT_UNI', ''),
- 'bbcode_tpl' => array('MTEXT_UNI', ''),
- 'first_pass_match' => array('MTEXT_UNI', ''),
- 'first_pass_replace' => array('MTEXT_UNI', ''),
- 'second_pass_match' => array('MTEXT_UNI', ''),
- 'second_pass_replace' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'bbcode_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_bookmarks'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('topic_id', 'user_id'),
- );
-
- $schema_data['phpbb_bots'] = array(
- 'COLUMNS' => array(
- 'bot_id' => array('UINT', NULL, 'auto_increment'),
- 'bot_active' => array('BOOL', 1),
- 'bot_name' => array('STEXT_UNI', ''),
- 'user_id' => array('UINT', 0),
- 'bot_agent' => array('VCHAR', ''),
- 'bot_ip' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'bot_id',
- 'KEYS' => array(
- 'bot_active' => array('INDEX', 'bot_active'),
- ),
- );
-
- $schema_data['phpbb_config'] = array(
- 'COLUMNS' => array(
- 'config_name' => array('VCHAR', ''),
- 'config_value' => array('VCHAR_UNI', ''),
- 'is_dynamic' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'config_name',
- 'KEYS' => array(
- 'is_dynamic' => array('INDEX', 'is_dynamic'),
- ),
- );
-
- $schema_data['phpbb_confirm'] = array(
- 'COLUMNS' => array(
- 'confirm_id' => array('CHAR:32', ''),
- 'session_id' => array('CHAR:32', ''),
- 'confirm_type' => array('TINT:3', 0),
- 'code' => array('VCHAR:8', ''),
- 'seed' => array('UINT:10', 0),
- 'attempts' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => array('session_id', 'confirm_id'),
- 'KEYS' => array(
- 'confirm_type' => array('INDEX', 'confirm_type'),
- ),
- );
-
- $schema_data['phpbb_disallow'] = array(
- 'COLUMNS' => array(
- 'disallow_id' => array('UINT', NULL, 'auto_increment'),
- 'disallow_username' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'disallow_id',
- );
-
- $schema_data['phpbb_drafts'] = array(
- 'COLUMNS' => array(
- 'draft_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'save_time' => array('TIMESTAMP', 0),
- 'draft_subject' => array('STEXT_UNI', ''),
- 'draft_message' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'draft_id',
- 'KEYS' => array(
- 'save_time' => array('INDEX', 'save_time'),
- ),
- );
-
- $schema_data['phpbb_extensions'] = array(
- 'COLUMNS' => array(
- 'extension_id' => array('UINT', NULL, 'auto_increment'),
- 'group_id' => array('UINT', 0),
- 'extension' => array('VCHAR:100', ''),
- ),
- 'PRIMARY_KEY' => 'extension_id',
- );
-
- $schema_data['phpbb_extension_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_name' => array('VCHAR_UNI', ''),
- 'cat_id' => array('TINT:2', 0),
- 'allow_group' => array('BOOL', 0),
- 'download_mode' => array('BOOL', 1),
- 'upload_icon' => array('VCHAR', ''),
- 'max_filesize' => array('UINT:20', 0),
- 'allowed_forums' => array('TEXT', ''),
- 'allow_in_pm' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'group_id',
- );
-
- $schema_data['phpbb_forums'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', NULL, 'auto_increment'),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'forum_parents' => array('MTEXT', ''),
- 'forum_name' => array('STEXT_UNI', ''),
- 'forum_desc' => array('TEXT_UNI', ''),
- 'forum_desc_bitfield' => array('VCHAR:255', ''),
- 'forum_desc_options' => array('UINT:11', 7),
- 'forum_desc_uid' => array('VCHAR:8', ''),
- 'forum_link' => array('VCHAR_UNI', ''),
- 'forum_password' => array('VCHAR_UNI:40', ''),
- 'forum_style' => array('UINT', 0),
- 'forum_image' => array('VCHAR', ''),
- 'forum_rules' => array('TEXT_UNI', ''),
- 'forum_rules_link' => array('VCHAR_UNI', ''),
- 'forum_rules_bitfield' => array('VCHAR:255', ''),
- 'forum_rules_options' => array('UINT:11', 7),
- 'forum_rules_uid' => array('VCHAR:8', ''),
- 'forum_topics_per_page' => array('TINT:4', 0),
- 'forum_type' => array('TINT:4', 0),
- 'forum_status' => array('TINT:4', 0),
- 'forum_posts' => array('UINT', 0),
- 'forum_topics' => array('UINT', 0),
- 'forum_topics_real' => array('UINT', 0),
- 'forum_last_post_id' => array('UINT', 0),
- 'forum_last_poster_id' => array('UINT', 0),
- 'forum_last_post_subject' => array('STEXT_UNI', ''),
- 'forum_last_post_time' => array('TIMESTAMP', 0),
- 'forum_last_poster_name'=> array('VCHAR_UNI', ''),
- 'forum_last_poster_colour'=> array('VCHAR:6', ''),
- 'forum_flags' => array('TINT:4', 32),
- 'forum_options' => array('UINT:20', 0),
- 'display_subforum_list' => array('BOOL', 1),
- 'display_on_index' => array('BOOL', 1),
- 'enable_indexing' => array('BOOL', 1),
- 'enable_icons' => array('BOOL', 1),
- 'enable_prune' => array('BOOL', 0),
- 'prune_next' => array('TIMESTAMP', 0),
- 'prune_days' => array('UINT', 0),
- 'prune_viewed' => array('UINT', 0),
- 'prune_freq' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'forum_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'forum_lastpost_id' => array('INDEX', 'forum_last_post_id'),
- ),
- );
-
- $schema_data['phpbb_forums_access'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'session_id' => array('CHAR:32', ''),
- ),
- 'PRIMARY_KEY' => array('forum_id', 'user_id', 'session_id'),
- );
-
- $schema_data['phpbb_forums_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'forum_id'),
- );
-
- $schema_data['phpbb_forums_watch'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_groups'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', NULL, 'auto_increment'),
- 'group_type' => array('TINT:4', 1),
- 'group_founder_manage' => array('BOOL', 0),
- 'group_skip_auth' => array('BOOL', 0),
- 'group_name' => array('VCHAR_CI', ''),
- 'group_desc' => array('TEXT_UNI', ''),
- 'group_desc_bitfield' => array('VCHAR:255', ''),
- 'group_desc_options' => array('UINT:11', 7),
- 'group_desc_uid' => array('VCHAR:8', ''),
- 'group_display' => array('BOOL', 0),
- 'group_avatar' => array('VCHAR', ''),
- 'group_avatar_type' => array('TINT:2', 0),
- 'group_avatar_width' => array('USINT', 0),
- 'group_avatar_height' => array('USINT', 0),
- 'group_rank' => array('UINT', 0),
- 'group_colour' => array('VCHAR:6', ''),
- 'group_sig_chars' => array('UINT', 0),
- 'group_receive_pm' => array('BOOL', 0),
- 'group_message_limit' => array('UINT', 0),
- 'group_max_recipients' => array('UINT', 0),
- 'group_legend' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'group_id',
- 'KEYS' => array(
- 'group_legend_name' => array('INDEX', array('group_legend', 'group_name')),
- ),
- );
-
- $schema_data['phpbb_icons'] = array(
- 'COLUMNS' => array(
- 'icons_id' => array('UINT', NULL, 'auto_increment'),
- 'icons_url' => array('VCHAR', ''),
- 'icons_width' => array('TINT:4', 0),
- 'icons_height' => array('TINT:4', 0),
- 'icons_order' => array('UINT', 0),
- 'display_on_posting' => array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'icons_id',
- 'KEYS' => array(
- 'display_on_posting' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_lang'] = array(
- 'COLUMNS' => array(
- 'lang_id' => array('TINT:4', NULL, 'auto_increment'),
- 'lang_iso' => array('VCHAR:30', ''),
- 'lang_dir' => array('VCHAR:30', ''),
- 'lang_english_name' => array('VCHAR_UNI:100', ''),
- 'lang_local_name' => array('VCHAR_UNI:255', ''),
- 'lang_author' => array('VCHAR_UNI:255', ''),
- ),
- 'PRIMARY_KEY' => 'lang_id',
- 'KEYS' => array(
- 'lang_iso' => array('INDEX', 'lang_iso'),
- ),
- );
-
- $schema_data['phpbb_log'] = array(
- 'COLUMNS' => array(
- 'log_id' => array('UINT', NULL, 'auto_increment'),
- 'log_type' => array('TINT:4', 0),
- 'user_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'reportee_id' => array('UINT', 0),
- 'log_ip' => array('VCHAR:40', ''),
- 'log_time' => array('TIMESTAMP', 0),
- 'log_operation' => array('TEXT_UNI', ''),
- 'log_data' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'log_id',
- 'KEYS' => array(
- 'log_type' => array('INDEX', 'log_type'),
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'reportee_id' => array('INDEX', 'reportee_id'),
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_login_attempts'] = array(
- 'COLUMNS' => array(
- '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),
- ),
- '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'),
- ),
- );
-
- $schema_data['phpbb_moderator_cache'] = array(
- 'COLUMNS' => array(
- 'forum_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'username' => array('VCHAR_UNI:255', ''),
- 'group_id' => array('UINT', 0),
- 'group_name' => array('VCHAR_UNI', ''),
- 'display_on_index' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'disp_idx' => array('INDEX', 'display_on_index'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_modules'] = array(
- 'COLUMNS' => array(
- 'module_id' => array('UINT', NULL, 'auto_increment'),
- 'module_enabled' => array('BOOL', 1),
- 'module_display' => array('BOOL', 1),
- 'module_basename' => array('VCHAR', ''),
- 'module_class' => array('VCHAR:10', ''),
- 'parent_id' => array('UINT', 0),
- 'left_id' => array('UINT', 0),
- 'right_id' => array('UINT', 0),
- 'module_langname' => array('VCHAR', ''),
- 'module_mode' => array('VCHAR', ''),
- 'module_auth' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'module_id',
- 'KEYS' => array(
- 'left_right_id' => array('INDEX', array('left_id', 'right_id')),
- 'module_enabled' => array('INDEX', 'module_enabled'),
- 'class_left_id' => array('INDEX', array('module_class', 'left_id')),
- ),
- );
-
- $schema_data['phpbb_poll_options'] = array(
- 'COLUMNS' => array(
- 'poll_option_id' => array('TINT:4', 0),
- 'topic_id' => array('UINT', 0),
- 'poll_option_text' => array('TEXT_UNI', ''),
- 'poll_option_total' => array('UINT', 0),
- ),
- 'KEYS' => array(
- 'poll_opt_id' => array('INDEX', 'poll_option_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- ),
- );
-
- $schema_data['phpbb_poll_votes'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'poll_option_id' => array('TINT:4', 0),
- 'vote_user_id' => array('UINT', 0),
- 'vote_user_ip' => array('VCHAR:40', ''),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'vote_user_id' => array('INDEX', 'vote_user_id'),
- 'vote_user_ip' => array('INDEX', 'vote_user_ip'),
- ),
- );
-
- $schema_data['phpbb_posts'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', NULL, 'auto_increment'),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'poster_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'poster_ip' => array('VCHAR:40', ''),
- 'post_time' => array('TIMESTAMP', 0),
- 'post_approved' => array('BOOL', 1),
- 'post_reported' => array('BOOL', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'post_username' => array('VCHAR_UNI:255', ''),
- 'post_subject' => array('STEXT_UNI', '', 'true_sort'),
- 'post_text' => array('MTEXT_UNI', ''),
- 'post_checksum' => array('VCHAR:32', ''),
- 'post_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'post_postcount' => array('BOOL', 1),
- 'post_edit_time' => array('TIMESTAMP', 0),
- 'post_edit_reason' => array('STEXT_UNI', ''),
- 'post_edit_user' => array('UINT', 0),
- 'post_edit_count' => array('USINT', 0),
- 'post_edit_locked' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'post_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'topic_id' => array('INDEX', 'topic_id'),
- 'poster_ip' => array('INDEX', 'poster_ip'),
- 'poster_id' => array('INDEX', 'poster_id'),
- 'post_approved' => array('INDEX', 'post_approved'),
- 'post_username' => array('INDEX', 'post_username'),
- 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
- ),
- );
-
- $schema_data['phpbb_privmsgs'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', NULL, 'auto_increment'),
- 'root_level' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'author_ip' => array('VCHAR:40', ''),
- 'message_time' => array('TIMESTAMP', 0),
- 'enable_bbcode' => array('BOOL', 1),
- 'enable_smilies' => array('BOOL', 1),
- 'enable_magic_url' => array('BOOL', 1),
- 'enable_sig' => array('BOOL', 1),
- 'message_subject' => array('STEXT_UNI', ''),
- 'message_text' => array('MTEXT_UNI', ''),
- 'message_edit_reason' => array('STEXT_UNI', ''),
- 'message_edit_user' => array('UINT', 0),
- 'message_attachment' => array('BOOL', 0),
- 'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:8', ''),
- 'message_edit_time' => array('TIMESTAMP', 0),
- 'message_edit_count' => array('USINT', 0),
- 'to_address' => array('TEXT_UNI', ''),
- 'bcc_address' => array('TEXT_UNI', ''),
- 'message_reported' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'msg_id',
- 'KEYS' => array(
- 'author_ip' => array('INDEX', 'author_ip'),
- 'message_time' => array('INDEX', 'message_time'),
- 'author_id' => array('INDEX', 'author_id'),
- 'root_level' => array('INDEX', 'root_level'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_folder'] = array(
- 'COLUMNS' => array(
- 'folder_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'folder_name' => array('VCHAR_UNI', ''),
- 'pm_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'folder_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_rules'] = array(
- 'COLUMNS' => array(
- 'rule_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'rule_check' => array('UINT', 0),
- 'rule_connection' => array('UINT', 0),
- 'rule_string' => array('VCHAR_UNI', ''),
- 'rule_user_id' => array('UINT', 0),
- 'rule_group_id' => array('UINT', 0),
- 'rule_action' => array('UINT', 0),
- 'rule_folder_id' => array('INT:11', 0),
- ),
- 'PRIMARY_KEY' => 'rule_id',
- 'KEYS' => array(
- 'user_id' => array('INDEX', 'user_id'),
- ),
- );
-
- $schema_data['phpbb_privmsgs_to'] = array(
- 'COLUMNS' => array(
- 'msg_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'author_id' => array('UINT', 0),
- 'pm_deleted' => array('BOOL', 0),
- 'pm_new' => array('BOOL', 1),
- 'pm_unread' => array('BOOL', 1),
- 'pm_replied' => array('BOOL', 0),
- 'pm_marked' => array('BOOL', 0),
- 'pm_forwarded' => array('BOOL', 0),
- 'folder_id' => array('INT:11', 0),
- ),
- 'KEYS' => array(
- 'msg_id' => array('INDEX', 'msg_id'),
- 'author_id' => array('INDEX', 'author_id'),
- 'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')),
- ),
- );
-
- $schema_data['phpbb_profile_fields'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', NULL, 'auto_increment'),
- 'field_name' => array('VCHAR_UNI', ''),
- 'field_type' => array('TINT:4', 0),
- 'field_ident' => array('VCHAR:20', ''),
- 'field_length' => array('VCHAR:20', ''),
- 'field_minlen' => array('VCHAR', ''),
- 'field_maxlen' => array('VCHAR', ''),
- 'field_novalue' => array('VCHAR_UNI', ''),
- 'field_default_value' => array('VCHAR_UNI', ''),
- 'field_validation' => array('VCHAR_UNI:20', ''),
- 'field_required' => array('BOOL', 0),
- 'field_show_novalue' => array('BOOL', 0),
- 'field_show_on_reg' => array('BOOL', 0),
- 'field_show_on_vt' => array('BOOL', 0),
- 'field_show_profile' => array('BOOL', 0),
- 'field_hide' => array('BOOL', 0),
- 'field_no_view' => array('BOOL', 0),
- 'field_active' => array('BOOL', 0),
- 'field_order' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'field_id',
- 'KEYS' => array(
- 'fld_type' => array('INDEX', 'field_type'),
- 'fld_ordr' => array('INDEX', 'field_order'),
- ),
- );
-
- $schema_data['phpbb_profile_fields_data'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- );
-
- $schema_data['phpbb_profile_fields_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'option_id' => array('UINT', 0),
- 'field_type' => array('TINT:4', 0),
- 'lang_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'),
- );
-
- $schema_data['phpbb_profile_lang'] = array(
- 'COLUMNS' => array(
- 'field_id' => array('UINT', 0),
- 'lang_id' => array('UINT', 0),
- 'lang_name' => array('VCHAR_UNI', ''),
- 'lang_explain' => array('TEXT_UNI', ''),
- 'lang_default_value' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => array('field_id', 'lang_id'),
- );
-
- $schema_data['phpbb_ranks'] = array(
- 'COLUMNS' => array(
- 'rank_id' => array('UINT', NULL, 'auto_increment'),
- 'rank_title' => array('VCHAR_UNI', ''),
- 'rank_min' => array('UINT', 0),
- 'rank_special' => array('BOOL', 0),
- 'rank_image' => array('VCHAR', ''),
- ),
- 'PRIMARY_KEY' => 'rank_id',
- );
-
- $schema_data['phpbb_reports'] = array(
- 'COLUMNS' => array(
- 'report_id' => array('UINT', NULL, 'auto_increment'),
- 'reason_id' => array('USINT', 0),
- 'post_id' => array('UINT', 0),
- 'pm_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'user_notify' => array('BOOL', 0),
- 'report_closed' => array('BOOL', 0),
- 'report_time' => array('TIMESTAMP', 0),
- 'report_text' => array('MTEXT_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'report_id',
- 'KEYS' => array(
- 'post_id' => array('INDEX', 'post_id'),
- 'pm_id' => array('INDEX', 'pm_id'),
- ),
- );
-
- $schema_data['phpbb_reports_reasons'] = array(
- 'COLUMNS' => array(
- 'reason_id' => array('USINT', NULL, 'auto_increment'),
- 'reason_title' => array('VCHAR_UNI', ''),
- 'reason_description' => array('MTEXT_UNI', ''),
- 'reason_order' => array('USINT', 0),
- ),
- 'PRIMARY_KEY' => 'reason_id',
- );
-
- $schema_data['phpbb_search_results'] = array(
- 'COLUMNS' => array(
- 'search_key' => array('VCHAR:32', ''),
- 'search_time' => array('TIMESTAMP', 0),
- 'search_keywords' => array('MTEXT_UNI', ''),
- 'search_authors' => array('MTEXT', ''),
- ),
- 'PRIMARY_KEY' => 'search_key',
- );
-
- $schema_data['phpbb_search_wordlist'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word_text' => array('VCHAR_UNI', ''),
- 'word_common' => array('BOOL', 0),
- 'word_count' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'word_id',
- 'KEYS' => array(
- 'wrd_txt' => array('UNIQUE', 'word_text'),
- 'wrd_cnt' => array('INDEX', 'word_count'),
- ),
- );
-
- $schema_data['phpbb_search_wordmatch'] = array(
- 'COLUMNS' => array(
- 'post_id' => array('UINT', 0),
- 'word_id' => array('UINT', 0),
- 'title_match' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'unq_mtch' => array('UNIQUE', array('word_id', 'post_id', 'title_match')),
- 'word_id' => array('INDEX', 'word_id'),
- 'post_id' => array('INDEX', 'post_id'),
- ),
- );
-
- $schema_data['phpbb_sessions'] = array(
- 'COLUMNS' => array(
- 'session_id' => array('CHAR:32', ''),
- 'session_user_id' => array('UINT', 0),
- 'session_forum_id' => array('UINT', 0),
- 'session_last_visit' => array('TIMESTAMP', 0),
- 'session_start' => array('TIMESTAMP', 0),
- 'session_time' => array('TIMESTAMP', 0),
- 'session_ip' => array('VCHAR:40', ''),
- 'session_browser' => array('VCHAR:150', ''),
- 'session_forwarded_for' => array('VCHAR:255', ''),
- 'session_page' => array('VCHAR_UNI', ''),
- 'session_viewonline' => array('BOOL', 1),
- 'session_autologin' => array('BOOL', 0),
- 'session_admin' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'session_id',
- 'KEYS' => array(
- 'session_time' => array('INDEX', 'session_time'),
- 'session_user_id' => array('INDEX', 'session_user_id'),
- 'session_fid' => array('INDEX', 'session_forum_id'),
- ),
- );
-
- $schema_data['phpbb_sessions_keys'] = array(
- 'COLUMNS' => array(
- 'key_id' => array('CHAR:32', ''),
- 'user_id' => array('UINT', 0),
- 'last_ip' => array('VCHAR:40', ''),
- 'last_login' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('key_id', 'user_id'),
- 'KEYS' => array(
- 'last_login' => array('INDEX', 'last_login'),
- ),
- );
-
- $schema_data['phpbb_sitelist'] = array(
- 'COLUMNS' => array(
- 'site_id' => array('UINT', NULL, 'auto_increment'),
- 'site_ip' => array('VCHAR:40', ''),
- 'site_hostname' => array('VCHAR', ''),
- 'ip_exclude' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'site_id',
- );
-
- $schema_data['phpbb_smilies'] = array(
- 'COLUMNS' => array(
- 'smiley_id' => array('UINT', NULL, 'auto_increment'),
- // We may want to set 'code' to VCHAR:50 or check if unicode support is possible... at the moment only ASCII characters are allowed.
- 'code' => array('VCHAR_UNI:50', ''),
- 'emotion' => array('VCHAR_UNI:50', ''),
- 'smiley_url' => array('VCHAR:50', ''),
- 'smiley_width' => array('USINT', 0),
- 'smiley_height' => array('USINT', 0),
- 'smiley_order' => array('UINT', 0),
- 'display_on_posting'=> array('BOOL', 1),
- ),
- 'PRIMARY_KEY' => 'smiley_id',
- 'KEYS' => array(
- 'display_on_post' => array('INDEX', 'display_on_posting'),
- ),
- );
-
- $schema_data['phpbb_styles'] = array(
- 'COLUMNS' => array(
- 'style_id' => array('UINT', NULL, 'auto_increment'),
- 'style_name' => array('VCHAR_UNI:255', ''),
- 'style_copyright' => array('VCHAR_UNI', ''),
- 'style_active' => array('BOOL', 1),
- 'template_id' => array('UINT', 0),
- 'theme_id' => array('UINT', 0),
- 'imageset_id' => array('UINT', 0),
- ),
- 'PRIMARY_KEY' => 'style_id',
- 'KEYS' => array(
- 'style_name' => array('UNIQUE', 'style_name'),
- 'template_id' => array('INDEX', 'template_id'),
- 'theme_id' => array('INDEX', 'theme_id'),
- 'imageset_id' => array('INDEX', 'imageset_id'),
- ),
- );
-
- $schema_data['phpbb_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'),
- ),
- );
-
- $schema_data['phpbb_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'),
- ),
- );
-
- $schema_data['phpbb_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'),
- ),
- );
-
- $schema_data['phpbb_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'),
- ),
- );
-
- $schema_data['phpbb_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'),
- ),
- );
-
- $schema_data['phpbb_topics'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', NULL, 'auto_increment'),
- 'forum_id' => array('UINT', 0),
- 'icon_id' => array('UINT', 0),
- 'topic_attachment' => array('BOOL', 0),
- 'topic_approved' => array('BOOL', 1),
- 'topic_reported' => array('BOOL', 0),
- 'topic_title' => array('STEXT_UNI', '', 'true_sort'),
- 'topic_poster' => array('UINT', 0),
- 'topic_time' => array('TIMESTAMP', 0),
- 'topic_time_limit' => array('TIMESTAMP', 0),
- 'topic_views' => array('UINT', 0),
- 'topic_replies' => array('UINT', 0),
- 'topic_replies_real' => array('UINT', 0),
- 'topic_status' => array('TINT:3', 0),
- 'topic_type' => array('TINT:3', 0),
- 'topic_first_post_id' => array('UINT', 0),
- 'topic_first_poster_name' => array('VCHAR_UNI', ''),
- 'topic_first_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_id' => array('UINT', 0),
- 'topic_last_poster_id' => array('UINT', 0),
- 'topic_last_poster_name' => array('VCHAR_UNI', ''),
- 'topic_last_poster_colour' => array('VCHAR:6', ''),
- 'topic_last_post_subject' => array('STEXT_UNI', ''),
- 'topic_last_post_time' => array('TIMESTAMP', 0),
- 'topic_last_view_time' => array('TIMESTAMP', 0),
- 'topic_moved_id' => array('UINT', 0),
- 'topic_bumped' => array('BOOL', 0),
- 'topic_bumper' => array('UINT', 0),
- 'poll_title' => array('STEXT_UNI', ''),
- 'poll_start' => array('TIMESTAMP', 0),
- 'poll_length' => array('TIMESTAMP', 0),
- 'poll_max_options' => array('TINT:4', 1),
- 'poll_last_vote' => array('TIMESTAMP', 0),
- 'poll_vote_change' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => 'topic_id',
- 'KEYS' => array(
- 'forum_id' => array('INDEX', 'forum_id'),
- 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
- 'last_post_time' => array('INDEX', 'topic_last_post_time'),
- 'topic_approved' => array('INDEX', 'topic_approved'),
- 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_approved', 'topic_last_post_id')),
- 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
- ),
- );
-
- $schema_data['phpbb_topics_track'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'forum_id' => array('UINT', 0),
- 'mark_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'forum_id' => array('INDEX', 'forum_id'),
- ),
- );
-
- $schema_data['phpbb_topics_posted'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'topic_id' => array('UINT', 0),
- 'topic_posted' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'topic_id'),
- );
-
- $schema_data['phpbb_topics_watch'] = array(
- 'COLUMNS' => array(
- 'topic_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'notify_status' => array('BOOL', 0),
- ),
- 'KEYS' => array(
- 'topic_id' => array('INDEX', 'topic_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'notify_stat' => array('INDEX', 'notify_status'),
- ),
- );
-
- $schema_data['phpbb_user_group'] = array(
- 'COLUMNS' => array(
- 'group_id' => array('UINT', 0),
- 'user_id' => array('UINT', 0),
- 'group_leader' => array('BOOL', 0),
- 'user_pending' => array('BOOL', 1),
- ),
- 'KEYS' => array(
- 'group_id' => array('INDEX', 'group_id'),
- 'user_id' => array('INDEX', 'user_id'),
- 'group_leader' => array('INDEX', 'group_leader'),
- ),
- );
-
- $schema_data['phpbb_users'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', NULL, 'auto_increment'),
- 'user_type' => array('TINT:2', 0),
- 'group_id' => array('UINT', 3),
- 'user_permissions' => array('MTEXT', ''),
- 'user_perm_from' => array('UINT', 0),
- 'user_ip' => array('VCHAR:40', ''),
- 'user_regdate' => array('TIMESTAMP', 0),
- 'username' => array('VCHAR_CI', ''),
- 'username_clean' => array('VCHAR_CI', ''),
- 'user_password' => array('VCHAR_UNI:40', ''),
- 'user_passchg' => array('TIMESTAMP', 0),
- 'user_pass_convert' => array('BOOL', 0),
- 'user_email' => array('VCHAR_UNI:100', ''),
- 'user_email_hash' => array('BINT', 0),
- 'user_birthday' => array('VCHAR:10', ''),
- 'user_lastvisit' => array('TIMESTAMP', 0),
- 'user_lastmark' => array('TIMESTAMP', 0),
- 'user_lastpost_time' => array('TIMESTAMP', 0),
- 'user_lastpage' => array('VCHAR_UNI:200', ''),
- 'user_last_confirm_key' => array('VCHAR:10', ''),
- 'user_last_search' => array('TIMESTAMP', 0),
- 'user_warnings' => array('TINT:4', 0),
- 'user_last_warning' => array('TIMESTAMP', 0),
- 'user_login_attempts' => array('TINT:4', 0),
- 'user_inactive_reason' => array('TINT:2', 0),
- 'user_inactive_time' => array('TIMESTAMP', 0),
- 'user_posts' => array('UINT', 0),
- 'user_lang' => array('VCHAR:30', ''),
- 'user_timezone' => array('DECIMAL', 0),
- 'user_dst' => array('BOOL', 0),
- 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
- 'user_style' => array('UINT', 0),
- 'user_rank' => array('UINT', 0),
- 'user_colour' => array('VCHAR:6', ''),
- 'user_new_privmsg' => array('INT:4', 0),
- 'user_unread_privmsg' => array('INT:4', 0),
- 'user_last_privmsg' => array('TIMESTAMP', 0),
- 'user_message_rules' => array('BOOL', 0),
- 'user_full_folder' => array('INT:11', -3),
- 'user_emailtime' => array('TIMESTAMP', 0),
- 'user_topic_show_days' => array('USINT', 0),
- 'user_topic_sortby_type' => array('VCHAR:1', 't'),
- 'user_topic_sortby_dir' => array('VCHAR:1', 'd'),
- 'user_post_show_days' => array('USINT', 0),
- 'user_post_sortby_type' => array('VCHAR:1', 't'),
- 'user_post_sortby_dir' => array('VCHAR:1', 'a'),
- 'user_notify' => array('BOOL', 0),
- 'user_notify_pm' => array('BOOL', 1),
- 'user_notify_type' => array('TINT:4', 0),
- 'user_allow_pm' => array('BOOL', 1),
- 'user_allow_viewonline' => array('BOOL', 1),
- 'user_allow_viewemail' => array('BOOL', 1),
- 'user_allow_massemail' => array('BOOL', 1),
- 'user_options' => array('UINT:11', 230271),
- 'user_avatar' => array('VCHAR', ''),
- 'user_avatar_type' => array('TINT:2', 0),
- 'user_avatar_width' => array('USINT', 0),
- 'user_avatar_height' => array('USINT', 0),
- 'user_sig' => array('MTEXT_UNI', ''),
- 'user_sig_bbcode_uid' => array('VCHAR:8', ''),
- 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''),
- 'user_from' => array('VCHAR_UNI:100', ''),
- 'user_icq' => array('VCHAR:15', ''),
- 'user_aim' => array('VCHAR_UNI', ''),
- 'user_yim' => array('VCHAR_UNI', ''),
- 'user_msnm' => array('VCHAR_UNI', ''),
- 'user_jabber' => array('VCHAR_UNI', ''),
- 'user_website' => array('VCHAR_UNI:200', ''),
- 'user_occ' => array('TEXT_UNI', ''),
- 'user_interests' => array('TEXT_UNI', ''),
- 'user_actkey' => array('VCHAR:32', ''),
- 'user_newpasswd' => array('VCHAR_UNI:40', ''),
- 'user_form_salt' => array('VCHAR_UNI:32', ''),
- 'user_new' => array('BOOL', 1),
- 'user_reminded' => array('TINT:4', 0),
- 'user_reminded_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'user_id',
- 'KEYS' => array(
- 'user_birthday' => array('INDEX', 'user_birthday'),
- 'user_email_hash' => array('INDEX', 'user_email_hash'),
- 'user_type' => array('INDEX', 'user_type'),
- 'username_clean' => array('UNIQUE', 'username_clean'),
- ),
- );
-
- $schema_data['phpbb_warnings'] = array(
- 'COLUMNS' => array(
- 'warning_id' => array('UINT', NULL, 'auto_increment'),
- 'user_id' => array('UINT', 0),
- 'post_id' => array('UINT', 0),
- 'log_id' => array('UINT', 0),
- 'warning_time' => array('TIMESTAMP', 0),
- ),
- 'PRIMARY_KEY' => 'warning_id',
- );
-
- $schema_data['phpbb_words'] = array(
- 'COLUMNS' => array(
- 'word_id' => array('UINT', NULL, 'auto_increment'),
- 'word' => array('VCHAR_UNI', ''),
- 'replacement' => array('VCHAR_UNI', ''),
- ),
- 'PRIMARY_KEY' => 'word_id',
- );
-
- $schema_data['phpbb_zebra'] = array(
- 'COLUMNS' => array(
- 'user_id' => array('UINT', 0),
- 'zebra_id' => array('UINT', 0),
- 'friend' => array('BOOL', 0),
- 'foe' => array('BOOL', 0),
- ),
- 'PRIMARY_KEY' => array('user_id', 'zebra_id'),
- );
-
- return $schema_data;
-}
diff --git a/phpBB/develop/namespacify.php b/phpBB/develop/namespacify.php
new file mode 100644
index 0000000000..447e87905e
--- /dev/null
+++ b/phpBB/develop/namespacify.php
@@ -0,0 +1,194 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+//
+// Security message:
+//
+// This script is potentially dangerous.
+// Remove or comment the next line (die(".... ) to enable this script.
+// Do NOT FORGET to either remove this script or disable it after you have used it.
+//
+die("Please read the first lines of this script for instructions on how to enable it");
+
+$namespace_dir = realpath(__DIR__ . '/../phpbb/');
+$code_dir = realpath(__DIR__ . '/../');
+$test_dir = realpath(__DIR__ . '/../../tests/');
+$config_dir = realpath(__DIR__ . '/../config/');
+
+function map_class_name($old_class_name, $code_dir)
+{
+ $parts = explode('_', $old_class_name);
+ $cur_dir = array();
+ $cur_name = array();
+ $in_name = false;
+ foreach ($parts as $i => $part)
+ {
+ if (empty($part))
+ {
+ return null;
+ }
+
+ if (!$in_name)
+ {
+ $new_dir = array_merge($cur_dir, array($part));
+ $path = $code_dir . '/' . implode('/', $new_dir);
+
+ if (file_exists($path) && is_dir($path))
+ {
+ $cur_dir = $new_dir;
+ }
+ else
+ {
+ $in_name = true;
+ $cur_name[] = $part;
+ }
+ }
+ else
+ {
+ $cur_name[] = $part;
+ }
+ }
+
+ if (empty($cur_name) && !empty($cur_dir))
+ {
+ $cur_name[] = $cur_dir[count($cur_dir) - 1];
+ }
+
+ if (file_exists($code_dir . '/' . implode('/', $cur_dir) . '/' . implode('_', $cur_name) . '.php'))
+ {
+ return implode('\\', $cur_dir) . '\\' . implode('_', $cur_name);
+ }
+
+ return null;
+}
+
+$iterator = new \AppendIterator();
+$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($code_dir)));
+$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($test_dir)));
+$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($config_dir)));
+
+foreach ($iterator as $file)
+{
+ if (substr($file->getPath(), 0, 6) === 'vendor')
+ {
+ continue;
+ }
+
+ if ($file->getExtension() == 'php')
+ {
+ $code = file_get_contents($file->getPathname());
+ $namespaced_file = false;
+
+ if (preg_match('#^' . preg_quote($namespace_dir, '#') . '#', $file->getPath()))
+ {
+ if (preg_match('#^(?:interface|(?:abstract )?class) (phpbb_[a-z0-9_]+)#m', $code, $matches))
+ {
+ $old_class_name = $matches[1];
+ $dirs = explode(DIRECTORY_SEPARATOR, preg_replace('#^' . preg_quote(dirname($namespace_dir) . DIRECTORY_SEPARATOR, '#') . '#', '', $file->getPath()));
+
+ $namespace = implode('\\', $dirs);
+
+ if ($dirs[count($dirs) - 1] == substr($file->getFilename(), 0, -4))
+ {
+ $class_name = preg_replace('#^' . preg_quote(implode('_', $dirs), '#') . '#', $dirs[count($dirs) - 1], $old_class_name);
+ }
+ else
+ {
+ $class_name = preg_replace('#^' . preg_quote(implode('_', $dirs), '#') . '_#', '', $old_class_name);
+ }
+
+ $code = preg_replace("#^\*/$#m", "*/\n\nnamespace $namespace;", $code, 1, $count);
+ if ($count != 1)
+ {
+ die("Incorrect replacement count for namespace of $old_class_name");
+ }
+ $code = preg_replace("#^(interface|(?:abstract )?class) $old_class_name#m", "\\1 $class_name", $code, -1, $count);
+ if ($count != 1)
+ {
+ die("Incorrect replacement count for $old_class_name");
+ }
+
+ $namespaced_file = true;
+ }
+ }
+
+ if (preg_match_all('#[^a-z0-9_$](phpbb_[a-z0-9_]+)#', $code, $matches))
+ {
+ foreach ($matches[1] as $old_class_name)
+ {
+ $class_name = map_class_name($old_class_name, $code_dir);
+ if ($class_name)
+ {
+ $code = preg_replace("#([^a-z0-9_\$>])$old_class_name([^a-z0-9_])#", '\\1\\\\' . $class_name . '\\2', $code);
+ }
+ }
+ }
+
+ if ($namespaced_file)
+ {
+ $code = preg_replace('#new ([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)#', 'new \\\\\\1', $code);
+ $code = preg_replace('#([^a-zA-Z0-9_\\\\$])([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)::#', '\\1\\\\\\2::', $code);
+ $code = preg_replace('#catch \(([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)#', 'catch (\\\\\\1', $code);
+ $code = preg_replace('#(\(|, )([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)(\s\$)#', '\\1\\\\\\2\\3', $code);
+ $code = preg_replace('#(implements |extends )([a-zA-Z0-9_][a-zA-Z0-9_\\\\]+)(?=\s*(?:,|\n))#', '\\1\\\\\\2', $code);
+ $abs_classes = array(
+ 'Countable',
+ 'IteratorAggregate',
+ 'ArrayAccess',
+ );
+ $code = preg_replace('#(\s+)(' . implode('|', $abs_classes) . ')#', '\\1\\\\\\2', $code);
+ $rel_classes = array(
+ 'ContainerBuilder',
+ 'YamlFileLoader',
+ 'FileLocator',
+ 'Extension',
+ 'CompilerPassInterface',
+ 'EventSubscriberInterface',
+ 'EventDispatcherInterface',
+ 'ContainerAwareEventDispatcher',
+ 'ContainerInterface',
+ 'KernelEvents',
+ 'RouteCollection',
+ 'ControllerResolverInterface',
+ 'Request',
+ 'include',
+ 'array',
+ 'parent',
+ 'self',
+ );
+ $code = preg_replace('#([^a-zA-Z0-9_])\\\\((?:' . implode('|', $rel_classes) . ')(?:\s|\(|::|;))#', '\\1\\2', $code);
+ }
+
+ file_put_contents($file->getPathname(), $code);
+ }
+
+ if ($file->getExtension() == 'yml')
+ {
+ $code = file_get_contents($file->getPathname());
+
+ if (preg_match_all('#\s*class:\s*(phpbb_[a-z0-9_]+)\s+#', $code, $matches))
+ {
+ foreach ($matches[1] as $old_class_name)
+ {
+ $class_name = map_class_name($old_class_name, $code_dir);
+ if ($class_name)
+ {
+ $code = preg_replace("#(\s*class:\s*)$old_class_name(\s+)#", "\\1$class_name\\2", $code);
+ }
+ }
+ }
+
+ file_put_contents($file->getPathname(), $code);
+ }
+}
+
diff --git a/phpBB/develop/nuke-db.php b/phpBB/develop/nuke-db.php
index d7329c3f56..e1f64a6177 100644
--- a/phpBB/develop/nuke-db.php
+++ b/phpBB/develop/nuke-db.php
@@ -54,5 +54,3 @@ else
flush();
}
}
-?>
-
diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php
index 8165ba1f21..46b6fff701 100644
--- a/phpBB/develop/regex.php
+++ b/phpBB/develop/regex.php
@@ -80,5 +80,3 @@ echo 'www.URL: ' . $www_url . "<br />\n";
// no schema and no authority
$relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?";
echo 'relative URL: ' . $relative_url . "<br />\n";
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/regex_idn.php b/phpBB/develop/regex_idn.php
new file mode 100644
index 0000000000..d871695c50
--- /dev/null
+++ b/phpBB/develop/regex_idn.php
@@ -0,0 +1,151 @@
+<?php
+//
+// Security message:
+//
+// This script is potentially dangerous.
+// Remove or comment the next line (die(".... ) to enable this script.
+// Do NOT FORGET to either remove this script or disable it after you have used it.
+//
+die("Please read the first lines of this script for instructions on how to enable it");
+
+// IP regular expressions
+
+$dec_octet = '(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])';
+$h16 = '[\dA-F]{1,4}';
+$ipv4 = "(?:$dec_octet\.){3}$dec_octet";
+$ls32 = "(?:$h16:$h16|$ipv4)";
+
+$ipv6_construct = array(
+ array(false, '', '{6}', $ls32),
+ array(false, '::', '{0,5}', "(?:$h16(?::$h16)?|$ipv4)"),
+ array('', ':', '{4}', $ls32),
+ array('{1,2}', ':', '{3}', $ls32),
+ array('{1,3}', ':', '{2}', $ls32),
+ array('{1,4}', ':', '', $ls32),
+ array('{1,5}', ':', false, $ls32),
+ array('{1,6}', ':', false, $h16),
+ array('{1,7}', ':', false, ''),
+ array(false, '::', false, '')
+);
+
+$ipv6 = '(?:';
+foreach ($ipv6_construct as $ip_type)
+{
+ $ipv6 .= '(?:';
+ if ($ip_type[0] !== false)
+ {
+ $ipv6 .= "(?:$h16:)" . $ip_type[0];
+ }
+ $ipv6 .= $ip_type[1];
+ if ($ip_type[2] !== false)
+ {
+ $ipv6 .= "(?:$h16:)" . $ip_type[2];
+ }
+ $ipv6 .= $ip_type[3] . ')|';
+}
+$ipv6 = substr($ipv6, 0, -1) . ')';
+
+echo 'IPv4: ' . $ipv4 . "<br /><br />\n\nIPv6: " . $ipv6 . "<br /><br />\n\n";
+
+// URL regular expressions
+
+/* IDN2008 characters derivation
+** http://unicode.org/faq/idn.html#33 - IDN FAQ: derivation of valid characters in terms of Unicode properties
+** http://unicode.org/reports/tr46/ - Unicode Technical Standard #46. Unicode IDNA Compatibility Processing
+** http://www.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt - Unicode Character Database
+*/
+/*
+** Remove Control Characters and Whitespace (as in IDNA2003)
+*/
+$no_cc = '\p{C}\p{Z}';
+/*
+** Remove Symbols, Punctuation, non-decimal Numbers, and Enclosing Marks
+*/
+$no_symbol = '\p{S}\p{P}\p{Nl}\p{No}\p{Me}';
+/*
+** Remove characters used for archaic Hangul (Korean) - \p{HST=L} and \p{HST=V}
+** as per http://unicode.org/Public/UNIDATA/HangulSyllableType.txt
+*/
+$no_hangul = '\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}';
+/*
+** Remove three blocks of technical or archaic symbols.
+*/
+$no_cdm = '\x{20D0}-\x{20FF}'; // \p{block=Combining_Diacritical_Marks_For_Symbols}
+$no_musical = '\x{1D100}-\x{1D1FF}'; // \p{block=Musical_Symbols}
+$no_ancient_greek_musical = '\x{1D200}-\x{1D24F}'; // \p{block=Ancient_Greek_Musical_Notation}
+/* Remove certain exceptions:
+** U+0640 ARABIC TATWEEL
+** U+07FA NKO LAJANYALAN
+** U+302E HANGUL SINGLE DOT TONE MARK
+** U+302F HANGUL DOUBLE DOT TONE MARK
+** U+3031 VERTICAL KANA REPEAT MARK
+** U+3032 VERTICAL KANA REPEAT WITH VOICED SOUND MARK
+** ..
+** U+3035 VERTICAL KANA REPEAT MARK LOWER HALF
+** U+303B VERTICAL IDEOGRAPHIC ITERATION MARK
+*/
+$no_certain_exceptions = '\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}';
+/* Add certain exceptions:
+** U+00B7 MIDDLE DOT
+** U+0375 GREEK LOWER NUMERAL SIGN
+** U+05F3 HEBREW PUNCTUATION GERESH
+** U+05F4 HEBREW PUNCTUATION GERSHAYIM
+** U+30FB KATAKANA MIDDLE DOT
+** U+002D HYPHEN-MINUS
+** U+06FD ARABIC SIGN SINDHI AMPERSAND
+** U+06FE ARABIC SIGN SINDHI POSTPOSITION MEN
+** U+0F0B TIBETAN MARK INTERSYLLABIC TSHEG
+** U+3007 IDEOGRAPHIC NUMBER ZERO
+*/
+$add_certain_exceptions = '\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}';
+/* Add special exceptions (Deviations):
+** U+00DF LATIN SMALL LETTER SHARP S
+** U+03C2 GREEK SMALL LETTER FINAL SIGMA
+** U+200C ZERO WIDTH NON-JOINER
+** U+200D ZERO WIDTH JOINER
+*/
+$add_deviations = '\x{00DF}\x{03C2}\x{200C}\x{200D}';
+
+// Concatenate remove/add regexes respectively
+$remove_chars = "$no_cc$no_symbol$no_hangul$no_cdm$no_musical$no_ancient_greek_musical$no_certain_exceptions";
+$add_chars = "$add_certain_exceptions$add_deviations";
+
+// Initialize inline mode
+$inline = false;
+
+do
+{
+ $inline = !$inline;
+
+ $pct_encoded = "%[\dA-F]{2}";
+ $unreserved = "$add_chars\pL0-9\-._~";
+ $sub_delims = ($inline) ? '!$&\'(*+,;=' : '!$&\'()*+,;=';
+ $scheme = ($inline) ? '[a-z][a-z\d+]*': '[a-z][a-z\d+\-.]*' ; // avoid automatic parsing of "word" in "last word.http://..."
+ $pchar = "(?:[^$remove_chars]*[$unreserved$sub_delims:@|]+|$pct_encoded)"; // rfc: no "|"
+
+ $reg_name = "(?:[^$remove_chars]*[$unreserved$sub_delims:@|]+|$pct_encoded)+"; // rfc: * instead of + and no "|" and no "@" and no ":" (included instead of userinfo)
+ //$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*";
+ $ipv4_simple = '[0-9.]+';
+ $ipv6_simple = '\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\]';
+ $host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)";
+ $port = '\d*';
+ //$authority = "(?:$userinfo@)?$host(?::$port)?";
+ $authority = "$host(?::$port)?";
+ $segment = "$pchar*";
+ $path_abempty = "(?:/$segment)*";
+ $hier_part = "/{2}$authority$path_abempty";
+ $query = "(?:[^$remove_chars]*[$unreserved$sub_delims:@/?|]+|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|"
+ $fragment = $query;
+
+ $url = "$scheme:$hier_part(?:\?$query)?(?:\#$fragment)?";
+ echo (($inline) ? 'URL inline: ' : 'URL: ') . $url . "<br /><br />\n\n";
+
+ // no scheme, shortened authority, but host has to start with www.
+ $www_url = "www\.$reg_name(?::$port)?$path_abempty(?:\?$query)?(?:\#$fragment)?";
+ echo (($inline) ? 'www.URL_inline: ' : 'www.URL: ') . $www_url . "<br /><br />\n\n";
+
+ // no schema and no authority
+ $relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?";
+ echo (($inline) ? 'relative URL inline: ' : 'relative URL: ') . $relative_url . "<br /><br />\n\n";
+}
+while ($inline);
diff --git a/phpBB/develop/remove-php-end-tags.py b/phpBB/develop/remove-php-end-tags.py
new file mode 100755
index 0000000000..89b9ee5032
--- /dev/null
+++ b/phpBB/develop/remove-php-end-tags.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+# Remove ending PHP tags '?>'
+# @author Oleg Pudeyev
+# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+
+import sys, os, os.path, optparse
+
+def error(message, code):
+ print >>sys.stderr, message
+ exit(code)
+
+
+parser = optparse.OptionParser()
+parser.add_option('-a', '--aggressive', help='Remove ending tags when they are followed by whitespace', action='store_true')
+options, args = parser.parse_args()
+
+if len(args) != 1:
+ parser.usage()
+ error("Usage: remove-php-end-tags path", 2)
+
+path = args[0]
+
+if not os.path.exists(path):
+ error("Path does not exist: %s" % path, 3)
+
+if options.aggressive:
+ import re
+
+ fix_re = re.compile(r'\s*\?>\s*$')
+ def fix_content(content):
+ content = fix_re.sub(r'\n', content)
+ return content
+else:
+ def fix_content(content):
+ if content.endswith('?>'):
+ content = content[:-2].strip() + "\n"
+ return content
+
+def process_file(path):
+ f = open(path)
+ try:
+ content = f.read()
+ finally:
+ f.close()
+ fixed_content = fix_content(content)
+ if content != fixed_content:
+ f = open(path, 'w')
+ try:
+ f.write(fixed_content)
+ finally:
+ f.close()
+
+def process_dir(path):
+ for root, dirs, files in os.walk(path):
+ if '.svn' in dirs:
+ dirs.remove('.svn')
+ for file in files:
+ if file.endswith('.php'):
+ path = os.path.join(root, file)
+ process_file(path)
+
+if os.path.isdir(path):
+ process_dir(path)
+else:
+ process_file(path)
diff --git a/phpBB/develop/rename_interfaces.php b/phpBB/develop/rename_interfaces.php
new file mode 100644
index 0000000000..90bf9cc205
--- /dev/null
+++ b/phpBB/develop/rename_interfaces.php
@@ -0,0 +1,56 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+//
+// Security message:
+//
+// This script is potentially dangerous.
+// Remove or comment the next line (die(".... ) to enable this script.
+// Do NOT FORGET to either remove this script or disable it after you have used it.
+//
+die("Please read the first lines of this script for instructions on how to enable it");
+
+$code_dir = realpath(__DIR__ . '/../');
+$test_dir = realpath(__DIR__ . '/../../tests/');
+$iterator = new \AppendIterator();
+$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($code_dir)));
+$iterator->append(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($test_dir)));
+
+$map = array(
+ 'phpbb\request\request_interface' => 'phpbb\request\request_interface',
+ 'phpbb\auth\provider\provider_interface' => 'phpbb\auth\provider\provider_interface',
+ 'phpbb\avatar\driver\driver_interface' => 'phpbb\avatar\driver\driver_interface',
+ 'phpbb\cache\driver\driver_interface' => 'phpbb\cache\driver\driver_interface',
+ 'phpbb\db\migration\tool\tool_interface' => 'phpbb\db\migration\tool\tool_interface',
+ 'phpbb\extension\extension_interface' => 'phpbb\extension\extension_interface',
+ 'phpbb\groupposition\groupposition_interface' => 'phpbb\groupposition\groupposition_interface',
+ 'phpbb\log\log_interface' => 'phpbb\log\log_interface',
+ 'phpbb\notification\method\method_interface' => 'phpbb\notification\method\method_interface',
+ 'phpbb\notification\type\type_interface' => 'phpbb\notification\type\type_interface',
+ 'phpbb\request\request_interface' => 'phpbb\request\request_interface',
+ 'phpbb\tree\tree_interface' => 'phpbb\tree\tree_interface',
+);
+
+foreach ($iterator as $file)
+{
+ if ($file->getExtension() == 'php')
+ {
+ $code = file_get_contents($file->getPathname());
+
+ foreach ($map as $orig => $new)
+ {
+ $code = preg_replace("#([^a-z0-9_\$])$orig([^a-z0-9_])#i", '\\1' . $new . '\\2', $code);
+ }
+ file_put_contents($file->getPathname(), $code);
+ }
+}
diff --git a/phpBB/develop/repair_bots.php b/phpBB/develop/repair_bots.php
index c5aaa75d9b..2c6e9ce091 100644
--- a/phpBB/develop/repair_bots.php
+++ b/phpBB/develop/repair_bots.php
@@ -128,7 +128,7 @@ function add_bots($bots)
'user_email' => '',
'user_lang' => $config['default_lang'],
'user_style' => 1,
- 'user_timezone' => 0,
+ 'user_timezone' => 'UTC',
'user_allow_massemail' => 0,
);
@@ -147,5 +147,3 @@ function add_bots($bots)
}
}
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php
index 371c8c74cc..07c4024b2f 100644
--- a/phpBB/develop/search_fill.php
+++ b/phpBB/develop/search_fill.php
@@ -34,15 +34,13 @@ $user->setup();
$search_type = $config['search_type'];
-if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+if (!class_exists($search_type))
{
trigger_error('NO_SUCH_SEARCH_MODULE');
}
-require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx);
-
$error = false;
-$search = new $search_type($error);
+$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
if ($error)
{
diff --git a/phpBB/develop/strip_icc_profiles.sh b/phpBB/develop/strip_icc_profiles.sh
index 779c7ffca7..b11a63616b 100755
--- a/phpBB/develop/strip_icc_profiles.sh
+++ b/phpBB/develop/strip_icc_profiles.sh
@@ -1,7 +1,12 @@
#!/bin/sh
#
-# @copyright (c) 2014 phpBB Group
-# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
#
if [ "$#" -ne 1 ]
diff --git a/phpBB/develop/unicode_testing.php b/phpBB/develop/unicode_testing.php
index 25a13d1325..ec3c71d078 100644
--- a/phpBB/develop/unicode_testing.php
+++ b/phpBB/develop/unicode_testing.php
@@ -116,5 +116,3 @@ function utf8_normalize_nfkc($strings)
return $strings;
}
-
-?> \ No newline at end of file
diff --git a/phpBB/develop/update_email_hash.php b/phpBB/develop/update_email_hash.php
index 80fd4bbc17..57aebe3ca0 100644
--- a/phpBB/develop/update_email_hash.php
+++ b/phpBB/develop/update_email_hash.php
@@ -54,4 +54,3 @@ echo 'FINISHED';
// Done
$db->sql_close();
-?> \ No newline at end of file
diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php
index b8709888fe..27ff786db7 100644
--- a/phpBB/develop/utf_normalizer_test.php
+++ b/phpBB/develop/utf_normalizer_test.php
@@ -1,9 +1,13 @@
<?php
/**
*
-* @package phpBB3
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
*
*/
@@ -387,4 +391,4 @@ function cp_to_utf($cp)
{
return chr($cp);
}
-} \ No newline at end of file
+}