6ac8ea0a5c598d6986d6e3fbc6c2f9257f7a1489
[Packages/TYPO3.CMS.git] / typo3 / sysext / about / Classes / Domain / Repository / ExtensionRepository.php
1 <?php
2 namespace TYPO3\CMS\About\Domain\Repository;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2012 Felix Kopp <felix@phorax.com>
8 *
9 * All rights reserved
10 *
11 * This script is part of the TYPO3 project. The TYPO3 project is
12 * free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * The GNU General Public License can be found at
18 * http://www.gnu.org/copyleft/gpl.html.
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Repository for Tx_About_Domain_Model_Extension
29 *
30 * @package TYPO3
31 * @subpackage about
32 * @author Felix Kopp <felix-source@phorax.com>
33 */
34 class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
35
36 /**
37 * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
38 */
39 protected $objectManager;
40
41 /**
42 * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
43 */
44 public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
45 $this->objectManager = $objectManager;
46 }
47
48 /**
49 * Finds all loaded extensions
50 *
51 * @return Tx_Extbase_Persistence_ObjectStorage<Tx_About_Domain_Model_Extension>
52 */
53 public function findAllLoaded() {
54 $loadedExtensions = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\ObjectStorage');
55 $loadedExtensionsArray = $GLOBALS['TYPO3_LOADED_EXT'];
56 foreach ($loadedExtensionsArray as $extensionKey => $extension) {
57 if (is_array($extension) && $extension['type'] != 'S') {
58 $emconfPath = PATH_site . $extension['siteRelPath'] . 'ext_emconf.php';
59 include $emconfPath;
60 $extension = $this->objectManager->create('TYPO3\\CMS\\About\\Domain\\Model\\Extension');
61 $extension->setKey($extensionKey);
62 $extension->setTitle($EM_CONF['']['title']);
63 $extension->setAuthor($EM_CONF['']['author']);
64 $extension->setAuthorEmail($EM_CONF['']['author_email']);
65 $loadedExtensions->attach($extension);
66 }
67 }
68 return $loadedExtensions;
69 }
70
71 }
72
73
74 ?>