[TASK] Use fully qualified name resolution in PHP 5.5
[Packages/TYPO3.CMS.git] / typo3 / sysext / about / Classes / Domain / Repository / ExtensionRepository.php
1 <?php
2 namespace TYPO3\CMS\About\Domain\Repository;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16 /**
17 * Repository for TYPO3\CMS\About\Domain\Model\Extension
18 */
19 class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
20
21 /**
22 * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
23 */
24 protected $objectManager;
25
26 /**
27 * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
28 */
29 public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
30 $this->objectManager = $objectManager;
31 }
32
33 /**
34 * Finds all loaded extensions
35 *
36 * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\About\Domain\Model\Extension>
37 */
38 public function findAllLoaded() {
39 $loadedExtensions = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class);
40 $loadedExtensionsArray = $GLOBALS['TYPO3_LOADED_EXT'];
41 foreach ($loadedExtensionsArray as $extensionKey => $extension) {
42 if ((is_array($extension) || $extension instanceof \ArrayAccess) && $extension['type'] != 'S') {
43 $emconfPath = PATH_site . $extension['siteRelPath'] . 'ext_emconf.php';
44 if (file_exists($emconfPath)) {
45 include $emconfPath;
46 $extension = $this->objectManager->get(\TYPO3\CMS\About\Domain\Model\Extension::class);
47 $extension->setKey($extensionKey);
48 $extension->setTitle($EM_CONF['']['title']);
49 $extension->setAuthor($EM_CONF['']['author']);
50 $extension->setAuthorEmail($EM_CONF['']['author_email']);
51 $loadedExtensions->attach($extension);
52 }
53 }
54 }
55 return $loadedExtensions;
56 }
57
58 }