diff options
Diffstat (limited to 'phpBB/develop')
22 files changed, 250 insertions, 586 deletions
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php index 449d931507..fd419a7dde 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. * */ @@ -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; diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php index 27176c97d3..c3cf90773e 100644 --- a/phpBB/develop/benchmark.php +++ b/phpBB/develop/benchmark.php @@ -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"; diff --git a/phpBB/develop/calc_email_hash.php b/phpBB/develop/calc_email_hash.php index c73fd26e17..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. * */ diff --git a/phpBB/develop/change_smiley_ref.php b/phpBB/develop/change_smiley_ref.php index 0a3108947a..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. * */ 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 8e01b3c286..7ef86ad7fc 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. * @@ -13,7 +20,6 @@ $schema_path = dirname(__FILE__) . '/../install/schemas/'; $supported_dbms = array( - 'firebird', 'mssql', 'mysql_40', 'mysql_41', @@ -21,6 +27,7 @@ $supported_dbms = array( 'postgres', 'sqlite', ); +$table_prefix = 'phpbb_'; if (!is_writable($schema_path)) { @@ -28,19 +35,21 @@ if (!is_writable($schema_path)) } define('IN_PHPBB', true); -define('IN_INSTALL', true); -$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../'; +$phpbb_root_path = dirname(__FILE__) . '/../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.' . $phpEx); -$classes = $phpbb_container->get('ext.manager') - ->get_finder() - ->core_path('phpbb/') - ->directory('db/migration/data') +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(); -$db_tools = new \phpbb\db\tools($db, true); -$schema_generator = new \phpbb\db\migration\schema_generator($classes, $config, $db, $db_tools, $phpbb_root_path, $phpEx, 'phpbb_'); +$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(); $dbms_type_map = phpbb\db\tools::get_dbms_type_map(); @@ -48,187 +57,4 @@ $fp = fopen($schema_path . 'schema.json', 'wb'); fwrite($fp, json_encode($schema_data, JSON_PRETTY_PRINT)); fclose($fp); -foreach ($supported_dbms as $dbms) -{ - $fp = fopen($schema_path . $dbms . '_schema.sql', 'wb'); - - // 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; - } - - $line = ''; - switch ($dbms) - { - case 'oracle': - $line .= custom_data('oracle') . "\n"; - break; - - case 'postgres': - $line .= "BEGIN;\n\n"; - $line .= custom_data('postgres') . "\n"; - $line .= "COMMIT;\n\n"; - break; - } - - fwrite($fp, $line); - fclose($fp); -} - -/** -* 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 ''; -} - -echo 'done'; +echo 'Successfully created schema file'; diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php index f329b805a0..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. * */ diff --git a/phpBB/develop/create_variable_overview.php b/phpBB/develop/create_variable_overview.php index e65de130b3..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. -* */ // @@ -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>® Forum Software © phpBB Group</div> +<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited</div> <br clear="all" /></td> </tr> @@ -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>® Forum Software © phpBB Group</div> +<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited</div> <br clear="all" /></td> </tr> @@ -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>® Forum Software © phpBB Group</div> +<div class="copyright" align="center">Powered by <a href="http://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited</div> <br clear="all" /></td> </tr> diff --git a/phpBB/develop/export_events_for_wiki.php b/phpBB/develop/export_events_for_wiki.php index 3021b64e05..2096e9c858 100644 --- a/phpBB/develop/export_events_for_wiki.php +++ b/phpBB/develop/export_events_for_wiki.php @@ -1,8 +1,13 @@ <?php /** * -* @copyright (c) 2013 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. * */ @@ -16,316 +21,84 @@ $phpbb_root_path = __DIR__ . '/../'; function usage() { - echo "Usage: export_events_for_wiki.php COMMAND\n"; + echo "Usage: export_events_for_wiki.php COMMAND [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 "acp:\n"; - echo " Export all events for files in the acp style.\n"; + echo " php:\n"; + echo " Generate the PHP event section of Event_List\n"; echo "\n"; - echo "styles:\n"; - echo " Export all events for files in the prosilver and subsilver2 styles.\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 "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"; - echo "php:\n"; - echo " Export all events for php-files.\n"; exit(2); } -function export_from_eventsmd($phpbb_root_path, $filter) +function validate_argument_count($arguments, $count) { - $file_content = file_get_contents($phpbb_root_path . 'docs/events.md'); - - $events = explode("\n\n", $file_content); - foreach ($events as $event) + if ($arguments <= $count) { - // Last row of the file - if (strpos($event, "\n===\n") === false) continue; - - list($event_name, $details) = explode("\n===\n", $event); - - if ($filter == 'acp' && strpos($event_name, 'acp_') !== 0) continue; - if ($filter == 'styles' && strpos($event_name, 'acp_') === 0) continue; - - list($file_details, $details) = explode("\n* Since: ", $details); - list($version, $explanition) = explode("\n* Purpose: ", $details); - - echo "|- id=\"{$event_name}\"\n"; - echo "| [[#{$event_name}|{$event_name}]] || "; - - if (strpos($file_details, "* Locations:\n + ") === 0) - { - $file_details = substr($file_details, strlen("* Locations:\n + ")); - $files = explode("\n + ", $file_details); - $prosilver = $subsilver2 = $adm = array(); - foreach ($files as $file) - { - if (strpos($file, 'styles/prosilver/template/') === 0) - { - $prosilver[] = substr($file, strlen('styles/prosilver/template/')); - } - if (strpos($file, 'styles/subsilver2/template/') === 0) - { - $subsilver2[] = substr($file, strlen('styles/subsilver2/template/')); - } - if (strpos($file, 'adm/style/') === 0) - { - $adm[] = substr($file, strlen('adm/style/')); - } - } - if ($filter == 'acp') - { - echo implode(', ', $adm); - } - else - { - echo implode(', ', $prosilver) . ' || ' . implode(', ', $subsilver2); - } - } - else if ($filter == 'acp') - { - echo substr($file_details, strlen("* Location: adm/style/")); - } - echo " || {$version} || " . str_replace("\n", ' ', $explanition) . "\n"; - + usage(); } } -function export_from_php($phpbb_root_path) -{ - $files = get_file_list($phpbb_root_path); - $events = array(); - foreach ($files as $file) - { - $file_events = check_for_events($phpbb_root_path, $file); - if (!empty($file_events)) - { - $events = array_merge($events, $file_events); - } - } - - ksort($events); +validate_argument_count($argc, 1); - foreach ($events as $event) - { - echo '|- id="' . $event['event'] . '"' . "\n"; - echo '| [[#' . $event['event'] . '|' . $event['event'] . ']] || ' . $event['file'] . ' || ' . implode(', ', $event['arguments']) . ' || ' . $event['since'] . ' || ' . $event['description'] . "\n"; - } -} +$action = $argv[1]; +$extension = isset($argv[2]) ? $argv[2] : null; +require __DIR__ . '/../phpbb/event/php_exporter.' . $phpEx; +require __DIR__ . '/../phpbb/event/md_exporter.' . $phpEx; +require __DIR__ . '/../phpbb/event/recursive_event_filter_iterator.' . $phpEx; +require __DIR__ . '/../phpbb/recursive_dot_prefix_filter_iterator.' . $phpEx; -function check_for_events($phpbb_root_path, $file) +switch ($action) { - $events = array(); - $content = file_get_contents($phpbb_root_path . $file); - - if (strpos($content, "phpbb_dispatcher->trigger_event('") || strpos($content, "phpbb_dispatcher->dispatch('")) - { - $lines = explode("\n", $content); - for ($i = 0, $num_lines = sizeof($lines); $i < $num_lines; $i++) - { - $event_line = 0; - $found_trigger_event = strpos($lines[$i], "phpbb_dispatcher->trigger_event('"); - if ($found_trigger_event !== false) - { - $event_line = $i; - $event_name = $lines[$event_line]; - $event_name = substr($event_name, $found_trigger_event + strlen("phpbb_dispatcher->trigger_event('")); - $event_name = substr($event_name, 0, strpos($event_name, "'")); - - $current_line = trim($lines[$event_line]); - $arguments = array(); - $found_inline_array = strpos($current_line, "', compact(array('"); - if ($found_inline_array !== false) - { - $varsarray = substr($current_line, $found_inline_array + strlen("', compact(array('"), -6); - $arguments = explode("', '", $varsarray); - } - - if (empty($arguments)) - { - // Find $vars array lines - $find_varsarray_line = 1; - while (strpos($lines[$event_line - $find_varsarray_line], "vars = array('") === false) - { - $find_varsarray_line++; - - if ($find_varsarray_line > min(50, $event_line)) - { - throw new LogicException('Can not find "$vars = array()"-line for event "' . $event_name . '" in file "' . $file . '"'); - } - } - $varsarray = substr(trim($lines[$event_line - $find_varsarray_line]), strlen("\$vars = array('"), -3); - $arguments = explode("', '", $varsarray); - } - - // Validate $vars array with @var - $find_vars_line = 3; - $doc_vars = array(); - while (strpos(trim($lines[$event_line - $find_vars_line]), '*') === 0) - { - $var_line = trim($lines[$event_line - $find_vars_line]); - $var_line = preg_replace('!\s+!', ' ', $var_line); - if (strpos($var_line, '* @var ') === 0) - { - $doc_line = explode(' ', $var_line); - if (isset($doc_line[3])) - { - $doc_vars[] = $doc_line[3]; - } - } - $find_vars_line++; - } - if (sizeof($arguments) !== sizeof($doc_vars) && array_intersect($arguments, $doc_vars)) - { - throw new LogicException('$vars array does not match the list of @var tags for event "' . $event_name . '" in file "' . $file . '"'); - } - } - $found_dispatch = strpos($lines[$i], "phpbb_dispatcher->dispatch('"); - if ($found_dispatch !== false) - { - $event_line = $i; - $event_name = $lines[$event_line]; - $event_name = substr($event_name, $found_dispatch + strlen("phpbb_dispatcher->dispatch('")); - $event_name = substr($event_name, 0, strpos($event_name, "'")); - $arguments = array(); - } - - if ($event_line) - { - // Validate @event name - $find_event_line = 1; - while (strpos($lines[$event_line - $find_event_line], '* @event ') === false) - { - $find_event_line++; - - if ($find_event_line > min(50, $event_line)) - { - throw new LogicException('Can not find @event tag for event "' . $event_name . '" in file "' . $file . '"'); - } - } - $event_name_tag = substr(trim($lines[$event_line - $find_event_line]), strlen('* @event ')); - if ($event_name_tag !== $event_name) - { - throw new LogicException('Event name does not match @event tag for event "' . $event_name . '" in file "' . $file . '"'); - } - - // Find @since - $find_since_line = 1; - while (strpos($lines[$event_line - $find_since_line], '* @since ') === false) - { - $find_since_line++; - - if ($find_since_line > min(50, $event_line)) - { - throw new LogicException('Can not find @since tag for event "' . $event_name . '" in file "' . $file . '"'); - } - } - $since = substr(trim($lines[$event_line - $find_since_line]), strlen('* @since ')); - $since = ($since == '3.1-A1') ? '3.1.0-a1' : $since; - - // Find event description line - $find_description_line = 3; - while (strpos(trim($lines[$event_line - $find_description_line]), '*') === 0) - { - $find_description_line++; + case 'all': + echo '__FORCETOC__' . "\n"; - if ($find_description_line > min(50, $event_line)) - { - throw new LogicException('Can not find description-line for event "' . $event_name . '" in file "' . $file . '"'); - } - } - $description = substr(trim($lines[$event_line - $find_description_line + 1]), strlen('* ')); + case 'php': + $exporter = new \phpbb\event\php_exporter($phpbb_root_path, $extension); + $exporter->crawl_phpbb_directory_php(); + echo $exporter->export_events_for_wiki(); - $events[$event_name] = array( - 'event' => $event_name, - 'file' => $file, - 'arguments' => $arguments, - 'since' => $since, - 'description' => $description, - ); - } + if ($action === 'php') + { + break; } - } + echo "\n"; + // no break; - return $events; -} - -/** -* Returns a list of files in that directory -* -* Works recursive with any depth -* -* @param string $dir Directory to go through -* @return array List of files (including directories from within $dir -*/ -function get_file_list($dir, $path = '') -{ - try - { - $iterator = new \DirectoryIterator($dir); - } - catch (Exception $e) - { - return array(); - } + case 'styles': + $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension); + $exporter->crawl_phpbb_directory_styles('docs/events.md'); + echo $exporter->export_events_for_wiki(); - $files = array(); - foreach ($iterator as $file_info) - { - if ($file_info->isDot()) + if ($action === 'styles') { - continue; + break; } + echo "\n"; + // no break; - // Do not scan some directories - if ($file_info->isDir() && ( - ($path == '' && in_array($file_info->getFilename(), array('cache', 'develop', 'ext', 'files', 'language', 'store', 'vendor'))) - || ($path == '/includes' && in_array($file_info->getFilename(), array('utf'))) - || ($path == '/phpbb/db/migration' && in_array($file_info->getFilename(), array('data'))) - || ($path == '/phpbb' && in_array($file_info->getFilename(), array('event'))) - )) - { - continue; - } - else if ($file_info->isDir()) - { - $sub_dir = get_file_list($file_info->getPath() . '/' . $file_info->getFilename(), $path . '/' . $file_info->getFilename()); - foreach ($sub_dir as $file) - { - $files[] = $file_info->getFilename() . '/' . $file; - } - } - else if (substr($file_info->getFilename(), -4) == '.php') + case 'adm': + $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension); + $exporter->crawl_phpbb_directory_adm('docs/events.md'); + echo $exporter->export_events_for_wiki(); + + if ($action === 'all') { - $files[] = $file_info->getFilename(); + echo "\n" . '[[Category:Events and Listeners]]' . "\n"; } - } - - return $files; -} - -function validate_argument_count($arguments, $count) -{ - if ($arguments <= $count) - { - usage(); - } -} - -validate_argument_count($argc, 1); - -$action = $argv[1]; - -switch ($action) -{ - case 'acp': - export_from_eventsmd($phpbb_root_path, 'acp'); - break; - - case 'styles': - export_from_eventsmd($phpbb_root_path, 'styles'); - break; - - case 'php': - export_from_php($phpbb_root_path); - break; + break; default: usage(); diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php index 696b1e31c0..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. * */ diff --git a/phpBB/develop/generate_utf_casefold.php b/phpBB/develop/generate_utf_casefold.php index ad511a6153..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. * */ diff --git a/phpBB/develop/generate_utf_confusables.php b/phpBB/develop/generate_utf_confusables.php index 763d8ee875..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. * */ diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php index e5d907d6a5..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. * */ diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php index 02852798b6..5981882292 100644 --- a/phpBB/develop/lang_duplicates.php +++ b/phpBB/develop/lang_duplicates.php @@ -15,8 +15,11 @@ die("Please read the first lines of this script for instructions on how to enabl // ------------------------------------------------------------- // -// @copyright (c) 2005 phpBB Group -// @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +// @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. // // ------------------------------------------------------------- // Thanks to arod-1 diff --git a/phpBB/develop/merge_attachment_tables.php b/phpBB/develop/merge_attachment_tables.php index a66a395afa..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': diff --git a/phpBB/develop/merge_post_tables.php b/phpBB/develop/merge_post_tables.php index d687a292f2..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': @@ -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 diff --git a/phpBB/develop/migration_tips.php b/phpBB/develop/migration_tips.php deleted file mode 100644 index 51a579bdb5..0000000000 --- a/phpBB/develop/migration_tips.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** -* -* @package phpBB3 -* @copyright (c) 2013 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 -* -*/ - -// This is to help with creating migration files for new versions -// Use this to find what migrations are not depended on by any other migration -// (the current migration tree tips) - -define('IN_PHPBB', true); -$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.' . $phpEx); - -$phpbb_extension_manager = $phpbb_container->get('ext.manager'); -$finder = $phpbb_extension_manager->get_finder(); - -$migrations = $finder - ->core_path('phpbb/db/migration/data/') - ->get_classes(); -$tips = $migrations; - -foreach ($migrations as $migration_class) -{ - foreach ($migration_class::depends_on() as $dependency) - { - if (($tips_key = array_search($dependency, $tips)) !== false) - { - unset($tips[$tips_key]); - } - } -} - -foreach ($tips as $migration) -{ - echo "\t\t\t'{$migration}',\n"; -} - diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php index eb34034826..5c558f0b8e 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: // diff --git a/phpBB/develop/namespacify.php b/phpBB/develop/namespacify.php index 4e460eead8..447e87905e 100644 --- a/phpBB/develop/namespacify.php +++ b/phpBB/develop/namespacify.php @@ -1,8 +1,13 @@ <?php /** * -* @copyright (c) 2012 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. * */ diff --git a/phpBB/develop/rename_interfaces.php b/phpBB/develop/rename_interfaces.php index 11989350bb..90bf9cc205 100644 --- a/phpBB/develop/rename_interfaces.php +++ b/phpBB/develop/rename_interfaces.php @@ -1,8 +1,13 @@ <?php /** * -* @copyright (c) 2012 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. * */ diff --git a/phpBB/develop/strip_icc_profiles.sh b/phpBB/develop/strip_icc_profiles.sh new file mode 100755 index 0000000000..b11a63616b --- /dev/null +++ b/phpBB/develop/strip_icc_profiles.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# +# 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 ] +then + SCRIPT=$(basename "$0") + echo "Description: Finds and strips ICC Profiles from given image file." >&2 + echo "Usage: $SCRIPT /path/to/image/file" >&2 + echo "Exit Status: 0 if no ICC profiles have been stripped, otherwise 1." >&2 + echo "Requires: exiftool" >&2 + exit 1 +fi + +FILE=$1 +HASH_OLD=$(md5sum "$FILE") +exiftool -icc_profile"-<=" -overwrite_original_in_place "$FILE" > /dev/null 2>&1 +HASH_NEW=$(md5sum "$FILE") + +if [ "$HASH_OLD" != "$HASH_NEW" ] +then + echo "Stripped ICC Profile from $FILE." + exit 1 +fi diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php index af8556507f..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. * */ |
