I am writing a module to perform some tasks based on whether the application is running in the console or in the context of HTTP. Is there any way to detect this when loading a module?
For example, I am trying to do this using the Module.php class.
namespace MyModule; use ... class Module { public function init(ModuleManager $mm) { if (Console context) { // do something } else { // do something with HTTP } } }
Thanks!
source share