Class Swift_Plugin_Decorator

Description

Implements interfaces:

Swift Decorator Plugin.

Allows messages to be slightly different for each recipient.

Located in /Swift/Plugin/Decorator.php (line 23)


	
			
Variable Summary
Method Summary
Swift_Plugin_Decorator __construct ([mixed $replacements = null])
void addPermittedType (string $type)
void beforeSendPerformed ( $e)
boolean isPermittedType (string $type)
void recursiveReplace ( $mime, array $replacements, array &$store)
void recursiveRestore ( $mime, array &$store)
void removePermittedType (string $type)
string replace (array $replacements, string $value)
void setPermittedInHeaders (boolean $bool)
void setReplacements (mixed $replacements)
Variables
boolean $permittedInHeaders = true (line 44)

True if values in the headers can be replaced

  • access: protected
array $permittedTypes = array("text/plain" => 1, "text/html" => 1) (line 39)

A list of allowed mime types to replace bodies for.

  • access: protected
Swift_Plugin_Decorator_Replacements $replacements (line 29)

The replacements object.

  • access: protected
array $store (line 34)

Temporary storage so we can restore changes we make.

  • access: protected
Methods
Constructor __construct (line 50)

Ctor.

  • access: public
Swift_Plugin_Decorator __construct ([mixed $replacements = null])
  • mixed $replacements: Replacements as a 2-d array or Swift_Plugin_Decorator_Replacements instance.
addPermittedType (line 74)

Add a mime type to the list of permitted type to replace values in the body.

  • access: public
void addPermittedType (string $type)
  • string $type: The mime type (e.g. text/plain)
beforeSendPerformed (line 109)

Called just before Swift sends a message.

We perform operations on the message here.

  • access: public
void beforeSendPerformed ( $e)
getPermittedInHeaders (line 66)

Check if replacements in headers are allowed.

  • access: public
boolean getPermittedInHeaders ()
getPermittedTypes (line 91)

Get the list of mime types for which the body can be changed.

  • access: public
array getPermittedTypes ()
getReplacements (line 255)

Get the replacements object.

  • access: public
isPermittedType (line 100)

Check if the body can be replaced in the given mime type.

  • access: public
boolean isPermittedType (string $type)
  • string $type: The mime type
recursiveReplace (line 134)

Replace strings in the message searching through all the allowed sub-parts.

  • access: protected
void recursiveReplace ( $mime, array $replacements, array &$store)
  • Swift_Message_Mime $mime: The message (or part)
  • array $replacements: The list of replacements
  • array &$store: The array to cache original values into where needed
recursiveRestore (line 198)

Put the original values back in the message after it was modified before sending.

  • access: protected
void recursiveRestore ( $mime, array &$store)
  • Swift_Message_Mime $mime: The message (or part)
  • array &$store: The location of the stored values
removePermittedType (line 83)

Remove the ability to replace values in the body of the given mime type

  • access: public
void removePermittedType (string $type)
  • string $type: The mime type
replace (line 189)

Perform a str_replace() over the given value.

  • access: protected
string replace (array $replacements, string $value)
  • array $replacements: The list of replacements as (search => replacement)
  • string $value: The string to replace
setPermittedInHeaders (line 58)

Enable of disable the ability to replace values in the headers

  • access: public
void setPermittedInHeaders (boolean $bool)
  • boolean $bool
setReplacements (line 230)

Set the replacements as a 2-d array or an instance of Swift_Plugin_Decorator_Replacements.

  • access: public
void setReplacements (mixed $replacements)
  • mixed $replacements: Array or Swift_Plugin_Decorator_Replacements

Documentation generated on Wed, 26 Mar 2008 20:33:05 +1100 by phpDocumentor 1.3.1