roundcubemail/program/lib/Roundcube/rcube_imap_generic.php
public function countMessages($mailbox)
    {
        if ($this->selected === $mailbox && isset($this->data['EXISTS'])) {
            return $this->data['EXISTS'];
        }

        // Check internal cache
        $cache = $this->data['STATUS:'.$mailbox];
        if (!empty($cache) && isset($cache['MESSAGES'])) {
            return (int) $cache['MESSAGES'];
        }

        // Try STATUS (should be faster than SELECT)
        $counts = $this->status($mailbox);
        if (is_array($counts)) {
            return (int) $counts['MESSAGES'];
        }

        return false;
    }
public function countMessages($mailbox)
    {
        if ($this->selected === $mailbox && isset($this->data['EXISTS'])) {
            return $this->data['EXISTS'];
        }

        // Check internal cache
        $cache = $this->data['STATUS:'.$mailbox];
        if (!empty($cache) && isset($cache['MESSAGES'])) {
            return (int) $cache['MESSAGES'];
        }

        // Try STATUS (should be faster than SELECT)
        $counts = $this->status($mailbox);
        if (is_array($counts)) {
            return (int) $counts['MESSAGES'];
        }

        return false;
    }
public function countMessages ( $ mailbox ) { if ( $ this -> selected === $ mailbox && isset ( $ this -> data [ 'EXISTS' ] ) ) { return $ this -> data [ 'EXISTS' ] ; } // Check internal cache $ cache = $ this -> data [ 'STATUS:' . $ mailbox ] ; if ( ! empty ( $ cache ) && isset ( $ cache [ 'MESSAGES' ] ) ) { return ( int ) $ cache [ 'MESSAGES' ] ; } // Try STATUS (should be faster than SELECT) $ counts = $ this -> status ( $ mailbox ) ; if ( is_array ( $ counts ) ) { return ( int ) $ counts [ 'MESSAGES' ] ; } return false ; }
Returns count of all messages in a folder

@param string $mailbox Mailbox name

@return int Number of messages, False on error
Returns count of all messages in a folder