Skip to content
Advertisement

symfony2 get command line executed

I am creating a console command in symfony2. I need to log an executed line i run. How to get that line?

So if i run:

JavaScript

I want to get value “php app/console my-command fileName.txt –myoption=100”

Thanks for any help

Advertisement

Answer

I’m interpreting the question as: Within the Command code itself, you want to determine what was written on the command line in order to end up executing that Symfony Command?

If that’s correct, then I don’t think it’s possible to get it exactly. However, you should be able to get [almost?] the same effect by doing this:

JavaScript

Example:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement