roundcubemail/program/lib/Roundcube/rcube_imap_generic.php
public function index($mailbox, $message_set, $index_field='', $skip_deleted=true,
        $uidfetch=false, $return_uid=false)
    {
        $msg_index = $this->fetchHeaderIndex($mailbox, $message_set,
            $index_field, $skip_deleted, $uidfetch, $return_uid);

        if (!empty($msg_index)) {
            asort($msg_index); // ASC
            $msg_index = array_keys($msg_index);
            $msg_index = '* SEARCH ' . implode(' ', $msg_index);
        }
        else {
            $msg_index = is_array($msg_index) ? '* SEARCH' : null;
        }

        return new rcube_result_index($mailbox, $msg_index);
    }
public function index($mailbox, $message_set, $index_field='', $skip_deleted=true,
        $uidfetch=false, $return_uid=false)
    {
        $msg_index = $this->fetchHeaderIndex($mailbox, $message_set,
            $index_field, $skip_deleted, $uidfetch, $return_uid);

        if (!empty($msg_index)) {
            asort($msg_index); // ASC
            $msg_index = array_keys($msg_index);
            $msg_index = '* SEARCH ' . implode(' ', $msg_index);
        }
        else {
            $msg_index = is_array($msg_index) ? '* SEARCH' : null;
        }

        return new rcube_result_index($mailbox, $msg_index);
    }
public function index ( $ mailbox , $ message_set , $ index_field = '' , $ skip_deleted = true , $ uidfetch = false , $ return_uid = false ) { $ msg_index = $ this -> fetchHeaderIndex ( $ mailbox , $ message_set , $ index_field , $ skip_deleted , $ uidfetch , $ return_uid ) ; if ( ! empty ( $ msg_index ) ) { asort ( $ msg_index ) ; // ASC $ msg_index = array_keys ( $ msg_index ) ; $ msg_index = '* SEARCH ' . implode ( ' ' , $ msg_index ) ; } else { $ msg_index = is_array ( $ msg_index ) ? '* SEARCH' : null ; } return new rcube_result_index ( $ mailbox , $ msg_index ) ; }
Simulates SORT command by using FETCH and sorting.

@param string       $mailbox      Mailbox name
@param string|array $message_set  Searching criteria (list of messages to return)
@param string       $index_field  Field to sort by (ARRIVAL, CC, DATE, FROM, SIZE, SUBJECT, TO)
@param bool         $skip_deleted Makes that DELETED messages will be skipped
@param bool         $uidfetch     Enables UID FETCH usage
@param bool         $return_uid   Enables returning UIDs instead of IDs

@return rcube_result_index Response data
Simulates SORT command by using FETCH and sorting .