TYPO3  7.6
about/Classes/Domain/Repository/ExtensionRepository.php
Go to the documentation of this file.
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 
21 {
25  protected $objectManager;
26 
30  public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
31  {
32  $this->objectManager = $objectManager;
33  }
34 
40  public function findAllLoaded()
41  {
42  $loadedExtensions = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class);
43  $loadedExtensionsArray = $GLOBALS['TYPO3_LOADED_EXT'];
44  foreach ($loadedExtensionsArray as $extensionKey => $extension) {
45  if ((is_array($extension) || $extension instanceof \ArrayAccess) && $extension['type'] != 'S') {
46  $emconfPath = PATH_site . $extension['siteRelPath'] . 'ext_emconf.php';
47  if (file_exists($emconfPath)) {
48  include $emconfPath;
49  $extension = $this->objectManager->get(\TYPO3\CMS\About\Domain\Model\Extension::class);
50  $extension->setKey($extensionKey);
51  $extension->setTitle($EM_CONF['']['title']);
52  $extension->setAuthor($EM_CONF['']['author']);
53  $extension->setAuthorEmail($EM_CONF['']['author_email']);
54  $loadedExtensions->attach($extension);
55  }
56  }
57  }
58  return $loadedExtensions;
59  }
60 }