[TYPO3-team-core-v5] Autodetection for CLI- or HTML-Output

Malte Jansen mail at maltejansen.de
Wed Oct 8 18:29:00 CEST 2008


Hi!

What about an autodection for checking if the CLI available.

I just found these lines:

// if $_ENV['SHELL'] exists, we're probably in command line mode
if (array_key_exists('SHELL', $_ENV)) {
$this->setOutputMode(MYSQLICIOUS_OUTPUT_CMD);
} else {
$this->setOutputMode(MYSQLICIOUS_OUTPUT_HTML);
}

Source:http://www.yabfog.com/wp/2007/08/23/php-command-line-mode-detection

Perhaps this could be an option...

Cheers,

Malte


More information about the TYPO3-team-core-v5 mailing list