I tried things like $_ENV[\'CLIENTNAME\'] == \'Console\' but that seems to work on only certain OS\'s (worked in windows, not linux).
I tried !empty($_ENV[\'SHELL\']) b
Check on http://php.net/manual/en/features.commandline.php#105568 "PHP_SAPI" Constant