[TYPO3-dev] Ignoring warnings in T3 src, why ?

Tomas Norre Mikkelsen tomasnorre at gmail.com
Sat Feb 12 07:42:07 CET 2011


Thanks for the anserw.

I know the function is changed in 4.5. But was interrested in knowing why.

My point of view is, It's ok to suppress warnings/errors If you Can
ensure there are none :)

A simple If arround checking the additional parameters would been enough.

But thx anyway. Just wanted to get a view at the topic why done this way.

--
Tomas Norre Mikkelsen
Tomasnorre at gmail.com

:: Sent from my iPhone ::

Den 11/02/2011 kl. 23.13 skrev Jigal van Hemert <jigal at xs4all.nl>:

> Hi,
>
> On 11-2-2011 21:30, Tomas Norre Mikkelsen wrote:
>> I have a question regarding coding standard in the TYPO3-core.
>>
>> The other day I was trying to send some test-emails from my development
>> server. Cause the server has safe_mode = on as default, the mails were
>> not sent.
>
> safe_mode is a bad concept [1] and should not be enabled.
>
>> I found out that it was because of the safe_mode = on and the conditions
>> in the t3lib_utility_Mail class[1] in the static mail function.
>>
>> If safe_mode is disable and the "$additionalParameters = null" then the
>> mail is not sent.
>
> In this case there is no extra parameter passed to sendmail and mails can be rejected by the receiving server, etc.
>
>> My question is, why is the @ used such warnings are ignored, if this was
>> not set, It would have been easier for me to see that my problems were
>> caused by safe_mode = on.
>
> The @ is added to suppress the *display* of warnings and errors. It is simply not good to display PHP warnings or error when visitors use the website.
> In safe_mode the additional_parameters parameter is disabled, so it will not be used at all by the mail() command.
>
> The PHP mail() command is pretty easy, but has a lot of drawbacks. It is very hard to find the reason why mails are not received, it's virtually impossible to handle errors in mail sending, etc.
>
> If you upgrade to 4.5.0LTS TYPO3 will use the Swift Mailer library to send mails. This has better configuration options and can handle the whole SMTP process internally (thus providing feedback on the results).
> The 4.5 core uses Swift Mailer internally and calls to t3lib_utility_Mail are also passed to the Swift Mailer library.
>
> [1] http://www.php.net/manual/en/features.safe-mode.php
>
> --
> Kind regards / met vriendelijke groet,
>
> Jigal van Hemert
> skype:jigal.van.hemert
> msn: jigal at xs4all.nl
> http://twitter.com/jigalvh
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev




More information about the TYPO3-dev mailing list