$frontendLogin = GeneralUtility::makeInstanceService(\TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::class); if ($frontendLogin->user) { echo 'User is logged in'; } else { echo 'User is not logged in'; }
$configuration = GeneralUtility::makeInstanceService(\TYPO3\CMS\Core\Configuration\TypoScript\TypoScriptService::class); $value = $configuration->get('myExtension.settings.mySetting'); echo 'The value of mySetting is: ' . $value;In this example, we use makeInstanceService to create an instance of the `\TYPO3\CMS\Core\Configuration\TypoScript\TypoScriptService` class, which is the configuration service. We then use the `$configuration` object to access the `get` method, which retrieves the value of the specified setting. The `makeInstanceService` method is part of the `TYPO3\CMS\Core\Utility\GeneralUtility` class, which is in the `typo3/cms-core` package library.