Skip to content

Commit 3c3c4e6

Browse files
Create sfNoMailer.class.php with the same signature as sfMailer
This allow to avoid SwiftMailer initialization on all requests even if the application does not send any email.
1 parent 62b2162 commit 3c3c4e6

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

lib/mailer/sfNoMailer.class.php

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
/**
4+
* sfMailer is the main entry point for the mailer system - sfNoMailer disable all mailer features.
5+
*/
6+
class sfNoMailer
7+
{
8+
public function __construct(sfEventDispatcher $dispatcher, $options)
9+
{
10+
}
11+
12+
public function getRealtimeTransport()
13+
{
14+
return null;
15+
}
16+
17+
public function setRealtimeTransport(Swift_Transport $transport)
18+
{
19+
}
20+
21+
public function getLogger()
22+
{
23+
return null;
24+
}
25+
26+
public function setLogger($logger)
27+
{
28+
}
29+
30+
public function getDeliveryStrategy()
31+
{
32+
return null;
33+
}
34+
35+
public function getDeliveryAddress()
36+
{
37+
return null;
38+
}
39+
40+
public function setDeliveryAddress($address)
41+
{
42+
}
43+
44+
public function compose($from = null, $to = null, $subject = null, $body = null)
45+
{
46+
return null;
47+
}
48+
49+
public function composeAndSend($from, $to, $subject, $body)
50+
{
51+
return null;
52+
}
53+
54+
public function sendNextImmediately()
55+
{
56+
return null;
57+
}
58+
59+
public function send(Swift_Mime_Message $message, &$failedRecipients = null)
60+
{
61+
return null;
62+
}
63+
64+
public function flushQueue(&$failedRecipients = null)
65+
{
66+
return null;
67+
}
68+
69+
public function getSpool()
70+
{
71+
return null;
72+
}
73+
}

0 commit comments

Comments
 (0)