Tests automatisch bei Aufruf über CLI ausführen

aus dem PHP Manual, user contributed notes:
class foo{}

$isCLI = (bool) ('cli'===php_sapi_name());
$isNI = (bool) (__FILE__===realpath(getcwd().DIRECTORY_SEPARATOR.$_SERVER['argv'][0]));
if( $isCLI && $isNI ) {
/* Bei direktem Aufruf aus der Konsole */
}

Comments are closed.