[TASK] Use fully qualified name resolution in PHP 5.5
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Report / ExtensionStatus.php
index 97c4b4b..7dbcf39 100644 (file)
@@ -1,31 +1,18 @@
 <?php
 namespace TYPO3\CMS\Extensionmanager\Report;
 
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2010-2013 Steffen Kamper <steffen@typo3.org>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the text file GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
+/**
+ * This file is part of the TYPO3 CMS project.
  *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
  *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
  *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
+ * The TYPO3 project - inspiring people to share!
+ */
 
 /**
  * Extension status reports
@@ -71,10 +58,11 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface {
         * Default constructor
         */
        public function __construct() {
-               $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
-               $this->repositoryRepository = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository');
-               $this->listUtility = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\ListUtility');
-               $this->languageService = $this->objectManager->get('TYPO3\\CMS\\Lang\\LanguageService');
+               $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
+               $this->repositoryRepository = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository::class);
+               $this->listUtility = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\ListUtility::class);
+               $this->languageService = $this->objectManager->get(\TYPO3\CMS\Lang\LanguageService::class);
+               $this->languageService->includeLLFile('EXT:extensionmanager/Resources/Private/Language/locallang.xlf');
        }
 
        /**
@@ -105,23 +93,23 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface {
                $mainRepository = $this->repositoryRepository->findOneTypo3OrgRepository();
 
                if (is_null($mainRepository) === TRUE) {
-                       $value = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.mainRepository.notFound.value');
-                       $message = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.mainRepository.notFound.message');
+                       $value = $this->languageService->getLL('report.status.mainRepository.notFound.value');
+                       $message = $this->languageService->getLL('report.status.mainRepository.notFound.message');
                        $severity = \TYPO3\CMS\Reports\Status::ERROR;
                } elseif ($mainRepository->getLastUpdate()->getTimestamp() < $GLOBALS['EXEC_TIME'] - 24 * 60 * 60 * 7) {
-                       $value = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.mainRepository.notUpToDate.value');
-                       $message = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.mainRepository.notUpToDate.message');
+                       $value = $this->languageService->getLL('report.status.mainRepository.notUpToDate.value');
+                       $message = $this->languageService->getLL('report.status.mainRepository.notUpToDate.message');
                        $severity = \TYPO3\CMS\Reports\Status::NOTICE;
                } else {
-                       $value = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.mainRepository.upToDate.value');
+                       $value = $this->languageService->getLL('report.status.mainRepository.upToDate.value');
                        $message = '';
                        $severity = \TYPO3\CMS\Reports\Status::OK;
                }
 
                /** @var $status \TYPO3\CMS\Reports\Status */
                $status = $this->objectManager->get(
-                       'TYPO3\\CMS\\Reports\\Status',
-                       $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.mainRepository.title'),
+                       \TYPO3\CMS\Reports\Status::class,
+                       $this->languageService->getLL('report.status.mainRepository.title'),
                        $value,
                        $message,
                        $severity
@@ -186,124 +174,124 @@ class ExtensionStatus implements \TYPO3\CMS\Reports\StatusProviderInterface {
                $result = new \stdClass();
 
                if (count($loadedInsecure) === 0) {
-                       $value = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedExtensions.noInsecureExtensionLoaded.value');
+                       $value = $this->languageService->getLL('report.status.loadedExtensions.noInsecureExtensionLoaded.value');
                        $message = '';
                        $severity = \TYPO3\CMS\Reports\Status::OK;
                } else {
                        $value = sprintf(
-                               $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedExtensions.insecureExtensionLoaded.value'),
+                               $this->languageService->getLL('report.status.loadedExtensions.insecureExtensionLoaded.value'),
                                count($loadedInsecure)
                        );
                        $extensionList = array();
                        foreach ($loadedInsecure as $insecureExtension) {
                                $extensionList[] = sprintf(
-                                       $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedExtensions.insecureExtensionLoaded.message.extension'),
+                                       $this->languageService->getLL('report.status.loadedExtensions.insecureExtensionLoaded.message.extension'),
                                        $insecureExtension['extensionKey'],
                                        $insecureExtension['version']
                                );
                        }
                        $message = sprintf(
-                               $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedExtensions.insecureExtensionLoaded.message'),
+                               $this->languageService->getLL('report.status.loadedExtensions.insecureExtensionLoaded.message'),
                                implode('', $extensionList)
                        );
                        $severity = \TYPO3\CMS\Reports\Status::ERROR;
                }
                $result->loaded = $this->objectManager->get(
-                       'TYPO3\\CMS\\Reports\\Status',
-                       $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedExtensions.title'),
+                       \TYPO3\CMS\Reports\Status::class,
+                       $this->languageService->getLL('report.status.loadedExtensions.title'),
                        $value,
                        $message,
                        $severity
                );
 
                if (count($existingInsecure) === 0) {
-                       $value = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingExtensions.noInsecureExtensionExists.value');
+                       $value = $this->languageService->getLL('report.status.existingExtensions.noInsecureExtensionExists.value');
                        $message = '';
                        $severity = \TYPO3\CMS\Reports\Status::OK;
                } else {
                        $value = sprintf(
-                               $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingExtensions.insecureExtensionExists.value'),
+                               $this->languageService->getLL('report.status.existingExtensions.insecureExtensionExists.value'),
                                count($existingInsecure)
                        );
                        $extensionList = array();
                        foreach ($existingInsecure as $insecureExtension) {
                                $extensionList[] = sprintf(
-                                       $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingExtensions.insecureExtensionExists.message.extension'),
+                                       $this->languageService->getLL('report.status.existingExtensions.insecureExtensionExists.message.extension'),
                                        $insecureExtension['extensionKey'],
                                        $insecureExtension['version']
                                );
                        }
                        $message = sprintf(
-                               $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingExtensions.insecureExtensionExists.message'),
+                               $this->languageService->getLL('report.status.existingExtensions.insecureExtensionExists.message'),
                                implode('', $extensionList)
                        );
                        $severity = \TYPO3\CMS\Reports\Status::WARNING;
                }
                $result->existing = $this->objectManager->get(
-                       'TYPO3\\CMS\\Reports\\Status',
-                       $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingExtensions.title'),
+                       \TYPO3\CMS\Reports\Status::class,
+                       $this->languageService->getLL('report.status.existingExtensions.title'),
                        $value,
                        $message,
                        $severity
                );
 
                if (count($loadedOutdated) === 0) {
-                       $value = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedOutdatedExtensions.noOutdatedExtensionLoaded.value');
+                       $value = $this->languageService->getLL('report.status.loadedOutdatedExtensions.noOutdatedExtensionLoaded.value');
                        $message = '';
                        $severity = \TYPO3\CMS\Reports\Status::OK;
                } else {
                        $value = sprintf(
-                               $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedOutdatedExtensions.outdatedExtensionLoaded.value'),
+                               $this->languageService->getLL('report.status.loadedOutdatedExtensions.outdatedExtensionLoaded.value'),
                                count($loadedOutdated)
                        );
                        $extensionList = array();
                        foreach ($loadedOutdated as $outdatedExtension) {
                                $extensionList[] = sprintf(
-                                       $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedOutdatedExtensions.outdatedExtensionLoaded.message.extension'),
+                                       $this->languageService->getLL('report.status.loadedOutdatedExtensions.outdatedExtensionLoaded.message.extension'),
                                        $outdatedExtension['extensionKey'],
                                        $outdatedExtension['version']
                                );
                        }
                        $message = sprintf(
-                               $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedOutdatedExtensions.outdatedExtensionLoaded.message'),
+                               $this->languageService->getLL('report.status.loadedOutdatedExtensions.outdatedExtensionLoaded.message'),
                                implode('', $extensionList)
                        );
                        $severity = \TYPO3\CMS\Reports\Status::WARNING;
                }
                $result->loadedoutdated = $this->objectManager->get(
-                       'TYPO3\\CMS\\Reports\\Status',
-                       $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.loadedOutdatedExtensions.title'),
+                       \TYPO3\CMS\Reports\Status::class,
+                       $this->languageService->getLL('report.status.loadedOutdatedExtensions.title'),
                        $value,
                        $message,
                        $severity
                );
 
                if (count($existingOutdated) === 0) {
-                       $value = $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingOutdatedExtensions.noOutdatedExtensionExists.value');
+                       $value = $this->languageService->getLL('report.status.existingOutdatedExtensions.noOutdatedExtensionExists.value');
                        $message = '';
                        $severity = \TYPO3\CMS\Reports\Status::OK;
                } else {
                        $value = sprintf(
-                               $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingOutdatedExtensions.outdatedExtensionExists.value'),
+                               $this->languageService->getLL('report.status.existingOutdatedExtensions.outdatedExtensionExists.value'),
                                count($existingOutdated)
                        );
                        $extensionList = array();
                        foreach ($existingOutdated as $outdatedExtension) {
                                $extensionList[] = sprintf(
-                                       $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingOutdatedExtensions.outdatedExtensionExists.message.extension'),
+                                       $this->languageService->getLL('report.status.existingOutdatedExtensions.outdatedExtensionExists.message.extension'),
                                        $outdatedExtension['extensionKey'],
                                        $outdatedExtension['version']
                                );
                        }
                        $message = sprintf(
-                               $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingOutdatedExtensions.outdatedExtensionExists.message'),
+                               $this->languageService->getLL('report.status.existingOutdatedExtensions.outdatedExtensionExists.message'),
                                implode('', $extensionList)
                        );
                        $severity = \TYPO3\CMS\Reports\Status::WARNING;
                }
                $result->existingoutdated = $this->objectManager->get(
-                       'TYPO3\\CMS\\Reports\\Status',
-                       $this->languageService->sL('LLL:EXT:extensionmanager/Resources/Private/Language/locallang.xlf:report.status.existingOutdatedExtensions.title'),
+                       \TYPO3\CMS\Reports\Status::class,
+                       $this->languageService->getLL('report.status.existingOutdatedExtensions.title'),
                        $value,
                        $message,
                        $severity