Skip to content

Commit

Permalink
[TASK] Remove overkill extension classes in about module
Browse files Browse the repository at this point in the history
When the about module (EXT:about) was refactored into
Extbase, a Repository and Domain Model for Extensions was
added to render title, key and authors of an extension.

For modules this was done directly in the controller,
which is 100% sufficient in this one-time case, instead
of doing it the Extbase(tm) persistence way.

This way, all data is fetched the same way in the about module.

The two domain model / repository classes are removed,
and due to the fact that they are not part of the API,
a RST file is not added.

Resolves: #83890
Releases: master
Change-Id: I1169336452d7497ea0ed2e1a99553c164ec78612
Reviewed-on: https://review.typo3.org/55710
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
  • Loading branch information
bmack authored and liayn committed Feb 14, 2018
1 parent c924fbd commit 3ca4635
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 147 deletions.
40 changes: 25 additions & 15 deletions typo3/sysext/about/Classes/Controller/AboutController.php
Expand Up @@ -14,10 +14,10 @@
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\About\Domain\Repository\ExtensionRepository;
use TYPO3\CMS\Backend\Module\ModuleLoader;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\View\BackendTemplateView;
use TYPO3\CMS\Core\Package\PackageManager;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
Expand All @@ -32,19 +32,6 @@ class AboutController extends ActionController
*/
protected $defaultViewObjectName = BackendTemplateView::class;

/**
* @var ExtensionRepository
*/
protected $extensionRepository;

/**
* @param ExtensionRepository $extensionRepository
*/
public function injectExtensionRepository(ExtensionRepository $extensionRepository)
{
$this->extensionRepository = $extensionRepository;
}

/**
* Set up the doc header properly here
*
Expand Down Expand Up @@ -76,7 +63,7 @@ public function indexAction()
'copyrightYear' => TYPO3_copyright_year,
'donationUrl' => TYPO3_URL_DONATE,
'currentVersion' => TYPO3_version,
'loadedExtensions' => $this->extensionRepository->findAllLoaded(),
'loadedExtensions' => $this->getLoadedExtensions(),
'copyRightNotice' => BackendUtility::TYPO3_copyRightNotice(),
'warnings' => $warnings,
'modules' => $this->getModulesData()
Expand Down Expand Up @@ -132,4 +119,27 @@ protected function getSubModuleData(ModuleLoader $loadedModules, $moduleName)
}
return $subModulesData;
}

/**
* Fetches a list of all active (loaded) extensions in the current system
*
* @return array
*/
protected function getLoadedExtensions(): array
{
$extensions = [];
$packageManager = GeneralUtility::makeInstance(PackageManager::class);
foreach ($packageManager->getActivePackages() as $package) {
// Skip system extensions (= type: typo3-cms-framework)
if ($package->getValueFromComposerManifest('type') !== 'typo3-cms-extension') {
continue;
}
$extensions[] = [
'key' => $package->getPackageKey(),
'title' => $package->getPackageMetaData()->getDescription(),
'authors' => $package->getValueFromComposerManifest('authors')
];
}
return $extensions;
}
}
86 changes: 0 additions & 86 deletions typo3/sysext/about/Classes/Domain/Model/Extension.php

This file was deleted.

This file was deleted.

0 comments on commit 3ca4635

Please sign in to comment.