I was trying to execute shell commands from the Magento application and came across the following class class in the framework

\Magento\Framework\App\Shell and \Magento\Framework\Shell

Not sure between the difference between the two.

Wanted to know if the classes serve the same purpose or have there own set of use cases


A library with object-oriented interface for generation of shell commands. Provides an indirection layer that can be used for customizing or testing (mocking) exec() function.

Implements placeholders for command arguments that are automatically escaped in format appropriate to the current OS. Provides ability for logging/capturing the commands and their output.

  • Hey @anas-mansuri, I do understand the purpose of the having a class, don't understand why there are 2 of them – Atish Goswami Sep 3 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.