From 00294e3dae2840fa01acaf47db4e14ae08c0720a Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 5 Nov 2013 21:40:42 +0100 Subject: [ticket/11998] Turn develop/extensions.php into console commands. PHPBB3-11998 --- phpBB/develop/extensions.php | 129 ------------------------------------------- 1 file changed, 129 deletions(-) delete mode 100644 phpBB/develop/extensions.php (limited to 'phpBB/develop/extensions.php') diff --git a/phpBB/develop/extensions.php b/phpBB/develop/extensions.php deleted file mode 100644 index 43621f3080..0000000000 --- a/phpBB/develop/extensions.php +++ /dev/null @@ -1,129 +0,0 @@ -load_extensions(); - $all = array_keys($phpbb_extension_manager->all_available()); - - if (empty($all)) - { - echo "There were no extensions found.\n"; - exit(3); - } - - echo "Enabled:\n"; - $enabled = array_keys($phpbb_extension_manager->all_enabled()); - print_extensions($enabled); - echo "\n"; - - echo "Disabled:\n"; - $disabled = array_keys($phpbb_extension_manager->all_disabled()); - print_extensions($disabled); - echo "\n"; - - echo "Available:\n"; - $purged = array_diff($all, $enabled, $disabled); - print_extensions($purged); -} - -function print_extensions($exts) -{ - foreach ($exts as $ext) - { - echo "- $ext\n"; - } -} - -function enable_extension($name) -{ - global $phpbb_extension_manager; - - $phpbb_extension_manager->enable($name); -} - -function disable_extension($name) -{ - global $phpbb_extension_manager; - - $phpbb_extension_manager->disable($name); -} - -function purge_extension($name) -{ - global $phpbb_extension_manager; - - $phpbb_extension_manager->purge($name); -} - -function validate_argument_count($count) -{ - global $argv; - - if (count($argv) <= $count) - { - usage(); - } -} - -validate_argument_count(1); - -$action = $argv[1]; - -switch ($action) -{ - case 'list': - list_extensions(); - break; - - case 'enable': - validate_argument_count(2); - enable_extension($argv[2]); - break; - - case 'disable': - validate_argument_count(2); - disable_extension($argv[2]); - break; - - case 'purge': - validate_argument_count(2); - purge_extension($argv[2]); - break; - - default: - usage(); -} -- cgit v1.2.1