From 6bd2a89efc56993331c1e6da705f3065f3867094 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 5 Nov 2013 19:10:33 +0100 Subject: [ticket/11998] Move application file to bin/phpbbcli.php PHPBB3-11998 --- phpBB/bin/phpbbcli.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 phpBB/bin/phpbbcli.php (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php new file mode 100644 index 0000000000..e367748fd9 --- /dev/null +++ b/phpBB/bin/phpbbcli.php @@ -0,0 +1,40 @@ +register(); +$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx); +$phpbb_class_loader_ext->register(); + +$phpbb_container = phpbb_create_update_container($phpbb_root_path, $phpEx, "$phpbb_root_path/config"); + +$application = new Application('phpBB Console', PHPBB_VERSION); +foreach($phpbb_container->findTaggedServiceIds('console.command') as $id => $void) +{ + $application->add($phpbb_container->get($id)); +} +$application->run(); -- cgit v1.2.1 From 73ea5daf97bf5447b9bb2ff912cce4a9ea21c58e Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 5 Nov 2013 19:42:34 +0100 Subject: [ticket/11998] Add phpBB abstraction for application and command. PHPBB3-11998 --- phpBB/bin/phpbbcli.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php index e367748fd9..05e2597960 100644 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -7,8 +7,6 @@ * */ -use Symfony\Component\Console\Application; - if (php_sapi_name() != 'cli') { echo 'This program must be run from the command line.' . PHP_EOL; @@ -32,9 +30,6 @@ $phpbb_class_loader_ext->register(); $phpbb_container = phpbb_create_update_container($phpbb_root_path, $phpEx, "$phpbb_root_path/config"); -$application = new Application('phpBB Console', PHPBB_VERSION); -foreach($phpbb_container->findTaggedServiceIds('console.command') as $id => $void) -{ - $application->add($phpbb_container->get($id)); -} +$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION); +$application->register_container_commands($phpbb_container); $application->run(); -- cgit v1.2.1 From e567f82d721917350c012908c06149da7a124668 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 12 Nov 2013 00:12:34 +0100 Subject: [ticket/11998] Make phpbbcli executable and add shebang PHPBB3-11998 --- phpBB/bin/phpbbcli.php | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 phpBB/bin/phpbbcli.php (limited to 'phpBB/bin/phpbbcli.php') diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php old mode 100644 new mode 100755 index 05e2597960..49f4ca13e7 --- a/phpBB/bin/phpbbcli.php +++ b/phpBB/bin/phpbbcli.php @@ -1,3 +1,4 @@ +#!/usr/bin/env php