Back to index

awl  0.53
Public Member Functions | Static Public Attributes | Private Attributes
SinglePart Class Reference

List of all members.

Public Member Functions

 __construct ($content, $type='text/plain', $otherHeaders=array())
 render ()

Static Public Attributes

static $crlf = "\r\n"

Private Attributes

 $content
 $type
 $otherHeaders
 $disposition
 $id

Detailed Description

Definition at line 5 of file Multipart.php.


Constructor & Destructor Documentation

SinglePart::__construct ( content,
type = 'text/plain',
otherHeaders = array() 
)

Definition at line 14 of file Multipart.php.

                                                                              {
    $this->content = $content;
    $this->type = $type;
    $this->otherHeaders = $otherHeaders;
  }

Member Function Documentation

Definition at line 20 of file Multipart.php.

                    {
    $result = 'Content-Type: '.$this->type.self::$crlf;
    $encoded = false;
    foreach( $this->otherHeaders AS $header => $value ) {
      $result .= $header.': '.$value.self::$crlf;
      if ( $header == 'Content-Transfer-Encoding' ) $encoded = true;
    }

    if ( $encoded )
       return $result . self::$crlf . $content;

    return $result . 'Content-Transfer-Encoding: base64' . self::$crlf
                    . self::$crlf
                    . base64_encode($content);
  }

Member Data Documentation

Definition at line 6 of file Multipart.php.

SinglePart::$crlf = "\r\n" [static]

Definition at line 12 of file Multipart.php.

Definition at line 9 of file Multipart.php.

SinglePart::$id [private]

Definition at line 10 of file Multipart.php.

Definition at line 8 of file Multipart.php.

SinglePart::$type [private]

Definition at line 7 of file Multipart.php.


The documentation for this class was generated from the following file: