TYPO3  7.6
classes/Swift/Preferences.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of SwiftMailer.
5  * (c) 2004-2009 Chris Corbyn
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10 
17 {
19  private static $_instance = null;
20 
22  private function __construct()
23  {
24  }
25 
31  public static function getInstance()
32  {
33  if (!isset(self::$_instance)) {
34  self::$_instance = new self();
35  }
36 
37  return self::$_instance;
38  }
39 
47  public function setCharset($charset)
48  {
50  ->register('properties.charset')->asValue($charset);
51 
52  return $this;
53  }
54 
62  public function setTempDir($dir)
63  {
65  ->register('tempdir')->asValue($dir);
66 
67  return $this;
68  }
69 
77  public function setCacheType($type)
78  {
80  ->register('cache')->asAliasOf(sprintf('cache.%s', $type));
81 
82  return $this;
83  }
84 
92  public function setQPDotEscape($dotEscape)
93  {
94  $dotEscape = !empty($dotEscape);
96  ->register('mime.qpcontentencoder')
97  ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoder')
98  ->withDependencies(array('mime.charstream', 'mime.bytecanonicalizer'))
99  ->addConstructorValue($dotEscape);
100 
101  return $this;
102  }
103 }