Command Line InterfaceΒΆ
Group Office also has a Command Line Interface. To implement this do the following:
Create a controller that extends the abstract CLI controller in your module:
<?php namespace go\modules\community\music\controller; use go\core\cli\Controller; class CliDemo extends Controller { public function hello($name = "World") { echo "Hello $name!\n"; } }Run:
docker-compose exec --user www-data groupoffice php /usr/local/share/groupoffice/cli.php community/music/clidemo/hello --name=Merijn
This should output:
Hello Merijn!
Note
Command line methods always run as the administrator user.