diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-10-26 18:03:46 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-10-26 18:03:46 +0200 |
commit | 35dff79cd823e208989611b34ef76b4f1978f8b3 (patch) | |
tree | 7a5b71010497336008058532ddce11ef257e4706 /phpBB/develop | |
parent | 91eeebfb07e416d21d9c4fe57e0387f3b075024d (diff) | |
download | forums-35dff79cd823e208989611b34ef76b4f1978f8b3.tar forums-35dff79cd823e208989611b34ef76b4f1978f8b3.tar.gz forums-35dff79cd823e208989611b34ef76b4f1978f8b3.tar.bz2 forums-35dff79cd823e208989611b34ef76b4f1978f8b3.tar.xz forums-35dff79cd823e208989611b34ef76b4f1978f8b3.zip |
[ticket/11924] Do not use globals :(
PHPBB3-11924
Diffstat (limited to 'phpBB/develop')
-rw-r--r-- | phpBB/develop/export_events_for_wiki.php | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/phpBB/develop/export_events_for_wiki.php b/phpBB/develop/export_events_for_wiki.php index cce5939f48..d0ea9db285 100644 --- a/phpBB/develop/export_events_for_wiki.php +++ b/phpBB/develop/export_events_for_wiki.php @@ -24,9 +24,8 @@ function usage() exit(2); } -function export_from_eventsmd($filter) +function export_from_eventsmd($phpbb_root_path, $filter) { - global $phpbb_root_path; $file_content = file_get_contents($phpbb_root_path . 'docs/events.md'); $events = explode("\n\n", $file_content); @@ -73,15 +72,13 @@ function export_from_eventsmd($filter) } } -function export_from_php() +function export_from_php($phpbb_root_path) { - global $phpbb_root_path; - $files = get_file_list($phpbb_root_path); $events = array(); foreach ($files as $file) { - $file_events = check_for_events($file); + $file_events = check_for_events($phpbb_root_path, $file); if (!empty($file_events)) { $events = array_merge($events, $file_events); @@ -97,10 +94,8 @@ function export_from_php() } } -function check_for_events($file) +function check_for_events($phpbb_root_path, $file) { - global $phpbb_root_path; - $events = array(); $content = file_get_contents($phpbb_root_path . $file); @@ -276,32 +271,30 @@ function get_file_list($dir, $path = '') return $files; } -function validate_argument_count($count) +function validate_argument_count($arguments, $count) { - global $argv; - - if (count($argv) <= $count) + if ($arguments <= $count) { usage(); } } -validate_argument_count(1); +validate_argument_count($argc, 1); $action = $argv[1]; switch ($action) { case 'acp': - export_from_eventsmd('acp'); + export_from_eventsmd($phpbb_root_path, 'acp'); break; case 'styles': - export_from_eventsmd('styles'); + export_from_eventsmd($phpbb_root_path, 'styles'); break; case 'php': - export_from_php(); + export_from_php($phpbb_root_path); break; default: |