/** * Returns true if the class is being run from the command line, caches result * @since 1.0 * @static * @ignore * @return bool True if the script is being run from a CLI or false if its being run from a webserver */ private static function _is_cli() { if (is_null(self::$is_cli)) { self::$is_cli = php_sapi_name() == 'cli'; } return self::$is_cli; }