Documentation

Horde_Mime_Headers_ContentParam_ContentType extends Horde_Mime_Headers_ContentParam
in package

This class represents a Content-Type MIME header (RFC 2045).

Tags
author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

2015-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

since
2.8.0

Table of Contents

DEFAULT_CONTENT_TYPE  = 'application/octet-stream'
$full_value  : string
$name  : string
$params  : array<string|int, mixed>
$ptype  : string
$stype  : string
$type_charset  : string
$value  : string
$value_single  : string
$_name  : string
Header name (UTF-8, although limited to US-ASCII subset by RFCs).
$_params  : Horde_Support_CaseInsensitiveArray
Content parameters.
$_values  : array<string|int, mixed>
Header values.
__clone()  : mixed
__construct()  : mixed
__get()  : mixed
__serialize()  : array<string|int, mixed>
Serialize (PHP 7.4+)
__toString()  : mixed
__unserialize()  : void
Unserialize (PHP 7.4+)
create()  : Horde_Mime_Headers_ContentParam_ContentType
Creates a default Content-Type header, conforming to the MIME specification as detailed in RFC 2045.
decode()  : mixed
Decodes a MIME content parameter string pursuant to RFC 2183 & 2231 (Content-Type and Content-Disposition headers).
encode()  : array<string|int, mixed>
Encodes a MIME content parameter string pursuant to RFC 2183 & 2231 (Content-Type and Content-Disposition headers).
getHandles()  : array<string|int, mixed>
Return list of explicit header names handled by this driver.
getIterator()  : mixed
isDefault()  : mixed
offsetExists()  : bool
offsetGet()  : mixed
offsetSet()  : void
offsetUnset()  : void
sendEncode()  : array<string|int, mixed>
Returns the encoded string value(s) needed when sending the header text to a RFC compliant mail submission server.
serialize()  : string
Serialize (until PHP 7.3)
setContentParamValue()  : mixed
Set the content-parameter base value.
setValue()  : mixed
Set the value of the header.
unserialize()  : mixed
Unserialize (until PHP 7.3)
_encode()  : mixed
_escapeParams()  : array<string|int, mixed>
Escape the parameter array.
_sanityCheck()  : string
Perform sanity checking on a header value.
_sendEncode()  : mixed
TODO
_setValue()  : mixed
TODO

Constants

DEFAULT_CONTENT_TYPE

public mixed DEFAULT_CONTENT_TYPE = 'application/octet-stream'

Properties

$full_value read-only

public string $full_value

Full header value.

$name read-only

public string $name

Header name.

$params read-only

public array<string|int, mixed> $params

Content parameters.

$ptype read-only

public string $ptype

The primary type.

$type_charset read-only

public string $type_charset

The MIME type with the charset parameter added (if this is a text/* part).

$value read-only

public string $value

Header value.

$value_single read-only

public string $value_single

The first header value.

$_name

Header name (UTF-8, although limited to US-ASCII subset by RFCs).

protected string $_name

$_params

Content parameters.

protected Horde_Support_CaseInsensitiveArray $_params

$_values

Header values.

protected array<string|int, mixed> $_values = array()

Methods

__clone()

public __clone() : mixed
Return values
mixed

__construct()

public __construct(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed
Return values
mixed

__get()

public __get(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

__serialize()

Serialize (PHP 7.4+)

public __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

object state

__toString()

public __toString() : mixed
Return values
mixed

__unserialize()

Unserialize (PHP 7.4+)

public __unserialize(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>
Return values
void

decode()

Decodes a MIME content parameter string pursuant to RFC 2183 & 2231 (Content-Type and Content-Disposition headers).

public decode(mixed $data) : mixed

Stores value/parameter data in the current object.

Parameters
$data : mixed

Parameter data. Either an array or a string.

Return values
mixed

encode()

Encodes a MIME content parameter string pursuant to RFC 2183 & 2231 (Content-Type and Content-Disposition headers).

public encode([array<string|int, mixed> $opts = array() ]) : array<string|int, mixed>
Parameters
$opts : array<string|int, mixed> = array()

Options:

  • broken_rfc2231: (boolean) Attempt to work around non-RFC 2231-compliant MUAs by generating both a RFC 2047-like parameter name and also the correct RFC 2231 parameter DEFAULT: false
  • charset: (string) The charset to encode to. DEFAULT: UTF-8
  • lang: (string) The language to use when encoding. DEFAULT: None specified
Return values
array<string|int, mixed>

The encoded parameter string (US-ASCII).

getHandles()

Return list of explicit header names handled by this driver.

public static getHandles() : array<string|int, mixed>
Return values
array<string|int, mixed>

Header list.

getIterator()

public getIterator() : mixed
Return values
mixed

isDefault()

public isDefault() : mixed
Return values
mixed

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed
Return values
mixed

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Return values
void

offsetUnset()

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Return values
void

sendEncode()

Returns the encoded string value(s) needed when sending the header text to a RFC compliant mail submission server.

public final sendEncode([array<string|int, mixed> $opts = array() ]) : array<string|int, mixed>
Parameters
$opts : array<string|int, mixed> = array()

Additional options:

  • charset: (string) Charset to encode to. DEFAULT: UTF-8
Return values
array<string|int, mixed>

An array of string values.

serialize()

Serialize (until PHP 7.3)

public serialize() : string
Return values
string

serialized object state

setContentParamValue()

Set the content-parameter base value.

public setContentParamValue(mixed $data) : mixed
Parameters
$data : mixed

Value.

Return values
mixed

setValue()

Set the value of the header.

public final setValue(mixed $value) : mixed
Parameters
$value : mixed

Header value(s).

Return values
mixed

unserialize()

Unserialize (until PHP 7.3)

public unserialize(string $data) : mixed
Parameters
$data : string
Return values
mixed

_encode()

protected _encode(mixed $name, mixed $val, mixed $opts) : mixed
Parameters
$name : mixed
$val : mixed
$opts : mixed
Tags
see
encode()
Return values
mixed

_escapeParams()

Escape the parameter array.

protected _escapeParams(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

Parameter array.

Return values
array<string|int, mixed>

Escaped parameter array.

_sanityCheck()

Perform sanity checking on a header value.

protected _sanityCheck(string $data) : string
Parameters
$data : string

The header data.

Return values
string

The cleaned header data.

_sendEncode()

TODO

protected _sendEncode(mixed $opts) : mixed
Parameters
$opts : mixed
Return values
mixed

_setValue()

TODO

protected abstract _setValue(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

Search results