Пример #1
0
 /**
  * Warms up the Extbase's data mapper (this is known not to be as complete as when
  * the whole Extbase boostrap is run but this is sufficient here and we do not want
  * to mix-up completely the normal TYPO3 bootstrap sequence).
  *
  * @return void
  */
 protected function warmUpExtbaseDataMapper()
 {
     $backupTemplateService = $GLOBALS['TSFE']->tmpl;
     $setup = \Causal\IgLdapSsoAuth\Utility\TypoScriptUtility::loadTypoScriptFromFile('EXT:extbase/ext_typoscript_setup.txt');
     $GLOBALS['TSFE']->tmpl = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\TemplateService');
     $GLOBALS['TSFE']->tmpl->setup = $setup;
     /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
     $objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     /** @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager */
     $configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
     $configuration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     // Do not forget to clean up our partial cache when exiting
     $this->cleanUpExtbaseCache = TRUE;
     // Restore previous template service
     $GLOBALS['TSFE']->tmpl = $backupTemplateService;
 }
Пример #2
0
 /**
  * Parses a mapping definition.
  *
  * @param string $mapping
  * @return array
  */
 public static function parseMapping($mapping = '')
 {
     $setup = \Causal\IgLdapSsoAuth\Utility\TypoScriptUtility::loadTypoScript($mapping);
     // Remove partial definitions
     $keys = array_keys($setup);
     foreach ($keys as $key) {
         if (substr($key, -1) !== '.') {
             if (empty($setup[$key])) {
                 unset($setup[$key]);
             }
         }
     }
     return $setup;
 }