[TASK] Update to phpunit 4.1
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Utility / LocalizationUtility.php
index 4fb287b..f5601ef 100644 (file)
@@ -77,6 +77,11 @@ class LocalizationUtility {
         */
        static protected $alternativeLanguageKeys = array();
 
+       /**
+        * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
+        */
+       static protected $configurationManager = NULL;
+
        /**
         * Returns the localized label of the LOCAL_LANG key, $key.
         *
@@ -298,8 +303,12 @@ class LocalizationUtility {
         * @return \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
         */
        static protected function getConfigurationManager() {
+               if (!is_null(static::$configurationManager)) {
+                       return static::$configurationManager;
+               }
                $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
                $configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
+               static::$configurationManager = $configurationManager;
                return $configurationManager;
        }
 }