pass parameters in cli

23 views
Skip to first unread message

Giuseppe Realmuto

unread,
May 26, 2022, 6:23:02 PMMay 26
to Fusio
Hi,
it is possible pass parameter from route endpoint in action cli?
Thank you.
Best Regard!

Christoph Kappestein

unread,
May 27, 2022, 4:29:47 PMMay 27
to Fusio
Hi Giuseppe,

yes, so the CLI processor provides all uri fragment, query parameters and headers as environment variables to the command, so you can access those values as environment variable.

best regards
Christoph

Giuseppe Realmuto

unread,
May 30, 2022, 9:55:51 AMMay 30
to Fusio
Hi Cristoph, 
thanks for answer.
Can you show me an example?
Thank you.
Best Regard,
Giuseppe

Christoph Kappestein

unread,
Jun 2, 2022, 2:44:20 PMJun 2
to Fusio
Hi Giuseppe,

so you need then to access those environment variables inside the script which you invoke i.e. inside PHP you could use the "getenv" function. To see all available
env variables you could use a command like "printenv" which shows all available environment variables.

best regards
Christoph
Reply all
Reply to author
Forward
0 new messages