TYPO3 CMS  TYPO3_6-2
ConfigurationManager.php
Go to the documentation of this file.
1 <?php
3 
23 
28  protected $objectManager;
29 
34 
40 
46  public function initializeObject() {
48  }
49 
54  if ($this->environmentService->isEnvironmentInFrontendMode()) {
55  $this->concreteConfigurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\FrontendConfigurationManager');
56  } else {
57  $this->concreteConfigurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\BackendConfigurationManager');
58  }
59  }
60 
65  public function setContentObject(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject = NULL) {
66  $this->concreteConfigurationManager->setContentObject($contentObject);
67  }
68 
72  public function getContentObject() {
73  return $this->concreteConfigurationManager->getContentObject();
74  }
75 
83  public function setConfiguration(array $configuration = array()) {
84  $this->concreteConfigurationManager->setConfiguration($configuration);
85  }
86 
104  public function getConfiguration($configurationType, $extensionName = NULL, $pluginName = NULL) {
105  switch ($configurationType) {
106  case self::CONFIGURATION_TYPE_SETTINGS:
107  $configuration = $this->concreteConfigurationManager->getConfiguration($extensionName, $pluginName);
108  return $configuration['settings'];
109  case self::CONFIGURATION_TYPE_FRAMEWORK:
110  return $this->concreteConfigurationManager->getConfiguration($extensionName, $pluginName);
111  case self::CONFIGURATION_TYPE_FULL_TYPOSCRIPT:
112  return $this->concreteConfigurationManager->getTypoScriptSetup();
113  default:
114  throw new \TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException('Invalid configuration type "' . $configurationType . '"', 1206031879);
115  }
116  }
117 
128  public function isFeatureEnabled($featureName) {
129  $configuration = $this->getConfiguration(self::CONFIGURATION_TYPE_FRAMEWORK);
130  return (boolean) (isset($configuration['features'][$featureName]) && $configuration['features'][$featureName]);
131  }
132 }
setContentObject(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject=NULL)
getConfiguration($configurationType, $extensionName=NULL, $pluginName=NULL)