roundcubemail/program/lib/Roundcube/rcube_result_thread.php
public function init($data = null)
    {
        $this->meta = array();

        $data = explode('*', (string)$data);

        // ...skip unilateral untagged server responses
        for ($i=0, $len=count($data); $i<$len; $i++) {
            if (preg_match('/^ THREAD/i', $data[$i])) {
                // valid response, initialize raw_data for is_error()
                $this->raw_data = '';
                $data[$i] = substr($data[$i], 7);
                break;
            }

            unset($data[$i]);
        }

        if (empty($data)) {
            return;
        }

        $data = array_shift($data);
        $data = trim($data);
        $data = preg_replace('/[\r\n]/', '', $data);
        $data = preg_replace('/\s+/', ' ', $data);

        $this->raw_data = $this->parse_thread($data);
    }
public function init($data = null)
    {
        $this->meta = array();

        $data = explode('*', (string)$data);

        // ...skip unilateral untagged server responses
        for ($i=0, $len=count($data); $i<$len; $i++) {
            if (preg_match('/^ THREAD/i', $data[$i])) {
                // valid response, initialize raw_data for is_error()
                $this->raw_data = '';
                $data[$i] = substr($data[$i], 7);
                break;
            }

            unset($data[$i]);
        }

        if (empty($data)) {
            return;
        }

        $data = array_shift($data);
        $data = trim($data);
        $data = preg_replace('/[\r\n]/', '', $data);
        $data = preg_replace('/\s+/', ' ', $data);

        $this->raw_data = $this->parse_thread($data);
    }
public function init ( $ data = null ) { $ this -> meta = array ( ) ; $ data = explode ( '*' , ( string ) $ data ) ; // ...skip unilateral untagged server responses for ( $ i = 0 , $ len = count ( $ data ) ; $ i < $ len ; $ i ++ ) { if ( preg_match ( '/^ THREAD/i' , $ data [ $ i ] ) ) { // valid response, initialize raw_data for is_error() $ this -> raw_data = '' ; $ data [ $ i ] = substr ( $ data [ $ i ] , 7 ) ; break ; } unset ( $ data [ $ i ] ) ; } if ( empty ( $ data ) ) { return ; } $ data = array_shift ( $ data ) ; $ data = trim ( $ data ) ; $ data = preg_replace ( '/[\r\n]/' , '' , $ data ) ; $ data = preg_replace ( '/\s+/' , ' ' , $ data ) ; $ this -> raw_data = $ this -> parse_thread ( $ data ) ; }
Initializes object with IMAP command response

@param string $data IMAP response string
Initializes object with IMAP command response