diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-04-18 12:51:45 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-04-18 12:57:39 +0200 |
commit | 3566325874a7d6da00ec7cd0e95543db34e1e811 (patch) | |
tree | b8cd7aa63dda9aad6b68f8b09027287627ea753c | |
parent | 17a1ed6fb59e36dcefa43d9755a69ab146e11576 (diff) | |
download | forums-3566325874a7d6da00ec7cd0e95543db34e1e811.tar forums-3566325874a7d6da00ec7cd0e95543db34e1e811.tar.gz forums-3566325874a7d6da00ec7cd0e95543db34e1e811.tar.bz2 forums-3566325874a7d6da00ec7cd0e95543db34e1e811.tar.xz forums-3566325874a7d6da00ec7cd0e95543db34e1e811.zip |
[ticket/12273] Fix export script
PHPBB3-12273
-rw-r--r-- | phpBB/develop/export_events_for_wiki.php | 59 |
1 files changed, 44 insertions, 15 deletions
diff --git a/phpBB/develop/export_events_for_wiki.php b/phpBB/develop/export_events_for_wiki.php index ff64dc493e..69b09ff136 100644 --- a/phpBB/develop/export_events_for_wiki.php +++ b/phpBB/develop/export_events_for_wiki.php @@ -13,20 +13,23 @@ if (php_sapi_name() != 'cli') $phpEx = substr(strrchr(__FILE__, '.'), 1); $phpbb_root_path = __DIR__ . '/../'; -require __DIR__ . '/../phpbb/event/exporter.' . $phpEx; function usage() { echo "Usage: export_events_for_wiki.php COMMAND\n"; echo "\n"; + echo "all:\n"; + echo " Generate the complete wikipage for https://wiki.phpbb.com/Event_List\n"; + echo "\n"; + echo "php:\n"; + echo " Generate the PHP event section of Event_List\n"; + echo "\n"; echo "acp:\n"; - echo " Export all events for files in the acp style.\n"; + echo " Generate the ACP Template 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 " Generate the Styles Template event section of Event_List\n"; echo "\n"; - echo "php:\n"; - echo " Export all events for php-files.\n"; exit(2); } @@ -41,22 +44,48 @@ function validate_argument_count($arguments, $count) validate_argument_count($argc, 1); $action = $argv[1]; -$exporter = new \phpbb\event\exporter($phpbb_root_path); +require __DIR__ . '/../phpbb/event/php_exporter.' . $phpEx; +require __DIR__ . '/../phpbb/event/md_exporter.' . $phpEx; switch ($action) { - case 'acp': - $exporter->export_from_eventsmd('acp'); - break; - - case 'styles': - $exporter->export_from_eventsmd('styles'); - break; + case 'all': + echo '__FORCETOC__' . "\n"; case 'php': + $exporter = new \phpbb\event\php_exporter($phpbb_root_path); $exporter->crawl_phpbb_directory_php(); - echo $exporter->export_php_events_for_wiki(); - break; + echo $exporter->export_events_for_wiki(); + + if ($action === 'php') + { + break; + } + echo "\n"; + // no break; + + case 'styles': + $exporter = new \phpbb\event\md_exporter($phpbb_root_path); + $exporter->crawl_eventsmd('docs/events.md', 'styles'); + echo $exporter->export_events_for_wiki(); + + if ($action === 'styles') + { + break; + } + echo "\n"; + // no break; + + case 'adm': + $exporter = new \phpbb\event\md_exporter($phpbb_root_path); + $exporter->crawl_eventsmd('docs/events.md', 'adm'); + echo $exporter->export_events_for_wiki(); + + if ($action === 'all') + { + echo "\n" . '[[Category:Events and Listeners]]' . "\n"; + } + break; default: usage(); |