Steps to reproduce:
- PHP 8.2.17, Phorge at 216d308507edd54a68cb392df9f47011265c64e9
- Install php-mailparse if it is not already installed
- Be too lazy to set up a mail server software
- Have a local text file called email.txt with a valid mbox email message in it and place it in ./phorge/scripts/mail/
- In https://we.phorge.it/source/phorge/browse/master/scripts/mail/mail_handler.php , replace the line $parser->setText(file_get_contents('php://stdin')); with $parser->setText(file_get_contents('email.txt'));
- Run php ./phorge/scripts/mail/mail_handler.php
Expected outcome:
No errors
Actual outcome:
# [2024-03-29 09:43:56] ERROR 8192: Creation of dynamic property MimeMailParser::$parts is deprecated at [/var/www/html/phorge/phorge/externals/mimemailparser/MimeMailParser.class.php:137] #arcanist(head=master, ref.master=ef73b12b580e), phorge(head=master, ref.master=216d308507ed) # #0 MimeMailParser::parse() called at [<phorge>/externals/mimemailparser/MimeMailParser.class.php:126] # #1 MimeMailParser::setText(string) called at [<phorge>/scripts/mail/mail_handler.php:37]
because https://php.watch/versions/8.2/dynamic-properties-deprecated
FYI I did not succeed to find an upstream for MimeMailParser, only copies outdated in the very same way.