Project

General

Profile

Actions

Bug #36937

closed

Custom Swift_Transport is impossible due to wrong variable

Added by Georg Ringer almost 12 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
-
Target version:
Start date:
2012-05-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
5.3
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

Because of a wrong variable it is impossible to implement a custom Swift_Transport

Imagine you want to do an own Swift_Transport implementation you add

$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport'] = 'Tx_Fo_Bar';

but because of the constructor being called without any special name, it is tried to look the default one up in the TYPO3_CONF_VARS as stated in the comment
---
Swift_Transport optionally pass a transport to the constructor. By default the configured transport from $TYPO3_CONF_VARS is used
----

current code

$customTransport = t3lib_div::makeInstance($mailSettings['transport'], $mailSettings);
if ($this->transport instanceof Swift_Transport) {
    $this->transport = $customTransport;
} else {
    throw new RuntimeException(
        $mailSettings['transport'] . ' is not an implementation of Swift_Transport,
        but must implement that interface to be used as a mail transport.',
        1323006478
    );
}

therefore $this->transport will never be an instanceof Swift_Transport as it will be always empty at that place. needs to be of course $customTransport


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #24841: Defining a custom MailTransport which implements SwiftTransportClosed2011-01-26

Actions
Actions #1

Updated by Gerrit Code Review almost 12 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/11062

Actions #2

Updated by Georg Ringer almost 12 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #3

Updated by Gerrit Code Review almost 12 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/11064

Actions #4

Updated by Georg Ringer almost 12 years ago

  • Status changed from Under Review to Resolved
Actions #5

Updated by Gerrit Code Review over 11 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/13133

Actions #6

Updated by Georg Ringer over 11 years ago

  • Status changed from Under Review to Resolved
Actions #7

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF