@@ -3,132 +3,132 @@ |
||
3 | 3 | require __DIR__.'/../mime_types.php'; |
4 | 4 | |
5 | 5 | Swift_DependencyContainer::getInstance() |
6 | - ->register('properties.charset') |
|
7 | - ->asValue('utf-8') |
|
8 | - |
|
9 | - ->register('email.validator') |
|
10 | - ->asSharedInstanceOf('Egulias\EmailValidator\EmailValidator') |
|
11 | - |
|
12 | - ->register('mime.idgenerator.idright') |
|
13 | - // As SERVER_NAME can come from the user in certain configurations, check that |
|
14 | - // it does not contain forbidden characters (see RFC 952 and RFC 2181). Use |
|
15 | - // preg_replace() instead of preg_match() to prevent DoS attacks with long host names. |
|
16 | - ->asValue(!empty($_SERVER['SERVER_NAME']) && '' === preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/', '', $_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'swift.generated') |
|
17 | - |
|
18 | - ->register('mime.idgenerator') |
|
19 | - ->asSharedInstanceOf('Swift_Mime_IdGenerator') |
|
20 | - ->withDependencies([ |
|
21 | - 'mime.idgenerator.idright', |
|
22 | - ]) |
|
23 | - |
|
24 | - ->register('mime.message') |
|
25 | - ->asNewInstanceOf('Swift_Mime_SimpleMessage') |
|
26 | - ->withDependencies([ |
|
27 | - 'mime.headerset', |
|
28 | - 'mime.textcontentencoder', |
|
29 | - 'cache', |
|
30 | - 'mime.idgenerator', |
|
31 | - 'properties.charset', |
|
32 | - ]) |
|
33 | - |
|
34 | - ->register('mime.part') |
|
35 | - ->asNewInstanceOf('Swift_Mime_MimePart') |
|
36 | - ->withDependencies([ |
|
37 | - 'mime.headerset', |
|
38 | - 'mime.textcontentencoder', |
|
39 | - 'cache', |
|
40 | - 'mime.idgenerator', |
|
41 | - 'properties.charset', |
|
42 | - ]) |
|
43 | - |
|
44 | - ->register('mime.attachment') |
|
45 | - ->asNewInstanceOf('Swift_Mime_Attachment') |
|
46 | - ->withDependencies([ |
|
47 | - 'mime.headerset', |
|
48 | - 'mime.base64contentencoder', |
|
49 | - 'cache', |
|
50 | - 'mime.idgenerator', |
|
51 | - ]) |
|
52 | - ->addConstructorValue($swift_mime_types) |
|
53 | - |
|
54 | - ->register('mime.embeddedfile') |
|
55 | - ->asNewInstanceOf('Swift_Mime_EmbeddedFile') |
|
56 | - ->withDependencies([ |
|
57 | - 'mime.headerset', |
|
58 | - 'mime.base64contentencoder', |
|
59 | - 'cache', |
|
60 | - 'mime.idgenerator', |
|
61 | - ]) |
|
62 | - ->addConstructorValue($swift_mime_types) |
|
63 | - |
|
64 | - ->register('mime.headerfactory') |
|
65 | - ->asNewInstanceOf('Swift_Mime_SimpleHeaderFactory') |
|
66 | - ->withDependencies([ |
|
67 | - 'mime.qpheaderencoder', |
|
68 | - 'mime.rfc2231encoder', |
|
69 | - 'email.validator', |
|
70 | - 'properties.charset', |
|
71 | - 'address.idnaddressencoder', |
|
72 | - ]) |
|
73 | - |
|
74 | - ->register('mime.headerset') |
|
75 | - ->asNewInstanceOf('Swift_Mime_SimpleHeaderSet') |
|
76 | - ->withDependencies(['mime.headerfactory', 'properties.charset']) |
|
77 | - |
|
78 | - ->register('mime.qpheaderencoder') |
|
79 | - ->asNewInstanceOf('Swift_Mime_HeaderEncoder_QpHeaderEncoder') |
|
80 | - ->withDependencies(['mime.charstream']) |
|
81 | - |
|
82 | - ->register('mime.base64headerencoder') |
|
83 | - ->asNewInstanceOf('Swift_Mime_HeaderEncoder_Base64HeaderEncoder') |
|
84 | - ->withDependencies(['mime.charstream']) |
|
85 | - |
|
86 | - ->register('mime.charstream') |
|
87 | - ->asNewInstanceOf('Swift_CharacterStream_NgCharacterStream') |
|
88 | - ->withDependencies(['mime.characterreaderfactory', 'properties.charset']) |
|
89 | - |
|
90 | - ->register('mime.bytecanonicalizer') |
|
91 | - ->asSharedInstanceOf('Swift_StreamFilters_ByteArrayReplacementFilter') |
|
92 | - ->addConstructorValue([[0x0D, 0x0A], [0x0D], [0x0A]]) |
|
93 | - ->addConstructorValue([[0x0A], [0x0A], [0x0D, 0x0A]]) |
|
94 | - |
|
95 | - ->register('mime.characterreaderfactory') |
|
96 | - ->asSharedInstanceOf('Swift_CharacterReaderFactory_SimpleCharacterReaderFactory') |
|
97 | - |
|
98 | - ->register('mime.textcontentencoder') |
|
99 | - ->asAliasOf('mime.qpcontentencoder') |
|
100 | - |
|
101 | - ->register('mime.safeqpcontentencoder') |
|
102 | - ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoder') |
|
103 | - ->withDependencies(['mime.charstream', 'mime.bytecanonicalizer']) |
|
104 | - |
|
105 | - ->register('mime.rawcontentencoder') |
|
106 | - ->asNewInstanceOf('Swift_Mime_ContentEncoder_RawContentEncoder') |
|
107 | - |
|
108 | - ->register('mime.nativeqpcontentencoder') |
|
109 | - ->withDependencies(['properties.charset']) |
|
110 | - ->asNewInstanceOf('Swift_Mime_ContentEncoder_NativeQpContentEncoder') |
|
111 | - |
|
112 | - ->register('mime.qpcontentencoder') |
|
113 | - ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoderProxy') |
|
114 | - ->withDependencies(['mime.safeqpcontentencoder', 'mime.nativeqpcontentencoder', 'properties.charset']) |
|
115 | - |
|
116 | - ->register('mime.7bitcontentencoder') |
|
117 | - ->asNewInstanceOf('Swift_Mime_ContentEncoder_PlainContentEncoder') |
|
118 | - ->addConstructorValue('7bit') |
|
119 | - ->addConstructorValue(true) |
|
120 | - |
|
121 | - ->register('mime.8bitcontentencoder') |
|
122 | - ->asNewInstanceOf('Swift_Mime_ContentEncoder_PlainContentEncoder') |
|
123 | - ->addConstructorValue('8bit') |
|
124 | - ->addConstructorValue(true) |
|
125 | - |
|
126 | - ->register('mime.base64contentencoder') |
|
127 | - ->asSharedInstanceOf('Swift_Mime_ContentEncoder_Base64ContentEncoder') |
|
128 | - |
|
129 | - ->register('mime.rfc2231encoder') |
|
130 | - ->asNewInstanceOf('Swift_Encoder_Rfc2231Encoder') |
|
131 | - ->withDependencies(['mime.charstream']) |
|
6 | + ->register('properties.charset') |
|
7 | + ->asValue('utf-8') |
|
8 | + |
|
9 | + ->register('email.validator') |
|
10 | + ->asSharedInstanceOf('Egulias\EmailValidator\EmailValidator') |
|
11 | + |
|
12 | + ->register('mime.idgenerator.idright') |
|
13 | + // As SERVER_NAME can come from the user in certain configurations, check that |
|
14 | + // it does not contain forbidden characters (see RFC 952 and RFC 2181). Use |
|
15 | + // preg_replace() instead of preg_match() to prevent DoS attacks with long host names. |
|
16 | + ->asValue(!empty($_SERVER['SERVER_NAME']) && '' === preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/', '', $_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'swift.generated') |
|
17 | + |
|
18 | + ->register('mime.idgenerator') |
|
19 | + ->asSharedInstanceOf('Swift_Mime_IdGenerator') |
|
20 | + ->withDependencies([ |
|
21 | + 'mime.idgenerator.idright', |
|
22 | + ]) |
|
23 | + |
|
24 | + ->register('mime.message') |
|
25 | + ->asNewInstanceOf('Swift_Mime_SimpleMessage') |
|
26 | + ->withDependencies([ |
|
27 | + 'mime.headerset', |
|
28 | + 'mime.textcontentencoder', |
|
29 | + 'cache', |
|
30 | + 'mime.idgenerator', |
|
31 | + 'properties.charset', |
|
32 | + ]) |
|
33 | + |
|
34 | + ->register('mime.part') |
|
35 | + ->asNewInstanceOf('Swift_Mime_MimePart') |
|
36 | + ->withDependencies([ |
|
37 | + 'mime.headerset', |
|
38 | + 'mime.textcontentencoder', |
|
39 | + 'cache', |
|
40 | + 'mime.idgenerator', |
|
41 | + 'properties.charset', |
|
42 | + ]) |
|
43 | + |
|
44 | + ->register('mime.attachment') |
|
45 | + ->asNewInstanceOf('Swift_Mime_Attachment') |
|
46 | + ->withDependencies([ |
|
47 | + 'mime.headerset', |
|
48 | + 'mime.base64contentencoder', |
|
49 | + 'cache', |
|
50 | + 'mime.idgenerator', |
|
51 | + ]) |
|
52 | + ->addConstructorValue($swift_mime_types) |
|
53 | + |
|
54 | + ->register('mime.embeddedfile') |
|
55 | + ->asNewInstanceOf('Swift_Mime_EmbeddedFile') |
|
56 | + ->withDependencies([ |
|
57 | + 'mime.headerset', |
|
58 | + 'mime.base64contentencoder', |
|
59 | + 'cache', |
|
60 | + 'mime.idgenerator', |
|
61 | + ]) |
|
62 | + ->addConstructorValue($swift_mime_types) |
|
63 | + |
|
64 | + ->register('mime.headerfactory') |
|
65 | + ->asNewInstanceOf('Swift_Mime_SimpleHeaderFactory') |
|
66 | + ->withDependencies([ |
|
67 | + 'mime.qpheaderencoder', |
|
68 | + 'mime.rfc2231encoder', |
|
69 | + 'email.validator', |
|
70 | + 'properties.charset', |
|
71 | + 'address.idnaddressencoder', |
|
72 | + ]) |
|
73 | + |
|
74 | + ->register('mime.headerset') |
|
75 | + ->asNewInstanceOf('Swift_Mime_SimpleHeaderSet') |
|
76 | + ->withDependencies(['mime.headerfactory', 'properties.charset']) |
|
77 | + |
|
78 | + ->register('mime.qpheaderencoder') |
|
79 | + ->asNewInstanceOf('Swift_Mime_HeaderEncoder_QpHeaderEncoder') |
|
80 | + ->withDependencies(['mime.charstream']) |
|
81 | + |
|
82 | + ->register('mime.base64headerencoder') |
|
83 | + ->asNewInstanceOf('Swift_Mime_HeaderEncoder_Base64HeaderEncoder') |
|
84 | + ->withDependencies(['mime.charstream']) |
|
85 | + |
|
86 | + ->register('mime.charstream') |
|
87 | + ->asNewInstanceOf('Swift_CharacterStream_NgCharacterStream') |
|
88 | + ->withDependencies(['mime.characterreaderfactory', 'properties.charset']) |
|
89 | + |
|
90 | + ->register('mime.bytecanonicalizer') |
|
91 | + ->asSharedInstanceOf('Swift_StreamFilters_ByteArrayReplacementFilter') |
|
92 | + ->addConstructorValue([[0x0D, 0x0A], [0x0D], [0x0A]]) |
|
93 | + ->addConstructorValue([[0x0A], [0x0A], [0x0D, 0x0A]]) |
|
94 | + |
|
95 | + ->register('mime.characterreaderfactory') |
|
96 | + ->asSharedInstanceOf('Swift_CharacterReaderFactory_SimpleCharacterReaderFactory') |
|
97 | + |
|
98 | + ->register('mime.textcontentencoder') |
|
99 | + ->asAliasOf('mime.qpcontentencoder') |
|
100 | + |
|
101 | + ->register('mime.safeqpcontentencoder') |
|
102 | + ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoder') |
|
103 | + ->withDependencies(['mime.charstream', 'mime.bytecanonicalizer']) |
|
104 | + |
|
105 | + ->register('mime.rawcontentencoder') |
|
106 | + ->asNewInstanceOf('Swift_Mime_ContentEncoder_RawContentEncoder') |
|
107 | + |
|
108 | + ->register('mime.nativeqpcontentencoder') |
|
109 | + ->withDependencies(['properties.charset']) |
|
110 | + ->asNewInstanceOf('Swift_Mime_ContentEncoder_NativeQpContentEncoder') |
|
111 | + |
|
112 | + ->register('mime.qpcontentencoder') |
|
113 | + ->asNewInstanceOf('Swift_Mime_ContentEncoder_QpContentEncoderProxy') |
|
114 | + ->withDependencies(['mime.safeqpcontentencoder', 'mime.nativeqpcontentencoder', 'properties.charset']) |
|
115 | + |
|
116 | + ->register('mime.7bitcontentencoder') |
|
117 | + ->asNewInstanceOf('Swift_Mime_ContentEncoder_PlainContentEncoder') |
|
118 | + ->addConstructorValue('7bit') |
|
119 | + ->addConstructorValue(true) |
|
120 | + |
|
121 | + ->register('mime.8bitcontentencoder') |
|
122 | + ->asNewInstanceOf('Swift_Mime_ContentEncoder_PlainContentEncoder') |
|
123 | + ->addConstructorValue('8bit') |
|
124 | + ->addConstructorValue(true) |
|
125 | + |
|
126 | + ->register('mime.base64contentencoder') |
|
127 | + ->asSharedInstanceOf('Swift_Mime_ContentEncoder_Base64ContentEncoder') |
|
128 | + |
|
129 | + ->register('mime.rfc2231encoder') |
|
130 | + ->asNewInstanceOf('Swift_Encoder_Rfc2231Encoder') |
|
131 | + ->withDependencies(['mime.charstream']) |
|
132 | 132 | ; |
133 | 133 | |
134 | 134 | unset($swift_mime_types); |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | Swift_DependencyContainer::getInstance() |
4 | - ->register('message.message') |
|
5 | - ->asNewInstanceOf('Swift_Message') |
|
4 | + ->register('message.message') |
|
5 | + ->asNewInstanceOf('Swift_Message') |
|
6 | 6 | |
7 | - ->register('message.mimepart') |
|
8 | - ->asNewInstanceOf('Swift_MimePart') |
|
7 | + ->register('message.mimepart') |
|
8 | + ->asNewInstanceOf('Swift_MimePart') |
|
9 | 9 | ; |
@@ -1,97 +1,97 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | Swift_DependencyContainer::getInstance() |
4 | - ->register('transport.localdomain') |
|
5 | - // As SERVER_NAME can come from the user in certain configurations, check that |
|
6 | - // it does not contain forbidden characters (see RFC 952 and RFC 2181). Use |
|
7 | - // preg_replace() instead of preg_match() to prevent DoS attacks with long host names. |
|
8 | - ->asValue(!empty($_SERVER['SERVER_NAME']) && '' === preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/', '', $_SERVER['SERVER_NAME']) ? trim($_SERVER['SERVER_NAME'], '[]') : '127.0.0.1') |
|
9 | - |
|
10 | - ->register('transport.smtp') |
|
11 | - ->asNewInstanceOf('Swift_Transport_EsmtpTransport') |
|
12 | - ->withDependencies([ |
|
13 | - 'transport.buffer', |
|
14 | - 'transport.smtphandlers', |
|
15 | - 'transport.eventdispatcher', |
|
16 | - 'transport.localdomain', |
|
17 | - 'address.idnaddressencoder', |
|
18 | - ]) |
|
19 | - |
|
20 | - ->register('transport.sendmail') |
|
21 | - ->asNewInstanceOf('Swift_Transport_SendmailTransport') |
|
22 | - ->withDependencies([ |
|
23 | - 'transport.buffer', |
|
24 | - 'transport.eventdispatcher', |
|
25 | - 'transport.localdomain', |
|
26 | - ]) |
|
27 | - |
|
28 | - ->register('transport.loadbalanced') |
|
29 | - ->asNewInstanceOf('Swift_Transport_LoadBalancedTransport') |
|
30 | - |
|
31 | - ->register('transport.failover') |
|
32 | - ->asNewInstanceOf('Swift_Transport_FailoverTransport') |
|
33 | - |
|
34 | - ->register('transport.spool') |
|
35 | - ->asNewInstanceOf('Swift_Transport_SpoolTransport') |
|
36 | - ->withDependencies(['transport.eventdispatcher']) |
|
37 | - |
|
38 | - ->register('transport.null') |
|
39 | - ->asNewInstanceOf('Swift_Transport_NullTransport') |
|
40 | - ->withDependencies(['transport.eventdispatcher']) |
|
41 | - |
|
42 | - ->register('transport.buffer') |
|
43 | - ->asNewInstanceOf('Swift_Transport_StreamBuffer') |
|
44 | - ->withDependencies(['transport.replacementfactory']) |
|
45 | - |
|
46 | - ->register('transport.smtphandlers') |
|
47 | - ->asArray() |
|
48 | - ->withDependencies(['transport.authhandler']) |
|
49 | - |
|
50 | - ->register('transport.authhandler') |
|
51 | - ->asNewInstanceOf('Swift_Transport_Esmtp_AuthHandler') |
|
52 | - ->withDependencies(['transport.authhandlers']) |
|
53 | - |
|
54 | - ->register('transport.authhandlers') |
|
55 | - ->asArray() |
|
56 | - ->withDependencies([ |
|
57 | - 'transport.crammd5auth', |
|
58 | - 'transport.loginauth', |
|
59 | - 'transport.plainauth', |
|
60 | - 'transport.ntlmauth', |
|
61 | - 'transport.xoauth2auth', |
|
62 | - ]) |
|
63 | - |
|
64 | - ->register('transport.smtputf8handler') |
|
65 | - ->asNewInstanceOf('Swift_Transport_Esmtp_SmtpUtf8Handler') |
|
66 | - |
|
67 | - ->register('transport.8bitmimehandler') |
|
68 | - ->asNewInstanceOf('Swift_Transport_Esmtp_EightBitMimeHandler') |
|
69 | - ->addConstructorValue('8BITMIME') |
|
70 | - |
|
71 | - ->register('transport.crammd5auth') |
|
72 | - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_CramMd5Authenticator') |
|
73 | - |
|
74 | - ->register('transport.loginauth') |
|
75 | - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_LoginAuthenticator') |
|
76 | - |
|
77 | - ->register('transport.plainauth') |
|
78 | - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_PlainAuthenticator') |
|
79 | - |
|
80 | - ->register('transport.xoauth2auth') |
|
81 | - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_XOAuth2Authenticator') |
|
82 | - |
|
83 | - ->register('transport.ntlmauth') |
|
84 | - ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_NTLMAuthenticator') |
|
85 | - |
|
86 | - ->register('transport.eventdispatcher') |
|
87 | - ->asNewInstanceOf('Swift_Events_SimpleEventDispatcher') |
|
88 | - |
|
89 | - ->register('transport.replacementfactory') |
|
90 | - ->asSharedInstanceOf('Swift_StreamFilters_StringReplacementFilterFactory') |
|
91 | - |
|
92 | - ->register('address.idnaddressencoder') |
|
93 | - ->asNewInstanceOf('Swift_AddressEncoder_IdnAddressEncoder') |
|
94 | - |
|
95 | - ->register('address.utf8addressencoder') |
|
96 | - ->asNewInstanceOf('Swift_AddressEncoder_Utf8AddressEncoder') |
|
4 | + ->register('transport.localdomain') |
|
5 | + // As SERVER_NAME can come from the user in certain configurations, check that |
|
6 | + // it does not contain forbidden characters (see RFC 952 and RFC 2181). Use |
|
7 | + // preg_replace() instead of preg_match() to prevent DoS attacks with long host names. |
|
8 | + ->asValue(!empty($_SERVER['SERVER_NAME']) && '' === preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/', '', $_SERVER['SERVER_NAME']) ? trim($_SERVER['SERVER_NAME'], '[]') : '127.0.0.1') |
|
9 | + |
|
10 | + ->register('transport.smtp') |
|
11 | + ->asNewInstanceOf('Swift_Transport_EsmtpTransport') |
|
12 | + ->withDependencies([ |
|
13 | + 'transport.buffer', |
|
14 | + 'transport.smtphandlers', |
|
15 | + 'transport.eventdispatcher', |
|
16 | + 'transport.localdomain', |
|
17 | + 'address.idnaddressencoder', |
|
18 | + ]) |
|
19 | + |
|
20 | + ->register('transport.sendmail') |
|
21 | + ->asNewInstanceOf('Swift_Transport_SendmailTransport') |
|
22 | + ->withDependencies([ |
|
23 | + 'transport.buffer', |
|
24 | + 'transport.eventdispatcher', |
|
25 | + 'transport.localdomain', |
|
26 | + ]) |
|
27 | + |
|
28 | + ->register('transport.loadbalanced') |
|
29 | + ->asNewInstanceOf('Swift_Transport_LoadBalancedTransport') |
|
30 | + |
|
31 | + ->register('transport.failover') |
|
32 | + ->asNewInstanceOf('Swift_Transport_FailoverTransport') |
|
33 | + |
|
34 | + ->register('transport.spool') |
|
35 | + ->asNewInstanceOf('Swift_Transport_SpoolTransport') |
|
36 | + ->withDependencies(['transport.eventdispatcher']) |
|
37 | + |
|
38 | + ->register('transport.null') |
|
39 | + ->asNewInstanceOf('Swift_Transport_NullTransport') |
|
40 | + ->withDependencies(['transport.eventdispatcher']) |
|
41 | + |
|
42 | + ->register('transport.buffer') |
|
43 | + ->asNewInstanceOf('Swift_Transport_StreamBuffer') |
|
44 | + ->withDependencies(['transport.replacementfactory']) |
|
45 | + |
|
46 | + ->register('transport.smtphandlers') |
|
47 | + ->asArray() |
|
48 | + ->withDependencies(['transport.authhandler']) |
|
49 | + |
|
50 | + ->register('transport.authhandler') |
|
51 | + ->asNewInstanceOf('Swift_Transport_Esmtp_AuthHandler') |
|
52 | + ->withDependencies(['transport.authhandlers']) |
|
53 | + |
|
54 | + ->register('transport.authhandlers') |
|
55 | + ->asArray() |
|
56 | + ->withDependencies([ |
|
57 | + 'transport.crammd5auth', |
|
58 | + 'transport.loginauth', |
|
59 | + 'transport.plainauth', |
|
60 | + 'transport.ntlmauth', |
|
61 | + 'transport.xoauth2auth', |
|
62 | + ]) |
|
63 | + |
|
64 | + ->register('transport.smtputf8handler') |
|
65 | + ->asNewInstanceOf('Swift_Transport_Esmtp_SmtpUtf8Handler') |
|
66 | + |
|
67 | + ->register('transport.8bitmimehandler') |
|
68 | + ->asNewInstanceOf('Swift_Transport_Esmtp_EightBitMimeHandler') |
|
69 | + ->addConstructorValue('8BITMIME') |
|
70 | + |
|
71 | + ->register('transport.crammd5auth') |
|
72 | + ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_CramMd5Authenticator') |
|
73 | + |
|
74 | + ->register('transport.loginauth') |
|
75 | + ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_LoginAuthenticator') |
|
76 | + |
|
77 | + ->register('transport.plainauth') |
|
78 | + ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_PlainAuthenticator') |
|
79 | + |
|
80 | + ->register('transport.xoauth2auth') |
|
81 | + ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_XOAuth2Authenticator') |
|
82 | + |
|
83 | + ->register('transport.ntlmauth') |
|
84 | + ->asNewInstanceOf('Swift_Transport_Esmtp_Auth_NTLMAuthenticator') |
|
85 | + |
|
86 | + ->register('transport.eventdispatcher') |
|
87 | + ->asNewInstanceOf('Swift_Events_SimpleEventDispatcher') |
|
88 | + |
|
89 | + ->register('transport.replacementfactory') |
|
90 | + ->asSharedInstanceOf('Swift_StreamFilters_StringReplacementFilterFactory') |
|
91 | + |
|
92 | + ->register('address.idnaddressencoder') |
|
93 | + ->asNewInstanceOf('Swift_AddressEncoder_IdnAddressEncoder') |
|
94 | + |
|
95 | + ->register('address.utf8addressencoder') |
|
96 | + ->asNewInstanceOf('Swift_AddressEncoder_Utf8AddressEncoder') |
|
97 | 97 | ; |
@@ -15,13 +15,13 @@ |
||
15 | 15 | */ |
16 | 16 | class Swift_RfcComplianceException extends Swift_SwiftException |
17 | 17 | { |
18 | - /** |
|
19 | - * Create a new RfcComplianceException with $message. |
|
20 | - * |
|
21 | - * @param string $message |
|
22 | - */ |
|
23 | - public function __construct($message) |
|
24 | - { |
|
25 | - parent::__construct($message); |
|
26 | - } |
|
18 | + /** |
|
19 | + * Create a new RfcComplianceException with $message. |
|
20 | + * |
|
21 | + * @param string $message |
|
22 | + */ |
|
23 | + public function __construct($message) |
|
24 | + { |
|
25 | + parent::__construct($message); |
|
26 | + } |
|
27 | 27 | } |
@@ -15,21 +15,21 @@ |
||
15 | 15 | */ |
16 | 16 | interface Swift_StreamFilter |
17 | 17 | { |
18 | - /** |
|
19 | - * Based on the buffer given, this returns true if more buffering is needed. |
|
20 | - * |
|
21 | - * @param mixed $buffer |
|
22 | - * |
|
23 | - * @return bool |
|
24 | - */ |
|
25 | - public function shouldBuffer($buffer); |
|
18 | + /** |
|
19 | + * Based on the buffer given, this returns true if more buffering is needed. |
|
20 | + * |
|
21 | + * @param mixed $buffer |
|
22 | + * |
|
23 | + * @return bool |
|
24 | + */ |
|
25 | + public function shouldBuffer($buffer); |
|
26 | 26 | |
27 | - /** |
|
28 | - * Filters $buffer and returns the changes. |
|
29 | - * |
|
30 | - * @param mixed $buffer |
|
31 | - * |
|
32 | - * @return mixed |
|
33 | - */ |
|
34 | - public function filter($buffer); |
|
27 | + /** |
|
28 | + * Filters $buffer and returns the changes. |
|
29 | + * |
|
30 | + * @param mixed $buffer |
|
31 | + * |
|
32 | + * @return mixed |
|
33 | + */ |
|
34 | + public function filter($buffer); |
|
35 | 35 | } |
@@ -26,11 +26,11 @@ |
||
26 | 26 | */ |
27 | 27 | class Swift_AddressEncoder_Utf8AddressEncoder implements Swift_AddressEncoder |
28 | 28 | { |
29 | - /** |
|
30 | - * Returns the address verbatimly. |
|
31 | - */ |
|
32 | - public function encodeString(string $address): string |
|
33 | - { |
|
34 | - return $address; |
|
35 | - } |
|
29 | + /** |
|
30 | + * Returns the address verbatimly. |
|
31 | + */ |
|
32 | + public function encodeString(string $address): string |
|
33 | + { |
|
34 | + return $address; |
|
35 | + } |
|
36 | 36 | } |
@@ -24,27 +24,27 @@ |
||
24 | 24 | */ |
25 | 25 | class Swift_AddressEncoder_IdnAddressEncoder implements Swift_AddressEncoder |
26 | 26 | { |
27 | - /** |
|
28 | - * Encodes the domain part of an address using IDN. |
|
29 | - * |
|
30 | - * @throws Swift_AddressEncoderException If local-part contains non-ASCII characters |
|
31 | - */ |
|
32 | - public function encodeString(string $address): string |
|
33 | - { |
|
34 | - $i = strrpos($address, '@'); |
|
35 | - if (false !== $i) { |
|
36 | - $local = substr($address, 0, $i); |
|
37 | - $domain = substr($address, $i + 1); |
|
27 | + /** |
|
28 | + * Encodes the domain part of an address using IDN. |
|
29 | + * |
|
30 | + * @throws Swift_AddressEncoderException If local-part contains non-ASCII characters |
|
31 | + */ |
|
32 | + public function encodeString(string $address): string |
|
33 | + { |
|
34 | + $i = strrpos($address, '@'); |
|
35 | + if (false !== $i) { |
|
36 | + $local = substr($address, 0, $i); |
|
37 | + $domain = substr($address, $i + 1); |
|
38 | 38 | |
39 | - if (preg_match('/[^\x00-\x7F]/', $local)) { |
|
40 | - throw new Swift_AddressEncoderException('Non-ASCII characters not supported in local-part', $address); |
|
41 | - } |
|
39 | + if (preg_match('/[^\x00-\x7F]/', $local)) { |
|
40 | + throw new Swift_AddressEncoderException('Non-ASCII characters not supported in local-part', $address); |
|
41 | + } |
|
42 | 42 | |
43 | - if (preg_match('/[^\x00-\x7F]/', $domain)) { |
|
44 | - $address = sprintf('%s@%s', $local, idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46)); |
|
45 | - } |
|
46 | - } |
|
43 | + if (preg_match('/[^\x00-\x7F]/', $domain)) { |
|
44 | + $address = sprintf('%s@%s', $local, idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46)); |
|
45 | + } |
|
46 | + } |
|
47 | 47 | |
48 | - return $address; |
|
49 | - } |
|
48 | + return $address; |
|
49 | + } |
|
50 | 50 | } |
@@ -15,96 +15,96 @@ |
||
15 | 15 | */ |
16 | 16 | class Swift_MemorySpool implements Swift_Spool |
17 | 17 | { |
18 | - protected $messages = []; |
|
19 | - private $flushRetries = 3; |
|
18 | + protected $messages = []; |
|
19 | + private $flushRetries = 3; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Tests if this Transport mechanism has started. |
|
23 | - * |
|
24 | - * @return bool |
|
25 | - */ |
|
26 | - public function isStarted() |
|
27 | - { |
|
28 | - return true; |
|
29 | - } |
|
21 | + /** |
|
22 | + * Tests if this Transport mechanism has started. |
|
23 | + * |
|
24 | + * @return bool |
|
25 | + */ |
|
26 | + public function isStarted() |
|
27 | + { |
|
28 | + return true; |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * Starts this Transport mechanism. |
|
33 | - */ |
|
34 | - public function start() |
|
35 | - { |
|
36 | - } |
|
31 | + /** |
|
32 | + * Starts this Transport mechanism. |
|
33 | + */ |
|
34 | + public function start() |
|
35 | + { |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * Stops this Transport mechanism. |
|
40 | - */ |
|
41 | - public function stop() |
|
42 | - { |
|
43 | - } |
|
38 | + /** |
|
39 | + * Stops this Transport mechanism. |
|
40 | + */ |
|
41 | + public function stop() |
|
42 | + { |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * @param int $retries |
|
47 | - */ |
|
48 | - public function setFlushRetries($retries) |
|
49 | - { |
|
50 | - $this->flushRetries = $retries; |
|
51 | - } |
|
45 | + /** |
|
46 | + * @param int $retries |
|
47 | + */ |
|
48 | + public function setFlushRetries($retries) |
|
49 | + { |
|
50 | + $this->flushRetries = $retries; |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * Stores a message in the queue. |
|
55 | - * |
|
56 | - * @param Swift_Mime_SimpleMessage $message The message to store |
|
57 | - * |
|
58 | - * @return bool Whether the operation has succeeded |
|
59 | - */ |
|
60 | - public function queueMessage(Swift_Mime_SimpleMessage $message) |
|
61 | - { |
|
62 | - //clone the message to make sure it is not changed while in the queue |
|
63 | - $this->messages[] = clone $message; |
|
53 | + /** |
|
54 | + * Stores a message in the queue. |
|
55 | + * |
|
56 | + * @param Swift_Mime_SimpleMessage $message The message to store |
|
57 | + * |
|
58 | + * @return bool Whether the operation has succeeded |
|
59 | + */ |
|
60 | + public function queueMessage(Swift_Mime_SimpleMessage $message) |
|
61 | + { |
|
62 | + //clone the message to make sure it is not changed while in the queue |
|
63 | + $this->messages[] = clone $message; |
|
64 | 64 | |
65 | - return true; |
|
66 | - } |
|
65 | + return true; |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * Sends messages using the given transport instance. |
|
70 | - * |
|
71 | - * @param Swift_Transport $transport A transport instance |
|
72 | - * @param string[] $failedRecipients An array of failures by-reference |
|
73 | - * |
|
74 | - * @return int The number of sent emails |
|
75 | - */ |
|
76 | - public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) |
|
77 | - { |
|
78 | - if (!$this->messages) { |
|
79 | - return 0; |
|
80 | - } |
|
68 | + /** |
|
69 | + * Sends messages using the given transport instance. |
|
70 | + * |
|
71 | + * @param Swift_Transport $transport A transport instance |
|
72 | + * @param string[] $failedRecipients An array of failures by-reference |
|
73 | + * |
|
74 | + * @return int The number of sent emails |
|
75 | + */ |
|
76 | + public function flushQueue(Swift_Transport $transport, &$failedRecipients = null) |
|
77 | + { |
|
78 | + if (!$this->messages) { |
|
79 | + return 0; |
|
80 | + } |
|
81 | 81 | |
82 | - if (!$transport->isStarted()) { |
|
83 | - $transport->start(); |
|
84 | - } |
|
82 | + if (!$transport->isStarted()) { |
|
83 | + $transport->start(); |
|
84 | + } |
|
85 | 85 | |
86 | - $count = 0; |
|
87 | - $retries = $this->flushRetries; |
|
88 | - while ($retries--) { |
|
89 | - try { |
|
90 | - while ($message = array_pop($this->messages)) { |
|
91 | - $count += $transport->send($message, $failedRecipients); |
|
92 | - } |
|
93 | - } catch (Swift_TransportException $exception) { |
|
94 | - if ($retries) { |
|
95 | - // re-queue the message at the end of the queue to give a chance |
|
96 | - // to the other messages to be sent, in case the failure was due to |
|
97 | - // this message and not just the transport failing |
|
98 | - array_unshift($this->messages, $message); |
|
86 | + $count = 0; |
|
87 | + $retries = $this->flushRetries; |
|
88 | + while ($retries--) { |
|
89 | + try { |
|
90 | + while ($message = array_pop($this->messages)) { |
|
91 | + $count += $transport->send($message, $failedRecipients); |
|
92 | + } |
|
93 | + } catch (Swift_TransportException $exception) { |
|
94 | + if ($retries) { |
|
95 | + // re-queue the message at the end of the queue to give a chance |
|
96 | + // to the other messages to be sent, in case the failure was due to |
|
97 | + // this message and not just the transport failing |
|
98 | + array_unshift($this->messages, $message); |
|
99 | 99 | |
100 | - // wait half a second before we try again |
|
101 | - usleep(500000); |
|
102 | - } else { |
|
103 | - throw $exception; |
|
104 | - } |
|
105 | - } |
|
106 | - } |
|
100 | + // wait half a second before we try again |
|
101 | + usleep(500000); |
|
102 | + } else { |
|
103 | + throw $exception; |
|
104 | + } |
|
105 | + } |
|
106 | + } |
|
107 | 107 | |
108 | - return $count; |
|
109 | - } |
|
108 | + return $count; |
|
109 | + } |
|
110 | 110 | } |
@@ -15,5 +15,5 @@ |
||
15 | 15 | */ |
16 | 16 | interface Swift_Signer |
17 | 17 | { |
18 | - public function reset(); |
|
18 | + public function reset(); |
|
19 | 19 | } |