src/Driver/ApcuCache.php
public static function isCli()
    {
        if (defined('STDIN')) {
            return true;
        }

        if (php_sapi_name() === 'cli') {
            return true;
        }

        if (array_key_exists('SHELL', $_ENV)) {
            return true;
        }

        if (empty($_SERVER['REMOTE_ADDR']) and !isset($_SERVER['HTTP_USER_AGENT']) and count($_SERVER['argv']) > 0) {
            return true;
        }

        if (!array_key_exists('REQUEST_METHOD', $_SERVER)) {
            return true;
        }

        return false;
    }
public static function isCli()
    {
        if (defined('STDIN')) {
            return true;
        }

        if (php_sapi_name() === 'cli') {
            return true;
        }

        if (array_key_exists('SHELL', $_ENV)) {
            return true;
        }

        if (empty($_SERVER['REMOTE_ADDR']) and !isset($_SERVER['HTTP_USER_AGENT']) and count($_SERVER['argv']) > 0) {
            return true;
        }

        if (!array_key_exists('REQUEST_METHOD', $_SERVER)) {
            return true;
        }

        return false;
    }
public static function isCli ( ) { if ( defined ( 'STDIN' ) ) { return true ; } if ( php_sapi_name ( ) === 'cli' ) { return true ; } if ( array_key_exists ( 'SHELL' , $ _ENV ) ) { return true ; } if ( empty ( $ _SERVER [ 'REMOTE_ADDR' ] ) and ! isset ( $ _SERVER [ 'HTTP_USER_AGENT' ] ) and count ( $ _SERVER [ 'argv' ] ) > 0 ) { return true ; } if ( ! array_key_exists ( 'REQUEST_METHOD' , $ _SERVER ) ) { return true ; } return false ; }
Determines whether the script is being run on the CLI.

@todo This method MUST be move to a helper.

@return bool
Determines whether the script is being run on the CLI .