XF 2.0 Add more features to the CLI functions

Jean-Baptiste

Well-known member
Hello,

I have two questions :

1) How can I extend the built-in cli commands to run a function ?
2) How can I call from the CLI, a controller / action ?

Best regards,
 
In your add on just create a Cli folder and put your command in there.

CLI commands are totally stand alone so you can’t call controllers like the public and admin apps can.
 
In your add on just create a Cli folder and put your command in there.

CLI commands are totally stand alone so you can’t call controllers like the public and admin apps can.

How do the cmd.php file will find out the class in your Cli folder ?

I created a class, but it's not detected by cmd.php .
 
Apologies it would need to be created in your add-on's Cli\Command folder.

The command system knows which directories to scan for command code, including any Cli\Command directory of any add-on directory.
 
Apologies it would need to be created in your add-on's Cli\Command folder.

The command system knows which directories to scan for command code, including any Cli\Command directory of any add-on directory.

And how would you call invoke a controller and ont of it's action ?
 
Back
Top Bottom