Bug #96657
closedExtensionConfigurationExtensionNotConfiguredException and ExtensionConfigurationPathDoesNotExistException are marked as @internal
100%
Description
ExtensionConfigurationExtensionNotConfiguredException
and ExtensionConfigurationPathDoesNotExistException
are marked as @internal
But if you want to fetch the extension configuration you have to use GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('my_ext')
- e.g. like this:
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException;
class Foo {
public function __construct() {
try {
$extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('my_ext');
} catch (ExtensionConfigurationExtensionNotConfiguredException|ExtensionConfigurationPathDoesNotExistException $e) {
// show an error message on how to configure the extension
}
}
}
where ->get()
may fail with the mentioned exceptions. So the extension authors have to handle them in their code (and PHPStorm complains because they are @internal
).
The classes are marked as @internal
because they should not be constructed outside of TYPO3 core, but with the current @internal
mark their "use" statement for catching is reported as well.
Updated by Gerrit Code Review almost 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73177
Updated by Gerrit Code Review almost 3 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73162
Updated by Stephan Großberndt almost 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d3d92168fb028850e4ff734d4f081f97bbfd0e9b.