Bug #94015
closed
GeneralUtility::xml2array() can't be used in Guzzle middleware
Added by David Bruchmann over 3 years ago.
Updated almost 3 years ago.
Description
Using a middleware like this:
# Add custom middleware to default Guzzle handler stack
$GLOBALS['TYPO3_CONF_VARS']['HTTP']['handler'][] =
(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\ACME\Middleware\Guzzle\CustomMiddleware::class))->handler();
it's not possible to use xml2array, instead an error-message is thrown:
[CRITICAL] request="c379d512eb551" component="TYPO3.CMS.Core.Error.ProductionExceptionHandler": Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1549446998: TYPO3\CMS\Core\Cache\CacheManager can not be injected/instantiated during ext_localconf.php loading. Use lazy loading instead. | LogicException thrown in file typo3/sysext/core/Classes/ServiceProvider.php in line 97.
Furthermore xml2arrayProcess can't be used as it's protected :(
- Subject changed from GeneralUtility::xml2array() can't be used in Middleware to GeneralUtility::xml2array() can't be used in Guzzle middleware
- Status changed from New to Needs Feedback
Hey David,
is this issue related to the other Guzzle middleware approach you had last week?
- Related to Bug #94701: Dashboard breaks if Guzzle Middleware is used added
Hi Benni,
yes, correct.
As a real Guzzle middleware consists of at least 2 inherited closures it's running completely on another context and had to be tested.
The most inner closure is instantiated at another time and has therefore perhaps more classes available, but I'm not sure about it.
David Bruchmann wrote in #note-5:
Hi Benni,
yes, correct.
As a real Guzzle middleware consists of at least 2 inherited closures it's running completely on another context and had to be tested.
The most inner closure is instantiated at another time and has therefore perhaps more classes available, but I'm not sure about it.
Anything to do from my side here?
- Status changed from Needs Feedback to Closed
Hey. I hope it's ok to close here for now - it's unclear if there is anything core can do in this context. Let's restart with a fresh issue in case something is left.
Also available in: Atom
PDF