Logo Search packages:      
Sourcecode: d-push version File versions  Download package

Mail_mimeDecode::decode ( params = null )

Begins the decoding process. If called statically it will create an object and call the decode() method of it.

arrayAn array of various parameters that determine various things: include_bodies - Whether to include the body in the returned object. decode_bodies - Whether to decode the bodies of the parts. (Transfer encoding) decode_headers - Whether to decode headers input - If called statically, this will be treated as the input charset - convert all data to this charset
object Decoded results public

Definition at line 209 of file mimeDecode.php.

References _decode(), Mail_mimeDecode(), and raiseError().

        // determine if this method has been called statically
        $isStatic = !(isset($this) && get_class($this) == __CLASS__);

        // Have we been called statically?
        // If so, create an object and pass details to that.
        if ($isStatic AND isset($params['input'])) {

            $obj = new Mail_mimeDecode($params['input']);
            $structure = $obj->decode($params);

        // Called statically but no input
        } elseif ($isStatic) {
            return $this->raiseError('Called statically and no input given');

        // Called via an object
        } else {
            $this->_include_bodies = isset($params['include_bodies']) ?
                                 $params['include_bodies'] : false;
            $this->_decode_bodies  = isset($params['decode_bodies']) ?
                                 $params['decode_bodies']  : false;
            $this->_decode_headers = isset($params['decode_headers']) ?
                                 $params['decode_headers'] : false;
            $this->_rfc822_bodies  = isset($params['rfc_822bodies']) ?
                                 $params['rfc_822bodies']  : false;
            $this->_charset = isset($params['charset']) ?
                                 $params['charset'] : 'utf-8';

            $structure = $this->_decode($this->_header, $this->_body);
            if ($structure === false) {
                $structure = $this->raiseError($this->_error);

        return $structure;

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index