mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-18 07:31:32 +02:00
.github
build
git-tools
phpBB
adm
assets
bin
cache
config
develop
add_permissions.php
adjust_avatars.php
adjust_bbcodes.php
adjust_magic_urls.php
adjust_sizes.php
adjust_smilies.php
adjust_uids.php
adjust_usernames.php
benchmark.php
blank.gif
blank.jpg
change_smiley_ref.php
check_flash_bbcodes.php
collect_cache_stats.sh
create_schema_files.php
create_search_index.php
create_variable_overview.php
export_events_for_wiki.php
fill.php
fix_files.sh
generate_utf_casefold.php
generate_utf_confusables.php
generate_utf_tables.php
imageset_to_css.php
lang_duplicates.php
lang_migrate_help_lang.php
merge_attachment_tables.php
merge_post_tables.php
namespacify.php
nuke-db.php
regex.php
regex_idn.php
remove-php-end-tags.py
rename_interfaces.php
repair_bots.php
search_fill.php
set_permissions.sh
strip_icc_profiles.sh
test.gif
unicode_testing.php
docs
download
ext
files
images
includes
install
language
phpbb
store
styles
vendor-ext
.htaccess
app.php
common.php
composer-ext.json
composer-ext.lock
composer.json
composer.lock
cron.php
faq.php
feed.php
index.php
mcp.php
memberlist.php
posting.php
report.php
search.php
ucp.php
viewforum.php
viewonline.php
viewtopic.php
web.config
tests
travis
vagrant
.appveyor.yml
.editorconfig
.gitignore
.jscsrc
.jshintrc
.postcss-sorting.json
.stylelintrc
.travis.yml
LICENSE
README.md
Vagrantfile
composer.phar
gulpfile.js
package-lock.json
package.json
phpunit.xml.dist
139 lines
3.3 KiB
PHP
139 lines
3.3 KiB
PHP
<?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();
|
|
}
|