libxml_disable_entity_loader is deprecated in php8, which comes up if your system temp dir has spaces in the path
It's a little confusing. And it's not really a civi issue. I should post this over at symfony, but in case anyone else comes up against it here it is. It may or may not be more common on windows, where the temp folder might be something like C:\users\ACME Widgets\Appdata\Local\Temp
, as opposed to /tmp
.
The version of symfony/dependency-injection that ships with core is 3.4. It includes a simple guard, so that it only calls libxml_disable_entity_loader based on libxml version. https://github.com/symfony/dependency-injection/blob/3.4/Loader/XmlFileLoader.php#L623. So spaces are irrelevant.
In 4.3, dependency-injection removes this guard, but leaves it calling libxml_disable_entity_loader ALWAYS.
In 4.4, they added a fancier guard. Since drupal 9+ ends up with v4.4 (at least for me, and it seems for E2E tests too), everything's ok as long as there's no spaces in the path.
In php8, what happens is shouldEnableEntityLoader() ends up returning true anyway, because the little test that function is doing fails validation when there's spaces, i.e. <xsd:include schemaLocation="file:///'.str_replace('\\', '/', $tmpfile).'" />
doesn't give a correct encoding for the schemaLocation.
It comes up for example when creating the container, e.g. after clearing cache.
And it's the same code in symfony in v5 and v6.