File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212use TYPO3 \CMS \Core \SingletonInterface ;
1313use TYPO3 \CMS \Core \Utility \GeneralUtility ;
1414use TYPO3 \CMS \Extbase \Configuration \ConfigurationManagerInterface ;
15+ use TYPO3 \CMS \Extbase \Configuration \Exception \NoServerRequestGivenException ;
1516
1617class TypoScriptService implements SingletonInterface
1718{
@@ -52,6 +53,10 @@ public function getTypoScriptByPath(string $path)
5253 $ all = $ this ->configurationManager ->getConfiguration (
5354 ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT
5455 );
56+ } catch (NoServerRequestGivenException $ error ) {
57+ // This case may happen when trying to read TypoScript from a CLI context. In this case, rather than just
58+ // giving up, we return an empty set of TypoScript.
59+ $ all = [];
5560 } catch (\RuntimeException $ exception ) {
5661 if ($ exception ->getCode () !== 1700841298 ) {
5762 throw $ exception ;
Original file line number Diff line number Diff line change 11parameters :
22 ignoreErrors :
3+ -
4+ message : " #^Dead catch - RuntimeException is never thrown in the try block\\ .$#"
5+ count : 1
6+ path : Classes/Service/TypoScriptService.php
37 -
48 message : " #^Parameter \\ #4 \\ $_ of method TYPO3\\\\ CMS\\\\ Core\\\\ DataHandling\\\\ DataHandler\\ :\\ :log\\ (\\ ) expects null, int given\\ .$#"
59 count : 1
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ parameters:
5252 - " #^Class TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Web\\\\Response not found\\.$ #"
5353 - " #^Class TYPO3Fluid\\\\Fluid\\\\Component\\\\Argument\\\\ArgumentCollection not found\\.$ #"
5454 - " #^Class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryData not found\\.$ #"
55+ - " #TYPO3\\\\CMS\\\\Extbase\\\\Configuration\\\\Exception\\\\NoServerRequestGivenException not found\\.$ #"
5556
5657 - " #TYPO3Fluid\\\\Fluid\\\\Component\\\\Argument\\\\ArgumentCollection #"
5758 - " #TYPO3Fluid\\\\Fluid\\\\Component\\\\Error\\\\ChildNotFoundException #"
You can’t perform that action at this time.
0 commit comments