Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Revision 399 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 150
Zeile 11... Zeile 11...
11
use Illuminate\Mail\Transport\SesTransport;
11
use Illuminate\Mail\Transport\SesTransport;
12
use Illuminate\Support\Arr;
12
use Illuminate\Support\Arr;
13
use Illuminate\Support\Str;
13
use Illuminate\Support\Str;
14
use InvalidArgumentException;
14
use InvalidArgumentException;
15
use Psr\Log\LoggerInterface;
15
use Psr\Log\LoggerInterface;
-
 
16
use Symfony\Component\HttpClient\HttpClient;
16
use Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory;
17
use Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory;
17
use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkTransportFactory;
18
use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkTransportFactory;
18
use Symfony\Component\Mailer\Transport\Dsn;
19
use Symfony\Component\Mailer\Transport\Dsn;
19
use Symfony\Component\Mailer\Transport\FailoverTransport;
20
use Symfony\Component\Mailer\Transport\FailoverTransport;
20
use Symfony\Component\Mailer\Transport\SendmailTransport;
21
use Symfony\Component\Mailer\Transport\SendmailTransport;
Zeile 221... Zeile 222...
221
 
222
 
222
    /**
223
    /**
223
     * Create an instance of the Symfony Amazon SES Transport driver.
224
     * Create an instance of the Symfony Amazon SES Transport driver.
224
     *
225
     *
225
     * @param  array  $config
226
     * @param  array  $config
226
     * @return \Symfony\Component\Mailer\Bridge\Amazon\Transport\SesApiAsyncAwsTransport
227
     * @return \Illuminate\Mail\Transport\SesTransport
227
     */
228
     */
228
    protected function createSesTransport(array $config)
229
    protected function createSesTransport(array $config)
229
    {
230
    {
230
        $config = array_merge(
231
        $config = array_merge(
Zeile 272... Zeile 273...
272
     * @param  array  $config
273
     * @param  array  $config
273
     * @return \Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunApiTransport
274
     * @return \Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunApiTransport
274
     */
275
     */
275
    protected function createMailgunTransport(array $config)
276
    protected function createMailgunTransport(array $config)
276
    {
277
    {
277
        $factory = new MailgunTransportFactory();
278
        $factory = new MailgunTransportFactory(null, $this->getHttpClient($config));
Zeile 278... Zeile 279...
278
 
279
 
279
        if (! isset($config['secret'])) {
280
        if (! isset($config['secret'])) {
280
            $config = $this->app['config']->get('services.mailgun', []);
281
            $config = $this->app['config']->get('services.mailgun', []);
Zeile 294... Zeile 295...
294
     * @param  array  $config
295
     * @param  array  $config
295
     * @return \Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkApiTransport
296
     * @return \Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkApiTransport
296
     */
297
     */
297
    protected function createPostmarkTransport(array $config)
298
    protected function createPostmarkTransport(array $config)
298
    {
299
    {
299
        $factory = new PostmarkTransportFactory();
300
        $factory = new PostmarkTransportFactory(null, $this->getHttpClient($config));
Zeile 300... Zeile 301...
300
 
301
 
301
        $options = isset($config['message_stream_id'])
302
        $options = isset($config['message_stream_id'])
302
                    ? ['message_stream' => $config['message_stream_id']]
303
                    ? ['message_stream' => $config['message_stream_id']]
Zeile 368... Zeile 369...
368
    {
369
    {
369
        return new ArrayTransport;
370
        return new ArrayTransport;
370
    }
371
    }
Zeile 371... Zeile 372...
371
 
372
 
-
 
373
    /**
-
 
374
     * Get a configured Symfony HTTP client instance.
-
 
375
     *
-
 
376
     * @return \Symfony\Contracts\HttpClient\HttpClientInterface|null
-
 
377
     */
-
 
378
    protected function getHttpClient(array $config)
-
 
379
    {
-
 
380
        if ($options = ($config['client'] ?? false)) {
-
 
381
            $maxHostConnections = Arr::pull($options, 'max_host_connections', 6);
-
 
382
            $maxPendingPushes = Arr::pull($options, 'max_pending_pushes', 50);
-
 
383
 
-
 
384
            return HttpClient::create($options, $maxHostConnections, $maxPendingPushes);
-
 
385
        }
-
 
386
    }
-
 
387
 
372
    /**
388
    /**
373
     * Set a global address on the mailer by type.
389
     * Set a global address on the mailer by type.
374
     *
390
     *
375
     * @param  \Illuminate\Mail\Mailer  $mailer
391
     * @param  \Illuminate\Mail\Mailer  $mailer
376
     * @param  array  $config
392
     * @param  array  $config