kernel/classes/datatypes/ezuser/ezuser.php
static function fetchAnonymousCount()
    {
        if ( isset( $GLOBALS['eZSiteBasics']['no-cache-adviced'] ) and
             !$GLOBALS['eZSiteBasics']['no-cache-adviced'] and
             isset( $GLOBALS['eZUserAnonymousCount'] ) )
            return $GLOBALS['eZUserAnonymousCount'];
        $db = eZDB::instance();
        $time = time();
        $ini = eZINI::instance();
        $activityTimeout = $ini->variable( 'Session', 'ActivityTimeout' );
        $sessionTimeout = $ini->variable( 'Session', 'SessionTimeout' );
        $time = $time + $sessionTimeout - $activityTimeout;

        $sql = "SELECT count( session_key ) as count
FROM ezsession
WHERE user_id = '" . self::anonymousId() . "' AND
      expiration_time > '$time'";
        $rows = $db->arrayQuery( $sql );
        $count = isset( $rows[0] ) ? $rows[0]['count'] : 0;
        $GLOBALS['eZUserAnonymousCount'] = $count;
        return $count;
    }
static function fetchAnonymousCount()
    {
        if ( isset( $GLOBALS['eZSiteBasics']['no-cache-adviced'] ) and
             !$GLOBALS['eZSiteBasics']['no-cache-adviced'] and
             isset( $GLOBALS['eZUserAnonymousCount'] ) )
            return $GLOBALS['eZUserAnonymousCount'];
        $db = eZDB::instance();
        $time = time();
        $ini = eZINI::instance();
        $activityTimeout = $ini->variable( 'Session', 'ActivityTimeout' );
        $sessionTimeout = $ini->variable( 'Session', 'SessionTimeout' );
        $time = $time + $sessionTimeout - $activityTimeout;

        $sql = "SELECT count( session_key ) as count
FROM ezsession
WHERE user_id = '" . self::anonymousId() . "' AND
      expiration_time > '$time'";
        $rows = $db->arrayQuery( $sql );
        $count = isset( $rows[0] ) ? $rows[0]['count'] : 0;
        $GLOBALS['eZUserAnonymousCount'] = $count;
        return $count;
    }
static function fetchAnonymousCount ( ) { if ( isset ( $ GLOBALS [ 'eZSiteBasics' ] [ 'no-cache-adviced' ] ) and ! $ GLOBALS [ 'eZSiteBasics' ] [ 'no-cache-adviced' ] and isset ( $ GLOBALS [ 'eZUserAnonymousCount' ] ) ) return $ GLOBALS [ 'eZUserAnonymousCount' ] ; $ db = eZDB :: instance ( ) ; $ time = time ( ) ; $ ini = eZINI :: instance ( ) ; $ activityTimeout = $ ini -> variable ( 'Session' , 'ActivityTimeout' ) ; $ sessionTimeout = $ ini -> variable ( 'Session' , 'SessionTimeout' ) ; $ time = $ time + $ sessionTimeout - $ activityTimeout ; $ sql = "SELECT count( session_key ) as count
FROM ezsession
WHERE user_id = '" . self :: anonymousId ( ) . "' AND
      expiration_time > '$time'" ; $ rows = $ db -> arrayQuery ( $ sql ) ; $ count = isset ( $ rows [ 0 ] ) ? $ rows [ 0 ] [ 'count' ] : 0 ; $ GLOBALS [ 'eZUserAnonymousCount' ] = $ count ; return $ count ; }
Return the number of anonymous users in the system.

@deprecated As of 4.4 since default session handler does not support this.
@return int
Return the number of anonymous users in the system .