E-Mail als Datei speichern create_function deprecated (PHP 7.2)

Hi,

ich versuche für mein Test-System die gesendeten E-Mails als Datei abzulegen. In der Doku bin ich auch fündig geworden (https://docs.shopware.com/de/shopware-5-de/einstellungen/e-mails#mailversand-als-file) aber der Befehl create_function ist in PHP 7.2 deprecated.

Dann dachte ich mir, gut, machste ne anonymous function draus. Leider bekam ich dann diese Meldung:

[04-Jan-2019 08:04:07 Europe/Berlin] PHP Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\RuntimeException: Unable to dump a service container if a parameter is an object or a resource.

 

Hier ist der Ausschnitt aus meiner config.php:

    'mail' => array(
        'type' => 'file',
        'path' => $this->DocPath('mails'),
        'callback' => function ($transport) {
            return "ShopwareMail_" . sha1($transport->body) . "_" . str_replace("@", "[at]", $transport->recipients) . ".eml";
        },
    ),

 

hab noch nie vorher von “callback” wert gehört, und zumindest wir brauchen es nicht in shopware 5.4.6:

'mail' => [
    'type' => 'file',
    'path' => 'var/log'
],

das schreibt bei uns datein wie zbs. var/log/ZendMail_1545395107_1175411388.tmp und in console kann man mit qprint -d var/log/ZendMail_1545395107_1175411388.tmp es decoden.

ist diese “callback” eine shopware 5.5 monstrosität?
könnte jemand es bitte besser dokumentieren in config.php settings

oh, und braucht nicht auch shopware 5.5 maximal php 7.0?

callback ist veraltet und man braucht es seit ewigkeiten nicht mehr. Einfach weglassen

1 „Gefällt mir“