docker-joomla
docker-joomla copied to clipboard
Use `mysqli_report(MYSQLI_REPORT_OFF)` in `makedb.php`
Using PHP 8.1, the makedb.php
script fails if the connection cannot be established at the first try. This is because according to https://www.php.net/manual/en/mysqli-driver.report-mode.php, the default mysqli reporting mode is now MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT
while it was MYSQLI_REPORT_OFF
before. The change makes mysqli::__construct()
throw an exception, which is not caught. This commit restores the old behavior.
Note that I tested only the php8.1-fpm-alpine
variant (which works).
I will take a closer look over the weekend, but in reading over the code it looks good to me.
Personally I don't like patching an issue (version mismatch issue), would prefer if we instead improved the code so it runs as it should for that version. We are working on this in issue 42 so you should expect a refactored database file to be added in the near future.