From 14f1e581faa3b66e7689c55c1e9c0485c0872b1e Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 9 Jun 2011 05:13:26 +0200 Subject: [feature/extension-manager] Extension Manager & Finder Extensions RFC: http://area51.phpbb.com/phpBB/viewtopic.php?f=84&t=41499 Ticket: http://tracker.phpbb.com/browse/PHPBB3-10323 PHPBB3-10323 --- phpBB/develop/create_schema_files.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 2057d292b7..9f2015f38e 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1031,6 +1031,17 @@ function get_schema_struct() ), ); + $schema_data['phpbb_ext'] = array( + 'COLUMNS' => array( + 'ext_name' => array('VCHAR', ''), + 'ext_active' => array('BOOL', 0), + ), + 'KEYS' => array( + 'ext_name' => array('UNIQUE', 'ext_name'), + 'ext_active' => array('INDEX', 'ext_active'), + ), + ); + $schema_data['phpbb_extensions'] = array( 'COLUMNS' => array( 'extension_id' => array('UINT', NULL, 'auto_increment'), -- cgit v1.2.1 From 60ad0e21b5d4f940740650df69b7134a573f2a97 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 21 Aug 2011 03:06:56 -0400 Subject: [feature/extension-manager] Remove the ext_active index for lack of specificity PHPBB3-10323 --- phpBB/develop/create_schema_files.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 9f2015f38e..bc1e28572d 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1038,7 +1038,6 @@ function get_schema_struct() ), 'KEYS' => array( 'ext_name' => array('UNIQUE', 'ext_name'), - 'ext_active' => array('INDEX', 'ext_active'), ), ); -- cgit v1.2.1 From c7a986eccdac183cc81b3da486092f4ab82109ba Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 29 Aug 2011 17:17:40 -0400 Subject: [feature/extension-manager] Use an incremental process for enable and purge The enable or purge operation of an extension could take a long time if an expensive operation needs to be executed on a large set of data. To allow this to succeed from a web interface with max_execution_time set in the webserver's php configuration, subsequent requests must continue the operation started earlier. So individual enable and purge implementations must be able to spread their work across multiple steps. PHPBB3-10323 --- phpBB/develop/create_schema_files.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index bc1e28572d..1828719570 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1035,6 +1035,7 @@ function get_schema_struct() 'COLUMNS' => array( 'ext_name' => array('VCHAR', ''), 'ext_active' => array('BOOL', 0), + 'ext_state' => array('TEXT', ''), ), 'KEYS' => array( 'ext_name' => array('UNIQUE', 'ext_name'), -- cgit v1.2.1 From 7f42970ba005ca27f85e4375267bd32b8ad35341 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 14 Oct 2011 02:00:46 +0200 Subject: [feature/remove-imagesets] Fix create_schema_files, get rid of imagesets PHPBB3-10336 --- phpBB/develop/create_schema_files.php | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 2057d292b7..dfdb66aa73 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1639,14 +1639,12 @@ function get_schema_struct() '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'), ), ); @@ -1679,35 +1677,6 @@ function get_schema_struct() ), ); - $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'), -- cgit v1.2.1 From 7fa14e654ad8880613897b45f5effb287d3bfd2d Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 14 Oct 2011 03:12:44 +0200 Subject: [ticket/10413] Make create_schema_files usable PHPBB3-10413 --- phpBB/develop/create_schema_files.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index efe8837b26..9649997412 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -12,11 +12,7 @@ * If you overwrite the original schema files please make sure you save the file with UNIX linefeeds. */ -die("Please read the first lines of this script for instructions on how to enable it"); - -@set_time_limit(0); - -$schema_path = './../install/schemas/'; +$schema_path = dirname(__FILE__).'/../install/schemas/'; if (!is_writable($schema_path)) { @@ -242,7 +238,7 @@ $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', ' foreach ($supported_dbms as $dbms) { - $fp = fopen($schema_path . '_' . $dbms . '_schema.sql', 'wt'); + $fp = fopen($schema_path . '' . $dbms . '_schema.sql', 'wt'); $line = ''; -- cgit v1.2.1 From 8cf22f552935417911306cb2830d7522791c9098 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 14 Oct 2011 03:41:02 +0200 Subject: [ticket/10189] Add "automatically generated" comment into schema-files PHPBB3-10189 --- phpBB/develop/create_schema_files.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index efe8837b26..05acf7177d 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -246,6 +246,32 @@ foreach ($supported_dbms as $dbms) $line = ''; + 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; + } + // Write Header switch ($dbms) { -- cgit v1.2.1 From c3f3435228accc44e2fd8d358c21b81f8ec66d87 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 14 Oct 2011 04:29:28 +0200 Subject: [ticket/10189] Get rid of $id$ from schema files PHPBB3-10189 --- phpBB/develop/create_schema_files.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 05acf7177d..9ce5f72922 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -246,6 +246,7 @@ foreach ($supported_dbms as $dbms) $line = ''; + // Write Header switch ($dbms) { case 'mysql_40': @@ -272,37 +273,21 @@ foreach ($supported_dbms as $dbms) break; } - // Write Header switch ($dbms) { - case 'mysql_40': - case 'mysql_41': - $line = "#\n# \$I" . "d: $\n#\n\n"; - break; - case 'firebird': - $line = "#\n# \$I" . "d: $\n#\n\n"; $line .= custom_data('firebird') . "\n"; break; case 'sqlite': - $line = "#\n# \$I" . "d: $\n#\n\n"; $line .= "BEGIN TRANSACTION;\n\n"; break; - case 'mssql': - $line = "/*\n\n \$I" . "d: $\n\n*/\n\n"; - // no need to do this, no transaction support for schema changes - //$line .= "BEGIN TRANSACTION\nGO\n\n"; - break; - case 'oracle': - $line = "/*\n\n \$I" . "d: $\n\n*/\n\n"; $line .= custom_data('oracle') . "\n"; break; case 'postgres': - $line = "/*\n\n \$I" . "d: $\n\n*/\n\n"; $line .= "BEGIN;\n\n"; $line .= custom_data('postgres') . "\n"; break; -- cgit v1.2.1 From 8d33dea2cdc68473fbcf3c45ac8bdbe8fd185054 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sun, 16 Oct 2011 19:30:33 +0200 Subject: [ticket/10413] Fix CS PHPBB3-10413 --- phpBB/develop/create_schema_files.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 9649997412..1ba03707d0 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -12,7 +12,7 @@ * If you overwrite the original schema files please make sure you save the file with UNIX linefeeds. */ -$schema_path = dirname(__FILE__).'/../install/schemas/'; +$schema_path = dirname(__FILE__) . '/../install/schemas/'; if (!is_writable($schema_path)) { @@ -238,7 +238,7 @@ $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', ' foreach ($supported_dbms as $dbms) { - $fp = fopen($schema_path . '' . $dbms . '_schema.sql', 'wt'); + $fp = fopen($schema_path . $dbms . '_schema.sql', 'wt'); $line = ''; -- cgit v1.2.1 From bb40789552d1620d0281df8a41a020f826ca8739 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 30 Oct 2011 12:46:10 +0100 Subject: [ticket/10434] Add script for creating search index from CLI. PHPBB3-10434 --- phpBB/develop/create_search_index.php | 137 ++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 phpBB/develop/create_search_index.php (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php new file mode 100644 index 0000000000..374a4cf0a1 --- /dev/null +++ b/phpBB/develop/create_search_index.php @@ -0,0 +1,137 @@ +session_begin(); +$auth->acl($user->data); +$user->setup('acp/search'); + +$search_name = ucfirst(strtolower(str_replace('_', ' ', $class_name))); +$search_errors = array(); +$search = new $class_name($search_errors); + +$batch_size = isset($argv[2]) ? $argv[2] : 2000; +$time = time(); + +if (method_exists($search, 'create_index')) +{ + if ($error = $search->create_index(null, '')) + { + var_dump($error); + exit(1); + } +} +else +{ + $sql = 'SELECT forum_id, enable_indexing + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forums[$row['forum_id']] = (bool) $row['enable_indexing']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT post_id + FROM ' . POSTS_TABLE . ' + ORDER BY post_id DESC'; + $result = $db->sql_query_limit($sql, 1); + $max_post_id = (int) $db->sql_fetchfield('post_id'); + + $post_counter = 0; + while ($post_counter <= $max_post_id) + { + $row_count = 0; + + printf("Processing posts with %d <= post_id <= %d\n", + $post_counter + 1, + $post_counter + $batch_size + ); + + $sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id + FROM ' . POSTS_TABLE . ' + WHERE post_id >= ' . (int) ($post_counter + 1) . ' + AND post_id <= ' . (int) ($post_counter + $batch_size); + $result = $db->sql_query($sql); + + $buffer = $db->sql_buffer_nested_transactions(); + + if ($buffer) + { + $rows = $db->sql_fetchrowset($result); + $rows[] = false; // indicate end of array for while loop below + + $db->sql_freeresult($result); + } + + $i = 0; + while ($row = ($buffer ? $rows[$i++] : $db->sql_fetchrow($result))) + { + // Indexing enabled for this forum or global announcement? + // Global announcements get indexed by default. + if (!$row['forum_id'] || !empty($forums[$row['forum_id']])) + { + ++$row_count; + + $search->index('post', + $row['post_id'], + $row['post_text'], + $row['post_subject'], + $row['poster_id'], + $row['forum_id'] + ); + + if ($row_count % 10 == 0) + { + echo '.'; + } + } + } + + $delta = (time() - $time); + $delta = $delta <= 0 ? 1 : $delta; + printf(" %d posts/sec\n", $row_count / $delta); + + if (!$buffer) + { + $db->sql_freeresult($result); + } + + $post_counter += $batch_size; + } +} + +$search->tidy(); + +add_log('admin', 'LOG_SEARCH_INDEX_CREATED', $search_name); + +echo $user->lang['SEARCH_INDEX_CREATED'] . "\n"; +echo 'Peak Memory Usage: ' . get_formatted_filesize(memory_get_peak_usage()) . "\n"; + +exit(0); -- cgit v1.2.1 From 5e52734c240e5ecfb812202cd4cae305be9290c5 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Jan 2012 15:09:38 +0000 Subject: [ticket/9916] Changing header in non-distributed files PHPBB3-9916 --- phpBB/develop/change_smiley_ref.php | 2 -- phpBB/develop/check_flash_bbcodes.php | 3 +-- phpBB/develop/create_schema_files.php | 3 +-- phpBB/develop/create_search_index.php | 2 +- phpBB/develop/create_variable_overview.php | 2 -- phpBB/develop/fill.php | 2 -- phpBB/develop/generate_utf_casefold.php | 3 +-- phpBB/develop/generate_utf_confusables.php | 3 +-- phpBB/develop/generate_utf_tables.php | 3 +-- phpBB/develop/merge_post_tables.php | 1 - phpBB/develop/mysql_upgrader.php | 3 +-- phpBB/develop/utf_normalizer_test.php | 3 +-- 12 files changed, 8 insertions(+), 22 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/change_smiley_ref.php b/phpBB/develop/change_smiley_ref.php index db65dd52d4..3d6dd45d6f 100644 --- a/phpBB/develop/change_smiley_ref.php +++ b/phpBB/develop/change_smiley_ref.php @@ -5,8 +5,6 @@ * begin : Tuesday, February 25, 2003 * copyright : (C) 2003 The phpBB Group * email : support@phpbb.com - * - * $Id$ * ***************************************************************************/ diff --git a/phpBB/develop/check_flash_bbcodes.php b/phpBB/develop/check_flash_bbcodes.php index b0fa399209..2ce288ee3e 100644 --- a/phpBB/develop/check_flash_bbcodes.php +++ b/phpBB/develop/check_flash_bbcodes.php @@ -2,9 +2,8 @@ /** * * @package phpBB3 -* @version $Id$ * @copyright (c) 2009, 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 7f37b94453..d44efb8870 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -2,9 +2,8 @@ /** * * @package phpBB3 -* @version $Id$ * @copyright (c) 2006 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * * This file creates new schema files for every database. * The filenames will be prefixed with an underscore to not overwrite the current schema files. diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php index 374a4cf0a1..28001035f6 100644 --- a/phpBB/develop/create_search_index.php +++ b/phpBB/develop/create_search_index.php @@ -3,7 +3,7 @@ * * @package phpBB3 * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/phpBB/develop/create_variable_overview.php b/phpBB/develop/create_variable_overview.php index fe7cacf0d1..a786fc6866 100644 --- a/phpBB/develop/create_variable_overview.php +++ b/phpBB/develop/create_variable_overview.php @@ -1,8 +1,6 @@ Date: Sat, 31 Dec 2011 13:32:52 +0000 Subject: [ticket/9916] Updating header license and removing Version $Id$ PHPBB3-9916 --- phpBB/develop/lang_duplicates.php | 4 +--- phpBB/develop/remove-php-end-tags.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php index 3ea841b6d6..02852798b6 100644 --- a/phpBB/develop/lang_duplicates.php +++ b/phpBB/develop/lang_duplicates.php @@ -15,10 +15,8 @@ die("Please read the first lines of this script for instructions on how to enabl // ------------------------------------------------------------- // -// $Id$ -// // @copyright (c) 2005 phpBB Group -// @license http://opensource.org/licenses/gpl-license.php GNU Public License +// @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 // // ------------------------------------------------------------- // Thanks to arod-1 diff --git a/phpBB/develop/remove-php-end-tags.py b/phpBB/develop/remove-php-end-tags.py index 1707c6d519..89b9ee5032 100755 --- a/phpBB/develop/remove-php-end-tags.py +++ b/phpBB/develop/remove-php-end-tags.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # Remove ending PHP tags '?>' # @author Oleg Pudeyev -# @license http://opensource.org/licenses/gpl-license.php GNU Public License +# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 import sys, os, os.path, optparse -- cgit v1.2.1 From a1a1b61ae8507276f7191be84a8782c0b0218f9c Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 22:22:32 +0200 Subject: [ticket/10637] Leftovers from implementation of extensions in develop tools Replacing code in development tools that was missed in ticket 10323 PHPBB3-10637 --- phpBB/develop/create_search_index.php | 1 - phpBB/develop/search_fill.php | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'phpBB/develop') diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php index 28001035f6..1de20f3099 100644 --- a/phpBB/develop/create_search_index.php +++ b/phpBB/develop/create_search_index.php @@ -25,7 +25,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/search_fill.php b/phpBB/develop/search_fill.php index 371c8c74cc..4c0b607778 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -34,13 +34,11 @@ $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); -- cgit v1.2.1