[FEATURE] Storable Filters for Upgrade Analysis
[Packages/TYPO3.CMS.git] / typo3 / sysext / install / Classes / Controller / Action / Tool / UpgradeAnalysis.php
1 <?php
2 namespace TYPO3\CMS\Install\Controller\Action\Tool;
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 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
18 use TYPO3\CMS\Install\Controller\Action\AbstractAction;
19 use TYPO3\CMS\Install\UpgradeAnalysis\DocumentationFile;
20
21 /**
22 * Run code analysis based on changelog documentation
23 */
24 class UpgradeAnalysis extends AbstractAction
25 {
26
27 /**
28 * Executes the action upon click in the Install Tool Menu
29 *
30 * All available documentation files are aggregated and
31 * passed to the frontend to be displayed as a list of entries.
32 *
33 * All following actions are handled via Ajax.
34 *
35 * @return string Rendered content
36 */
37 protected function executeAction()
38 {
39 $documentationFileService = new DocumentationFile();
40 $documentationFiles = $documentationFileService->findDocumentationFiles(
41 PATH_site . ExtensionManagementUtility::siteRelPath('core') . 'Documentation/Changelog'
42 );
43
44 /** @var $formProtection \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection */
45 $formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(
46 \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection::class
47 );
48 $saveIgnoredItemsToken = $formProtection->generateToken('installTool', 'saveIgnoredItems');
49 $removeIgnoredItemsToken = $formProtection->generateToken('installTool', 'removeIgnoredItems');
50 $this->view->assignMultiple([
51 'saveIgnoredItemsToken' => $saveIgnoredItemsToken,
52 'removeIgnoredItemsToken' => $removeIgnoredItemsToken,
53 ]);
54
55 $this->view->assign('files', $documentationFiles);
56 return $this->view->render();
57 }
58 }