‪TYPO3CMS  11.5
UpgradeController.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use PhpParser\NodeTraverser;
21 use PhpParser\NodeVisitor\NameResolver;
22 use PhpParser\ParserFactory;
23 use Psr\Http\Message\ResponseInterface;
24 use Psr\Http\Message\ServerRequestInterface;
25 use Symfony\Component\Finder\Finder;
26 use Symfony\Component\Finder\SplFileInfo;
38 use TYPO3\CMS\Core\Package\PackageManager;
71 use TYPO3\CMS\Install\Service\CoreVersionService;
76 
82 {
86  protected ‪$coreUpdateService;
87 
91  protected ‪$coreVersionService;
92 
97 
102 
106  private ‪$lateBootService;
107 
108  public function ‪__construct(
109  PackageManager ‪$packageManager,
112  ) {
113  $this->packageManager = ‪$packageManager;
114  $this->lateBootService = ‪$lateBootService;
115  $this->upgradeWizardsService = ‪$upgradeWizardsService;
116  }
117 
124  protected ‪$matchers = [
125  [
126  'class' => ArrayDimensionMatcher::class,
127  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php',
128  ],
129  [
130  'class' => ArrayGlobalMatcher::class,
131  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/ArrayGlobalMatcher.php',
132  ],
133  [
134  'class' => ClassConstantMatcher::class,
135  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/ClassConstantMatcher.php',
136  ],
137  [
138  'class' => ClassNameMatcher::class,
139  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php',
140  ],
141  [
142  'class' => ConstantMatcher::class,
143  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/ConstantMatcher.php',
144  ],
145  [
146  'class' => ConstructorArgumentMatcher::class,
147  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/ConstructorArgumentMatcher.php',
148  ],
149  [
150  'class' => PropertyAnnotationMatcher::class,
151  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/PropertyAnnotationMatcher.php',
152  ],
153  [
154  'class' => MethodAnnotationMatcher::class,
155  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/MethodAnnotationMatcher.php',
156  ],
157  [
158  'class' => FunctionCallMatcher::class,
159  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/FunctionCallMatcher.php',
160  ],
161  [
162  'class' => InterfaceMethodChangedMatcher::class,
163  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/InterfaceMethodChangedMatcher.php',
164  ],
165  [
166  'class' => MethodArgumentDroppedMatcher::class,
167  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/MethodArgumentDroppedMatcher.php',
168  ],
169  [
170  'class' => MethodArgumentDroppedStaticMatcher::class,
171  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/MethodArgumentDroppedStaticMatcher.php',
172  ],
173  [
174  'class' => MethodArgumentRequiredMatcher::class,
175  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/MethodArgumentRequiredMatcher.php',
176  ],
177  [
178  'class' => MethodArgumentRequiredStaticMatcher::class,
179  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/MethodArgumentRequiredStaticMatcher.php',
180  ],
181  [
182  'class' => MethodArgumentUnusedMatcher::class,
183  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/MethodArgumentUnusedMatcher.php',
184  ],
185  [
186  'class' => MethodCallMatcher::class,
187  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php',
188  ],
189  [
190  'class' => MethodCallStaticMatcher::class,
191  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php',
192  ],
193  [
194  'class' => PropertyExistsStaticMatcher::class,
195  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/PropertyExistsStaticMatcher.php',
196  ],
197  [
198  'class' => PropertyProtectedMatcher::class,
199  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/PropertyProtectedMatcher.php',
200  ],
201  [
202  'class' => PropertyPublicMatcher::class,
203  'configurationFile' => 'EXT:install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php',
204  ],
205  ];
206 
213  public function ‪cardsAction(ServerRequestInterface $request): ResponseInterface
214  {
215  $view = $this->‪initializeStandaloneView($request, 'Upgrade/Cards.html');
216  $hasExtensions = false;
217  foreach ($this->packageManager->getAvailablePackages() as $package) {
218  if (!$package->getPackageMetaData()->isExtensionType() || $package->getPackageMetaData()->isFrameworkType()) {
219  continue;
220  }
221 
222  $hasExtensions = true;
223  break;
224  }
225 
226  $view->assign('hasExtensions', $hasExtensions);
227  return new JsonResponse([
228  'success' => true,
229  'html' => $view->render(),
230  ]);
231  }
232 
239  public function ‪coreUpdateActivateAction(ServerRequestInterface $request): ResponseInterface
240  {
241  $this->‪coreUpdateInitialize();
242  return new JsonResponse([
243  'success' => $this->coreUpdateService->activateVersion($this->coreUpdateGetVersionToHandle($request)),
244  'status' => $this->coreUpdateService->getMessages(),
245  ]);
246  }
247 
254  public function ‪coreUpdateCheckPreConditionsAction(ServerRequestInterface $request): ResponseInterface
255  {
256  $this->‪coreUpdateInitialize();
257  return new JsonResponse([
258  'success' => $this->coreUpdateService->checkPreConditions($this->coreUpdateGetVersionToHandle($request)),
259  'status' => $this->coreUpdateService->getMessages(),
260  ]);
261  }
262 
269  public function ‪coreUpdateDownloadAction(ServerRequestInterface $request): ResponseInterface
270  {
271  $this->‪coreUpdateInitialize();
272  return new JsonResponse([
273  'success' => $this->coreUpdateService->downloadVersion($this->coreUpdateGetVersionToHandle($request)),
274  'status' => $this->coreUpdateService->getMessages(),
275  ]);
276  }
277 
284  public function ‪coreUpdateGetDataAction(ServerRequestInterface $request): ResponseInterface
285  {
286  $view = $this->‪initializeStandaloneView($request, 'Upgrade/CoreUpdate.html');
287  ‪$coreUpdateService = GeneralUtility::makeInstance(CoreUpdateService::class);
288  ‪$coreVersionService = GeneralUtility::makeInstance(CoreVersionService::class);
289 
290  $coreUpdateEnabled = ‪$coreUpdateService->‪isCoreUpdateEnabled();
291  $coreUpdateComposerMode = ‪Environment::isComposerMode();
292  $coreUpdateIsReleasedVersion = ‪$coreVersionService->isInstalledVersionAReleasedVersion();
293  $coreUpdateIsSymLinkedCore = is_link(‪Environment::getPublicPath() . '/typo3_src');
294  $isUpdatable = !$coreUpdateComposerMode && $coreUpdateEnabled && $coreUpdateIsReleasedVersion && $coreUpdateIsSymLinkedCore;
295 
296  $view->assignMultiple([
297  'coreIsUpdatable' => $isUpdatable,
298  'coreUpdateEnabled' => $coreUpdateEnabled,
299  'coreUpdateComposerMode' => $coreUpdateComposerMode,
300  'coreUpdateIsReleasedVersion' => $coreUpdateIsReleasedVersion,
301  'coreUpdateIsSymLinkedCore' => $coreUpdateIsSymLinkedCore,
302  ]);
303 
304  $buttons = [];
305  if ($isUpdatable) {
306  $buttons[] = [
307  'btnClass' => 'btn-warning t3js-coreUpdate-button t3js-coreUpdate-init',
308  'name' => 'coreUpdateCheckForUpdate',
309  'text' => 'Check for core updates',
310  'dataAttributes' => [
311  'action' => 'checkForUpdate',
312  ],
313  ];
314  }
315 
316  return new JsonResponse([
317  'success' => true,
318  'html' => $view->render(),
319  'buttons' => $buttons,
320  ]);
321  }
322 
328  public function ‪coreUpdateIsUpdateAvailableAction(): ResponseInterface
329  {
330  $action = null;
331  $this->‪coreUpdateInitialize();
332  $messageQueue = new ‪FlashMessageQueue('install');
333 
334  $messages = [];
335 
336  if ($this->coreVersionService->isInstalledVersionAReleasedVersion()) {
337  $versionMaintenanceWindow = $this->coreVersionService->getMaintenanceWindow();
338  $renderVersionInformation = false;
339 
340  if (!$versionMaintenanceWindow->isSupportedByCommunity() && !$versionMaintenanceWindow->isSupportedByElts()) {
341  $messages[] = [
342  'title' => 'Outdated version',
343  'message' => 'The currently installed TYPO3 version ' . $this->coreVersionService->getInstalledVersion() . ' does not receive any further updates, please consider upgrading to a supported version!',
344  'severity' => ‪FlashMessage::ERROR,
345  ];
346  $renderVersionInformation = true;
347  } else {
348  $currentVersion = $this->coreVersionService->getInstalledVersion();
349  $isCurrentVersionElts = $this->coreVersionService->isCurrentInstalledVersionElts();
350  $latestRelease = $this->coreVersionService->getYoungestPatchRelease();
351 
352  $availableReleases = [];
353  if ($this->coreVersionService->isPatchReleaseSuitableForUpdate($latestRelease)) {
354  $availableReleases[] = $latestRelease;
355 
356  if (!$latestRelease->isElts()) {
357  $action = ['title' => 'Update now to version ' . $latestRelease->getVersion(), 'action' => 'updateRegular'];
358  }
359  }
360  if (!$versionMaintenanceWindow->isSupportedByCommunity()) {
361  if ($latestRelease->isElts()) {
362  // Check if there's a public release left that's not installed yet
363  $latestCommunityDrivenRelease = $this->coreVersionService->getYoungestCommunityPatchRelease();
364  if ($this->coreVersionService->isPatchReleaseSuitableForUpdate($latestCommunityDrivenRelease)) {
365  $availableReleases[] = $latestCommunityDrivenRelease;
366  $action = ['title' => 'Update now to version ' . $latestCommunityDrivenRelease->getVersion(), 'action' => 'updateRegular'];
367  }
368  } elseif (!$isCurrentVersionElts) {
369  // Inform user about ELTS being available soon if:
370  // - regular support ran out
371  // - the current installed version is no ELTS
372  // - no ELTS update was released, yet
373  $messages[] = [
374  'title' => 'ELTS will be available soon',
375  'message' => sprintf('The currently installed TYPO3 version %s doesn\'t receive any community-driven updates anymore, consider subscribing to Extended Long Term Support (ELTS) releases. Please read the information below.', $currentVersion),
376  'severity' => ‪FlashMessage::WARNING,
377  ];
378  $renderVersionInformation = true;
379  }
380  }
381 
382  if ($availableReleases === []) {
383  $messages[] = [
384  'title' => 'Up to date',
385  'message' => 'There are no TYPO3 updates available.',
386  'severity' => ‪FlashMessage::NOTICE,
387  ];
388  } else {
389  foreach ($availableReleases as $availableRelease) {
390  $isUpdateSecurityRelevant = $this->coreVersionService->isUpdateSecurityRelevant($availableRelease);
391  $versionString = $availableRelease->getVersion();
392  if ($availableRelease->isElts()) {
393  $versionString .= ' ELTS';
394  }
395 
396  if ($isUpdateSecurityRelevant) {
397  $title = ($availableRelease->isElts() ? 'ELTS ' : '') . 'Security update available!';
398  $message = sprintf('The currently installed version is %s, update to security relevant released version %s is available.', $currentVersion, $versionString);
399  $severity = ‪FlashMessage::ERROR;
400  } else {
401  $title = ($availableRelease->isElts() ? 'ELTS ' : '') . 'Update available!';
402  $message = sprintf('Currently installed version is %s, update to regular released version %s is available.', $currentVersion, $versionString);
403  $severity = ‪FlashMessage::WARNING;
404  }
405 
406  if ($availableRelease->isElts()) {
407  if ($isCurrentVersionElts) {
408  $message .= ' Please visit my.typo3.org to download the release in your ELTS area.';
409  } else {
410  $message .= ' ' . sprintf('The currently installed TYPO3 version %s doesn\'t receive any community-driven updates anymore, consider subscribing to Extended Long Term Support (ELTS) releases. Please read the information below.', $currentVersion);
411  }
412 
413  $renderVersionInformation = true;
414  }
415 
416  $messages[] = [
417  'title' => $title,
418  'message' => $message,
419  'severity' => $severity,
420  ];
421  }
422  }
423  }
424 
425  if ($renderVersionInformation) {
426  $supportedMajorReleases = $this->coreVersionService->getSupportedMajorReleases();
427  $supportMessages = [];
428  if (!empty($supportedMajorReleases['community'])) {
429  $supportMessages[] = sprintf('Currently community-supported TYPO3 versions: %s (more information at https://get.typo3.org).', implode(', ', $supportedMajorReleases['community']));
430  }
431  if (!empty($supportedMajorReleases['elts'])) {
432  $supportMessages[] = sprintf('Currently supported TYPO3 ELTS versions: %s (more information at https://typo3.com/elts).', implode(', ', $supportedMajorReleases['elts']));
433  }
434 
435  $messages[] = [
436  'title' => 'TYPO3 Version information',
437  'message' => implode(' ', $supportMessages),
438  'severity' => ‪FlashMessage::INFO,
439  ];
440  }
441 
442  foreach ($messages as $message) {
443  $messageQueue->enqueue(new ‪FlashMessage($message['message'], $message['title'], $message['severity']));
444  }
445  } else {
446  $messageQueue->enqueue(new ‪FlashMessage(
447  '',
448  'Current version is a development version and can not be updated',
450  ));
451  }
452  $responseData = [
453  'success' => true,
454  'status' => $messageQueue,
455  ];
456  if (isset($action)) {
457  $responseData['action'] = $action;
458  }
459  return new ‪JsonResponse($responseData);
460  }
461 
468  public function ‪coreUpdateMoveAction(ServerRequestInterface $request): ResponseInterface
469  {
470  $this->‪coreUpdateInitialize();
471  return new ‪JsonResponse([
472  'success' => $this->coreUpdateService->moveVersion($this->coreUpdateGetVersionToHandle($request)),
473  'status' => $this->coreUpdateService->getMessages(),
474  ]);
475  }
476 
483  public function ‪coreUpdateUnpackAction(ServerRequestInterface $request): ResponseInterface
484  {
485  $this->‪coreUpdateInitialize();
486  return new JsonResponse([
487  'success' => $this->coreUpdateService->unpackVersion($this->coreUpdateGetVersionToHandle($request)),
488  'status' => $this->coreUpdateService->getMessages(),
489  ]);
490  }
491 
498  public function ‪coreUpdateVerifyChecksumAction(ServerRequestInterface $request): ResponseInterface
499  {
500  $this->‪coreUpdateInitialize();
501  return new JsonResponse([
502  'success' => $this->coreUpdateService->verifyFileChecksum($this->coreUpdateGetVersionToHandle($request)),
503  'status' => $this->coreUpdateService->getMessages(),
504  ]);
505  }
506 
513  public function ‪extensionCompatTesterLoadedExtensionListAction(ServerRequestInterface $request): ResponseInterface
514  {
515  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
516  $view = $this->‪initializeStandaloneView($request, 'Upgrade/ExtensionCompatTester.html');
517  $view->assignMultiple([
518  'extensionCompatTesterLoadExtLocalconfToken' => $formProtection->generateToken('installTool', 'extensionCompatTesterLoadExtLocalconf'),
519  'extensionCompatTesterLoadExtTablesToken' => $formProtection->generateToken('installTool', 'extensionCompatTesterLoadExtTables'),
520  'extensionCompatTesterUninstallToken' => $formProtection->generateToken('installTool', 'extensionCompatTesterUninstallExtension'),
521  ]);
522 
523  return new JsonResponse([
524  'success' => true,
525  'html' => $view->render(),
526  'buttons' => [
527  [
528  'btnClass' => 'btn-default disabled t3js-extensionCompatTester-check',
529  'text' => 'Check extensions',
530  ],
531  ],
532  ]);
533  }
534 
541  public function ‪extensionCompatTesterLoadExtLocalconfAction(ServerRequestInterface $request): ResponseInterface
542  {
543  $brokenExtensions = [];
544  $container = $this->lateBootService->getContainer();
545  $backup = $this->lateBootService->makeCurrent($container);
546 
547  foreach ($this->packageManager->getActivePackages() as $package) {
548  try {
550  } catch (\Throwable $e) {
551  $brokenExtensions[] = [
552  'name' => $package->getPackageKey(),
553  'isProtected' => $package->isProtected(),
554  ];
555  }
556  }
557 
558  $this->lateBootService->makeCurrent(null, $backup);
559 
560  return new JsonResponse([
561  'brokenExtensions' => $brokenExtensions,
562  ], empty($brokenExtensions) ? 200 : 500);
563  }
564 
571  public function ‪extensionCompatTesterLoadExtTablesAction(ServerRequestInterface $request): ResponseInterface
572  {
573  $brokenExtensions = [];
574  $container = $this->lateBootService->getContainer();
575  $backup = $this->lateBootService->makeCurrent($container);
576 
577  $activePackages = $this->packageManager->getActivePackages();
578  foreach ($activePackages as $package) {
579  // Load all ext_localconf files first
581  }
582  foreach ($activePackages as $package) {
583  try {
585  } catch (\Throwable $e) {
586  $brokenExtensions[] = [
587  'name' => $package->getPackageKey(),
588  'isProtected' => $package->isProtected(),
589  ];
590  }
591  }
592 
593  $this->lateBootService->makeCurrent(null, $backup);
594 
595  return new JsonResponse([
596  'brokenExtensions' => $brokenExtensions,
597  ], empty($brokenExtensions) ? 200 : 500);
598  }
599 
607  public function ‪extensionCompatTesterUninstallExtensionAction(ServerRequestInterface $request): ResponseInterface
608  {
609  $extension = $request->getParsedBody()['install']['extension'];
610  if (empty($extension)) {
611  throw new \RuntimeException(
612  'No extension given',
613  1505407269
614  );
615  }
616  $messageQueue = new FlashMessageQueue('install');
617  if (‪ExtensionManagementUtility::isLoaded($extension)) {
618  try {
620  GeneralUtility::makeInstance(ClearCacheService::class)->clearAll();
621  GeneralUtility::makeInstance(OpcodeCacheService::class)->clearAllActive();
622 
623  $messageQueue->enqueue(new FlashMessage(
624  'Extension "' . $extension . '" unloaded.',
625  '',
627  ));
628  } catch (\Exception $e) {
629  $messageQueue->enqueue(new FlashMessage(
630  $e->getMessage(),
631  '',
633  ));
634  }
635  }
636  return new JsonResponse([
637  'success' => true,
638  'status' => $messageQueue,
639  ]);
640  }
641 
648  public function ‪extensionScannerGetDataAction(ServerRequestInterface $request): ResponseInterface
649  {
650  $view = $this->‪initializeStandaloneView($request, 'Upgrade/ExtensionScanner.html');
651  $extensions = [];
652  foreach ($this->packageManager->getAvailablePackages() as $package) {
653  if (!$package->getPackageMetaData()->isExtensionType() || $package->getPackageMetaData()->isFrameworkType()) {
654  continue;
655  }
656 
657  $extensions[] = $package->getPackageKey();
658  }
659  sort($extensions);
660  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
661  $view->assignMultiple([
662  'extensionScannerExtensionList' => $extensions,
663  'extensionScannerFilesToken' => $formProtection->generateToken('installTool', 'extensionScannerFiles'),
664  'extensionScannerScanFileToken' => $formProtection->generateToken('installTool', 'extensionScannerScanFile'),
665  'extensionScannerMarkFullyScannedRestFilesToken' => $formProtection->generateToken('installTool', 'extensionScannerMarkFullyScannedRestFiles'),
666  ]);
667  return new JsonResponse([
668  'success' => true,
669  'html' => $view->render(),
670  'buttons' => [
671  [
672  'btnClass' => 'btn-default t3js-extensionScanner-scan-all',
673  'text' => 'Scan all',
674  ],
675  ],
676  ]);
677  }
678 
685  public function ‪extensionScannerFilesAction(ServerRequestInterface $request): ResponseInterface
686  {
687  // Get and validate path
688  $extension = $request->getParsedBody()['install']['extension'];
689  $extensionBasePath = $this->packageManager->getPackage($extension)->getPackagePath();
690  if (empty($extension) || !GeneralUtility::isAllowedAbsPath($extensionBasePath)) {
691  throw new \RuntimeException(
692  'Path to extension ' . $extension . ' not allowed.',
693  1499777261
694  );
695  }
696  if (!is_dir($extensionBasePath)) {
697  throw new \RuntimeException(
698  'Extension path ' . $extensionBasePath . ' does not exist or is no directory.',
699  1499777330
700  );
701  }
702 
703  ‪$finder = new Finder();
704  $files = ‪$finder->files()->in($extensionBasePath)->name('*.php')->sortByName();
705  // A list of file names relative to extension directory
706  $relativeFileNames = [];
707  foreach ($files as $file) {
709  $relativeFileNames[] = GeneralUtility::fixWindowsFilePath($file->getRelativePathname());
710  }
711  return new JsonResponse([
712  'success' => true,
713  'files' => $relativeFileNames,
714  ]);
715  }
716 
726  public function ‪extensionScannerMarkFullyScannedRestFilesAction(ServerRequestInterface $request): ResponseInterface
727  {
728  $foundRestFileHashes = (array)($request->getParsedBody()['install']['hashes'] ?? []);
729  // First un-mark files marked as scanned-ok
730  $registry = new Registry();
731  $registry->removeAllByNamespace('extensionScannerNotAffected');
732  // Find all .rst files (except those from v8), see if they are tagged with "FullyScanned"
733  // and if their content is not in incoming "hashes" array, mark as "not affected"
734  $documentationFile = new DocumentationFile();
735  ‪$finder = new Finder();
736  $restFilesBasePath = ‪ExtensionManagementUtility::extPath('core') . 'Documentation/Changelog';
737  $restFiles = ‪$finder->files()->in($restFilesBasePath);
738  $fullyScannedRestFilesNotAffected = [];
739  foreach ($restFiles as $restFile) {
740  // Skip files in "8.x" directory
742  if (strpos($restFile->getRelativePath(), '8') === 0) {
743  continue;
744  }
745 
746  // Build array of file (hashes) not affected by current scan, if they are tagged as "FullyScanned"
747  $listEntries = $documentationFile->getListEntry(str_replace(
748  '\\',
749  '/',
750  (string)realpath($restFile->getPathname())
751  ));
752  $parsedRestFile = array_pop($listEntries);
753  if (!in_array($parsedRestFile['file_hash'], $foundRestFileHashes, true)
754  && in_array('FullyScanned', $parsedRestFile['tags'], true)
755  ) {
756  $fullyScannedRestFilesNotAffected[] = $parsedRestFile['file_hash'];
757  }
758  }
759  foreach ($fullyScannedRestFilesNotAffected as $fileHash) {
760  $registry->set('extensionScannerNotAffected', $fileHash, $fileHash);
761  }
762  return new JsonResponse([
763  'success' => true,
764  'markedAsNotAffected' => count($fullyScannedRestFilesNotAffected),
765  ]);
766  }
767 
774  public function ‪extensionScannerScanFileAction(ServerRequestInterface $request): ResponseInterface
775  {
776  // Get and validate path and file
777  $extension = $request->getParsedBody()['install']['extension'];
778  $extensionBasePath = $this->packageManager->getPackage($extension)->getPackagePath();
779  if (empty($extension) || !GeneralUtility::isAllowedAbsPath($extensionBasePath)) {
780  throw new \RuntimeException(
781  'Path to extension ' . $extension . ' not allowed.',
782  1499789246
783  );
784  }
785  if (!is_dir($extensionBasePath)) {
786  throw new \RuntimeException(
787  'Extension path ' . $extensionBasePath . ' does not exist or is no directory.',
788  1499789259
789  );
790  }
791  $file = $request->getParsedBody()['install']['file'];
792  $absoluteFilePath = $extensionBasePath . $file;
793  if (empty($file) || !GeneralUtility::isAllowedAbsPath($absoluteFilePath)) {
794  throw new \RuntimeException(
795  'Path to file ' . $file . ' of extension ' . $extension . ' not allowed.',
796  1499789384
797  );
798  }
799  if (!is_file($absoluteFilePath)) {
800  throw new \RuntimeException(
801  'File ' . $file . ' not found or is not a file.',
802  1499789433
803  );
804  }
805 
806  ‪$parser = (new ParserFactory())->create(ParserFactory::ONLY_PHP7);
807  // Parse PHP file to AST and traverse tree calling visitors
808  $statements = ‪$parser->parse(file_get_contents($absoluteFilePath));
809 
810  // The built in NameResolver translates class names shortened with 'use' to fully qualified
811  // class names at all places. Incredibly useful for us and added as first visitor.
812  // IMPORTANT: first process completely to resolve fully qualified names of arguments
813  // (otherwise GeneratorClassesResolver will NOT get reliable results)
814  $traverser = new NodeTraverser();
815  $traverser->addVisitor(new NameResolver());
816  $statements = $traverser->traverse($statements);
817 
818  // IMPORTANT: second process to actually work on the pre-resolved statements
819  $traverser = new NodeTraverser();
820  // Understand GeneralUtility::makeInstance('My\\Package\\Foo\\Bar') as fqdn class name in first argument
821  $traverser->addVisitor(new GeneratorClassesResolver());
822  // Count ignored lines, effective code lines, ...
823  $statistics = new CodeStatistics();
824  $traverser->addVisitor($statistics);
825 
826  // Add all configured matcher classes
827  $matcherFactory = new MatcherFactory();
828  ‪$matchers = $matcherFactory->createAll($this->matchers);
829  foreach (‪$matchers as $matcher) {
830  $traverser->addVisitor($matcher);
831  }
832 
833  $traverser->traverse($statements);
834 
835  // Gather code matches
836  $matches = [[]];
837  foreach (‪$matchers as $matcher) {
839  $matches[] = $matcher->getMatches();
840  }
841  $matches = array_merge(...$matches);
842 
843  // Prepare match output
844  $restFilesBasePath = ‪ExtensionManagementUtility::extPath('core') . 'Documentation/Changelog';
845  $documentationFile = new DocumentationFile();
846  $preparedMatches = [];
847  foreach ($matches as $match) {
848  $preparedHit = [];
849  $preparedHit['uniqueId'] = ‪StringUtility::getUniqueId();
850  $preparedHit['message'] = $match['message'];
851  $preparedHit['line'] = $match['line'];
852  $preparedHit['indicator'] = $match['indicator'];
853  $preparedHit['lineContent'] = $this->‪extensionScannerGetLineFromFile($absoluteFilePath, $match['line']);
854  $preparedHit['restFiles'] = [];
855  foreach ($match['restFiles'] as $fileName) {
856  ‪$finder = new Finder();
857  $restFileLocation = ‪$finder->files()->in($restFilesBasePath)->name($fileName);
858  if ($restFileLocation->count() !== 1) {
859  throw new \RuntimeException(
860  'ResT file ' . $fileName . ' not found or multiple files found.',
861  1499803909
862  );
863  }
864  foreach ($restFileLocation as $restFile) {
866  $restFileLocation = $restFile->getPathname();
867  break;
868  }
869  $listEntries = $documentationFile->getListEntry(str_replace(
870  '\\',
871  '/',
872  (string)realpath($restFileLocation)
873  ));
874  $parsedRestFile = array_pop($listEntries);
875  $version = ‪GeneralUtility::trimExplode(DIRECTORY_SEPARATOR, $restFileLocation);
876  array_pop($version);
877  // something like "8.2" .. "8.7" .. "master"
878  $parsedRestFile['version'] = array_pop($version);
879  $parsedRestFile['uniqueId'] = ‪StringUtility::getUniqueId();
880  $preparedHit['restFiles'][] = $parsedRestFile;
881  }
882  $preparedMatches[] = $preparedHit;
883  }
884  return new JsonResponse([
885  'success' => true,
886  'matches' => $preparedMatches,
887  'isFileIgnored' => $statistics->isFileIgnored(),
888  'effectiveCodeLines' => $statistics->getNumberOfEffectiveCodeLines(),
889  'ignoredLines' => $statistics->getNumberOfIgnoredLines(),
890  ]);
891  }
892 
899  public function ‪tcaExtTablesCheckAction(ServerRequestInterface $request): ResponseInterface
900  {
901  $view = $this->‪initializeStandaloneView($request, 'Upgrade/TcaExtTablesCheck.html');
902  $messageQueue = new FlashMessageQueue('install');
903  $loadTcaService = GeneralUtility::makeInstance(LoadTcaService::class);
904  $loadTcaService->loadExtensionTablesWithoutMigration();
905  $baseTca = ‪$GLOBALS['TCA'];
906  $container = $this->lateBootService->getContainer();
907  $backup = $this->lateBootService->makeCurrent($container);
908  foreach ($this->packageManager->getActivePackages() as $package) {
910 
911  $extensionKey = $package->getPackageKey();
912  $extTablesPath = $package->getPackagePath() . 'ext_tables.php';
913  if (@file_exists($extTablesPath)) {
914  $loadTcaService->loadSingleExtTablesFile($extensionKey);
915  $newTca = ‪$GLOBALS['TCA'];
916  if ($newTca !== $baseTca) {
917  $messageQueue->enqueue(new FlashMessage(
918  '',
919  $extensionKey,
921  ));
922  }
923  $baseTca = $newTca;
924  }
925  }
926  $this->lateBootService->makeCurrent(null, $backup);
927  return new JsonResponse([
928  'success' => true,
929  'status' => $messageQueue,
930  'html' => $view->render(),
931  'buttons' => [
932  [
933  'btnClass' => 'btn-default t3js-tcaExtTablesCheck-check',
934  'text' => 'Check loaded extensions',
935  ],
936  ],
937  ]);
938  }
939 
946  public function ‪tcaMigrationsCheckAction(ServerRequestInterface $request): ResponseInterface
947  {
948  $view = $this->‪initializeStandaloneView($request, 'Upgrade/TcaMigrationsCheck.html');
949  $messageQueue = new FlashMessageQueue('install');
950  GeneralUtility::makeInstance(LoadTcaService::class)->loadExtensionTablesWithoutMigration();
951  $tcaMigration = GeneralUtility::makeInstance(TcaMigration::class);
952  ‪$GLOBALS['TCA'] = $tcaMigration->migrate(‪$GLOBALS['TCA']);
953  $tcaMessages = $tcaMigration->getMessages();
954  foreach ($tcaMessages as $tcaMessage) {
955  $messageQueue->enqueue(new FlashMessage(
956  '',
957  $tcaMessage,
959  ));
960  }
961  return new JsonResponse([
962  'success' => true,
963  'status' => $messageQueue,
964  'html' => $view->render(),
965  'buttons' => [
966  [
967  'btnClass' => 'btn-default t3js-tcaMigrationsCheck-check',
968  'text' => 'Check TCA Migrations',
969  ],
970  ],
971  ]);
972  }
973 
980  public function ‪upgradeDocsGetContentAction(ServerRequestInterface $request): ResponseInterface
981  {
982  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
983  $documentationDirectories = $this->‪getDocumentationDirectories();
984  $view = $this->‪initializeStandaloneView($request, 'Upgrade/UpgradeDocsGetContent.html');
985  $view->assignMultiple([
986  'upgradeDocsMarkReadToken' => $formProtection->generateToken('installTool', 'upgradeDocsMarkRead'),
987  'upgradeDocsUnmarkReadToken' => $formProtection->generateToken('installTool', 'upgradeDocsUnmarkRead'),
988  'upgradeDocsVersions' => $documentationDirectories,
989  ]);
990  return new JsonResponse([
991  'success' => true,
992  'html' => $view->render(),
993  ]);
994  }
995 
1002  public function ‪upgradeDocsGetChangelogForVersionAction(ServerRequestInterface $request): ResponseInterface
1003  {
1004  $version = $request->getQueryParams()['install']['version'] ?? '';
1005  $this->‪assertValidVersion($version);
1006 
1007  $documentationFiles = $this->‪getDocumentationFiles($version);
1008  $view = $this->‪initializeStandaloneView($request, 'Upgrade/UpgradeDocsGetChangelogForVersion.html');
1009  $view->assignMultiple([
1010  'upgradeDocsFiles' => $documentationFiles['normalFiles'],
1011  'upgradeDocsReadFiles' => $documentationFiles['readFiles'],
1012  'upgradeDocsNotAffectedFiles' => $documentationFiles['notAffectedFiles'],
1013  ]);
1014  return new JsonResponse([
1015  'success' => true,
1016  'html' => $view->render(),
1017  ]);
1018  }
1019 
1026  public function ‪upgradeDocsMarkReadAction(ServerRequestInterface $request): ResponseInterface
1027  {
1028  $registry = new Registry();
1029  $filePath = $request->getParsedBody()['install']['ignoreFile'];
1030  $fileHash = md5_file($filePath);
1031  $registry->set('upgradeAnalysisIgnoredFiles', $fileHash, $filePath);
1032  return new JsonResponse([
1033  'success' => true,
1034  ]);
1035  }
1036 
1043  public function ‪upgradeDocsUnmarkReadAction(ServerRequestInterface $request): ResponseInterface
1044  {
1045  $registry = new Registry();
1046  $filePath = $request->getParsedBody()['install']['ignoreFile'];
1047  $fileHash = md5_file($filePath);
1048  $registry->remove('upgradeAnalysisIgnoredFiles', $fileHash);
1049  return new JsonResponse([
1050  'success' => true,
1051  ]);
1052  }
1059  public function ‪upgradeWizardsBlockingDatabaseAddsAction(): ResponseInterface
1060  {
1061  // ext_localconf, db and ext_tables must be loaded for the updates :(
1062  $this->lateBootService->loadExtLocalconfDatabaseAndExtTables(false);
1063  $adds = [];
1064  $needsUpdate = false;
1065  try {
1066  $adds = $this->upgradeWizardsService->getBlockingDatabaseAdds();
1067  $this->lateBootService->resetGlobalContainer();
1068  if (!empty($adds)) {
1069  $needsUpdate = true;
1070  }
1071  } catch (‪StatementException $exception) {
1072  $needsUpdate = true;
1073  }
1074  return new ‪JsonResponse([
1075  'success' => true,
1076  'needsUpdate' => $needsUpdate,
1077  'adds' => $adds,
1078  ]);
1079  }
1086  public function ‪upgradeWizardsBlockingDatabaseExecuteAction(): ResponseInterface
1087  {
1088  // ext_localconf, db and ext_tables must be loaded for the updates :(
1089  $this->lateBootService->loadExtLocalconfDatabaseAndExtTables(false);
1090  ‪$errors = $this->upgradeWizardsService->addMissingTablesAndFields();
1091  $this->lateBootService->resetGlobalContainer();
1092  $messages = new ‪FlashMessageQueue('install');
1093  // Discard empty values which indicate success
1094  ‪$errors = array_filter(‪$errors);
1095  $success = count(‪$errors) === 0;
1096  if ($success) {
1097  $messages->enqueue(new ‪FlashMessage(
1098  '',
1099  'Added missing database fields and tables'
1100  ));
1101  } else {
1102  foreach (‪$errors as $query => $error) {
1103  $messages->enqueue(new ‪FlashMessage(
1104  'Error: ' . $error,
1105  'Failed to execute: ' . $query,
1107  ));
1108  }
1109  }
1110  return new ‪JsonResponse([
1111  'success' => $success,
1112  'status' => $messages,
1113  ]);
1114  }
1121  public function ‪upgradeWizardsBlockingDatabaseCharsetFixAction(): ResponseInterface
1122  {
1123  $this->upgradeWizardsService->setDatabaseCharsetUtf8();
1124  $messages = new ‪FlashMessageQueue('install');
1125  $messages->enqueue(new ‪FlashMessage(
1126  '',
1127  'Default connection database has been set to utf8'
1128  ));
1129  return new ‪JsonResponse([
1130  'success' => true,
1131  'status' => $messages,
1132  ]);
1133  }
1140  public function ‪upgradeWizardsBlockingDatabaseCharsetTestAction(): ResponseInterface
1141  {
1142  $result = !$this->upgradeWizardsService->isDatabaseCharsetUtf8();
1143  return new ‪JsonResponse([
1144  'success' => true,
1145  'needsUpdate' => $result,
1146  ]);
1147  }
1154  public function ‪upgradeWizardsDoneUpgradesAction(): ResponseInterface
1155  {
1156  $this->lateBootService->loadExtLocalconfDatabaseAndExtTables(false);
1157  $wizardsDone = $this->upgradeWizardsService->listOfWizardsDone();
1158  $rowUpdatersDone = $this->upgradeWizardsService->listOfRowUpdatersDone();
1159  $this->lateBootService->resetGlobalContainer();
1160  $messages = new ‪FlashMessageQueue('install');
1161  if (empty($wizardsDone) && empty($rowUpdatersDone)) {
1162  $messages->enqueue(new ‪FlashMessage(
1163  '',
1164  'No wizards are marked as done'
1165  ));
1166  }
1167  return new ‪JsonResponse([
1168  'success' => true,
1169  'status' => $messages,
1170  'wizardsDone' => $wizardsDone,
1171  'rowUpdatersDone' => $rowUpdatersDone,
1172  ]);
1173  }
1174 
1181  public function ‪upgradeWizardsExecuteAction(ServerRequestInterface $request): ResponseInterface
1182  {
1183  // ext_localconf, db and ext_tables must be loaded for the updates :(
1184  $this->lateBootService->loadExtLocalconfDatabaseAndExtTables(false);
1185  $identifier = $request->getParsedBody()['install']['identifier'];
1186  $messages = $this->upgradeWizardsService->executeWizard($identifier);
1187  $this->lateBootService->resetGlobalContainer();
1188  return new ‪JsonResponse([
1189  'success' => true,
1190  'status' => $messages,
1191  ]);
1192  }
1193 
1200  public function ‪upgradeWizardsInputAction(ServerRequestInterface $request): ResponseInterface
1201  {
1202  // ext_localconf, db and ext_tables must be loaded for the updates :(
1203  $this->lateBootService->loadExtLocalconfDatabaseAndExtTables(false);
1204  $identifier = $request->getParsedBody()['install']['identifier'];
1205  $result = $this->upgradeWizardsService->getWizardUserInput($identifier);
1206  $this->lateBootService->resetGlobalContainer();
1207  return new JsonResponse([
1208  'success' => true,
1209  'status' => [],
1210  'userInput' => $result,
1211  ]);
1212  }
1219  public function ‪upgradeWizardsListAction(): ResponseInterface
1220  {
1221  // ext_localconf, db and ext_tables must be loaded for the updates :(
1222  $this->lateBootService->loadExtLocalconfDatabaseAndExtTables(false);
1223  $wizards = $this->upgradeWizardsService->getUpgradeWizardsList();
1224  $this->lateBootService->resetGlobalContainer();
1225  return new ‪JsonResponse([
1226  'success' => true,
1227  'status' => [],
1228  'wizards' => $wizards,
1229  ]);
1230  }
1231 
1238  public function ‪upgradeWizardsMarkUndoneAction(ServerRequestInterface $request): ResponseInterface
1239  {
1240  $this->lateBootService->loadExtLocalconfDatabaseAndExtTables(false);
1241  $wizardToBeMarkedAsUndoneIdentifier = $request->getParsedBody()['install']['identifier'];
1242  $wizardToBeMarkedAsUndone = $this->upgradeWizardsService->getWizardInformationByIdentifier($wizardToBeMarkedAsUndoneIdentifier);
1243  $result = $this->upgradeWizardsService->markWizardUndone($wizardToBeMarkedAsUndoneIdentifier);
1244  $this->lateBootService->resetGlobalContainer();
1245  $messages = new ‪FlashMessageQueue('install');
1246  if ($result) {
1247  $messages->enqueue(new ‪FlashMessage(
1248  'The wizard "' . $wizardToBeMarkedAsUndone['title'] . '" has been marked as undone.',
1249  'Wizard marked as undone'
1250  ));
1251  } else {
1252  $messages->enqueue(new FlashMessage(
1253  'The wizard "' . $wizardToBeMarkedAsUndone['title'] . '" has not been marked as undone.',
1254  'Wizard has not been marked undone',
1256  ));
1257  }
1258  return new JsonResponse([
1259  'success' => true,
1260  'status' => $messages,
1261  ]);
1262  }
1263 
1270  public function ‪upgradeWizardsGetDataAction(ServerRequestInterface $request): ResponseInterface
1271  {
1272  $view = $this->‪initializeStandaloneView($request, 'Upgrade/UpgradeWizards.html');
1273  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
1274  $view->assignMultiple([
1275  'upgradeWizardsMarkUndoneToken' => $formProtection->generateToken('installTool', 'upgradeWizardsMarkUndone'),
1276  'upgradeWizardsInputToken' => $formProtection->generateToken('installTool', 'upgradeWizardsInput'),
1277  'upgradeWizardsExecuteToken' => $formProtection->generateToken('installTool', 'upgradeWizardsExecute'),
1278  ]);
1279  return new JsonResponse([
1280  'success' => true,
1281  'html' => $view->render(),
1282  ]);
1283  }
1290  protected function ‪coreUpdateInitialize()
1291  {
1292  $this->coreUpdateService = GeneralUtility::makeInstance(CoreUpdateService::class);
1293  $this->coreVersionService = GeneralUtility::makeInstance(CoreVersionService::class);
1294  if (!$this->coreUpdateService->isCoreUpdateEnabled()) {
1295  throw new \RuntimeException(
1296  'Core Update disabled in this environment',
1297  1381609294
1298  );
1299  }
1300  // @todo: Does the core updater really depend on loaded ext_* files?
1301  $this->lateBootService->loadExtLocalconfDatabaseAndExtTables();
1302  }
1303 
1312  protected function ‪coreUpdateGetVersionToHandle(ServerRequestInterface $request): ‪CoreRelease
1313  {
1314  $type = $request->getQueryParams()['install']['type'];
1315  if (!isset($type) || empty($type)) {
1316  throw new \RuntimeException(
1317  'Type must be set to either "regular" or "development"',
1318  1380975303
1319  );
1320  }
1321  return $this->coreVersionService->getYoungestCommunityPatchRelease();
1322  }
1323 
1330  protected function ‪extensionCompatTesterLoadExtLocalconfForExtension(PackageInterface $package)
1331  {
1332  $extLocalconfPath = $package->getPackagePath() . 'ext_localconf.php';
1333  if (@file_exists($extLocalconfPath)) {
1334  require $extLocalconfPath;
1335  }
1336  }
1337 
1344  protected function ‪extensionCompatTesterLoadExtTablesForExtension(PackageInterface $package)
1345  {
1346  $extTablesPath = $package->getPackagePath() . 'ext_tables.php';
1347  if (@file_exists($extTablesPath)) {
1348  require $extTablesPath;
1349  }
1350  }
1351 
1355  protected function ‪getDocumentationDirectories(): array
1356  {
1357  $documentationFileService = new DocumentationFile();
1358  $documentationDirectories = $documentationFileService->findDocumentationDirectories(
1359  str_replace('\\', '/', (string)realpath(‪ExtensionManagementUtility::extPath('core') . 'Documentation/Changelog'))
1360  );
1361  return array_reverse($documentationDirectories);
1362  }
1363 
1370  protected function ‪getDocumentationFiles(string $version): array
1371  {
1372  $documentationFileService = new DocumentationFile();
1373  $documentationFiles = $documentationFileService->findDocumentationFiles(
1374  str_replace('\\', '/', (string)realpath(‪ExtensionManagementUtility::extPath('core') . 'Documentation/Changelog/' . $version))
1375  );
1376 
1377  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_registry');
1378  $filesMarkedAsRead = $queryBuilder
1379  ->select('*')
1380  ->from('sys_registry')
1381  ->where(
1382  $queryBuilder->expr()->eq(
1383  'entry_namespace',
1384  $queryBuilder->createNamedParameter('upgradeAnalysisIgnoredFiles', ‪Connection::PARAM_STR)
1385  )
1386  )
1387  ->executeQuery()
1388  ->fetchAllAssociative();
1389  $hashesMarkedAsRead = [];
1390  foreach ($filesMarkedAsRead as $file) {
1391  $hashesMarkedAsRead[] = $file['entry_key'];
1392  }
1393 
1394  $fileMarkedAsNotAffected = $queryBuilder
1395  ->select('*')
1396  ->from('sys_registry')
1397  ->where(
1398  $queryBuilder->expr()->eq(
1399  'entry_namespace',
1400  $queryBuilder->createNamedParameter('extensionScannerNotAffected', ‪Connection::PARAM_STR)
1401  )
1402  )
1403  ->executeQuery()
1404  ->fetchAllAssociative();
1405  $hashesMarkedAsNotAffected = [];
1406  foreach ($fileMarkedAsNotAffected as $file) {
1407  $hashesMarkedAsNotAffected[] = $file['entry_key'];
1408  }
1409 
1410  $readFiles = [];
1411  $notAffectedFiles = [];
1412  foreach ($documentationFiles as $fileId => $fileData) {
1413  if (in_array($fileData['file_hash'], $hashesMarkedAsRead, true)) {
1414  $readFiles[$fileId] = $fileData;
1415  unset($documentationFiles[$fileId]);
1416  } elseif (in_array($fileData['file_hash'], $hashesMarkedAsNotAffected, true)) {
1417  $notAffectedFiles[$fileId] = $fileData;
1418  unset($documentationFiles[$fileId]);
1419  }
1420  }
1421 
1422  return [
1423  'normalFiles' => $documentationFiles,
1424  'readFiles' => $readFiles,
1425  'notAffectedFiles' => $notAffectedFiles,
1426  ];
1427  }
1428 
1436  protected function ‪extensionScannerGetLineFromFile(string $file, int $lineNumber): string
1437  {
1438  $fileContent = file($file, FILE_IGNORE_NEW_LINES);
1439  $line = '';
1440  if (isset($fileContent[$lineNumber - 1])) {
1441  $line = trim($fileContent[$lineNumber - 1]);
1442  }
1443  return $line;
1444  }
1445 
1452  protected function ‪assertValidVersion(string $version): void
1453  {
1454  if ($version !== 'master' && !preg_match('/^\d+.\d+(?:.(?:\d+|x))?$/', $version)) {
1455  throw new \InvalidArgumentException('Given version "' . $version . '" is invalid', 1537209128);
1456  }
1457  }
1458 }
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static list< string > trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:999
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeWizardsListAction
‪ResponseInterface upgradeWizardsListAction()
Definition: UpgradeController.php:1213
‪TYPO3\CMS\Install\ExtensionScanner\Php\GeneratorClassesResolver
Definition: GeneratorClassesResolver.php:42
‪TYPO3\CMS\Install\Controller\UpgradeController\$upgradeWizardsService
‪UpgradeWizardsService $upgradeWizardsService
Definition: UpgradeController.php:93
‪TYPO3\CMS\Install\Controller\UpgradeController\$coreVersionService
‪CoreVersionService $coreVersionService
Definition: UpgradeController.php:89
‪TYPO3\CMS\Core\Migrations\TcaMigration
Definition: TcaMigration.php:26
‪TYPO3\CMS\Install\Controller\AbstractController\initializeStandaloneView
‪StandaloneView initializeStandaloneView(ServerRequestInterface $request, string $templatePath)
Definition: AbstractController.php:40
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory\get
‪static TYPO3 CMS Core FormProtection AbstractFormProtection get($classNameOrType='default',... $constructorArguments)
Definition: FormProtectionFactory.php:73
‪TYPO3\CMS\Install\ExtensionScanner\Php\CodeStatistics
Definition: CodeStatistics.php:30
‪$finder
‪if(PHP_SAPI !=='cli') $finder
Definition: header-comment.php:22
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\MethodCallStaticMatcher
Definition: MethodCallStaticMatcher.php:38
‪TYPO3\CMS\Install\UpgradeAnalysis\DocumentationFile
Definition: DocumentationFile.php:33
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static string getPublicPath()
Definition: Environment.php:206
‪TYPO3\CMS\Core\Database\Schema\Exception\StatementException
Definition: StatementException.php:24
‪TYPO3\CMS\Install\Controller\UpgradeController\extensionScannerMarkFullyScannedRestFilesAction
‪ResponseInterface extensionScannerMarkFullyScannedRestFilesAction(ServerRequestInterface $request)
Definition: UpgradeController.php:720
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\unloadExtension
‪static unloadExtension($extensionKey)
Definition: ExtensionManagementUtility.php:1861
‪TYPO3\CMS\Install\Controller\UpgradeController\extensionCompatTesterUninstallExtensionAction
‪ResponseInterface extensionCompatTesterUninstallExtensionAction(ServerRequestInterface $request)
Definition: UpgradeController.php:601
‪TYPO3\CMS\Install\Controller\UpgradeController\coreUpdateUnpackAction
‪ResponseInterface coreUpdateUnpackAction(ServerRequestInterface $request)
Definition: UpgradeController.php:477
‪TYPO3\CMS\Install\Controller\UpgradeController
Definition: UpgradeController.php:82
‪TYPO3\CMS\Install\Controller\UpgradeController\$matchers
‪array $matchers
Definition: UpgradeController.php:118
‪TYPO3\CMS\Core\Registry
Definition: Registry.php:33
‪TYPO3\CMS\Core\Package\PackageInterface\getPackagePath
‪string getPackagePath()
‪TYPO3\CMS\Install\Controller\UpgradeController\coreUpdateInitialize
‪coreUpdateInitialize()
Definition: UpgradeController.php:1284
‪TYPO3\CMS\Install\Controller\UpgradeController\extensionCompatTesterLoadedExtensionListAction
‪ResponseInterface extensionCompatTesterLoadedExtensionListAction(ServerRequestInterface $request)
Definition: UpgradeController.php:507
‪TYPO3\CMS\Install\Controller\UpgradeController\coreUpdateGetDataAction
‪ResponseInterface coreUpdateGetDataAction(ServerRequestInterface $request)
Definition: UpgradeController.php:278
‪$parser
‪$parser
Definition: annotationChecker.php:110
‪TYPO3\CMS\Install\Controller\UpgradeController\coreUpdateVerifyChecksumAction
‪ResponseInterface coreUpdateVerifyChecksumAction(ServerRequestInterface $request)
Definition: UpgradeController.php:492
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeWizardsBlockingDatabaseCharsetTestAction
‪ResponseInterface upgradeWizardsBlockingDatabaseCharsetTestAction()
Definition: UpgradeController.php:1134
‪TYPO3\CMS\Install\Controller\UpgradeController\__construct
‪__construct(PackageManager $packageManager, LateBootService $lateBootService, UpgradeWizardsService $upgradeWizardsService)
Definition: UpgradeController.php:103
‪TYPO3\CMS\Install\Controller\UpgradeController\cardsAction
‪ResponseInterface cardsAction(ServerRequestInterface $request)
Definition: UpgradeController.php:207
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeDocsMarkReadAction
‪ResponseInterface upgradeDocsMarkReadAction(ServerRequestInterface $request)
Definition: UpgradeController.php:1020
‪TYPO3\CMS\Install\Controller\UpgradeController\extensionScannerFilesAction
‪ResponseInterface extensionScannerFilesAction(ServerRequestInterface $request)
Definition: UpgradeController.php:679
‪TYPO3\CMS\Install\Controller\UpgradeController\coreUpdateActivateAction
‪ResponseInterface coreUpdateActivateAction(ServerRequestInterface $request)
Definition: UpgradeController.php:233
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeDocsGetContentAction
‪ResponseInterface upgradeDocsGetContentAction(ServerRequestInterface $request)
Definition: UpgradeController.php:974
‪TYPO3\CMS\Core\Database\Connection\PARAM_STR
‪const PARAM_STR
Definition: Connection.php:54
‪TYPO3\CMS\Install\CoreVersion\CoreRelease
Definition: CoreRelease.php:21
‪TYPO3\CMS\Install\Controller\UpgradeController\extensionCompatTesterLoadExtTablesAction
‪ResponseInterface extensionCompatTesterLoadExtTablesAction(ServerRequestInterface $request)
Definition: UpgradeController.php:565
‪TYPO3\CMS\Install\Controller\UpgradeController\extensionScannerGetLineFromFile
‪string extensionScannerGetLineFromFile(string $file, int $lineNumber)
Definition: UpgradeController.php:1430
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeWizardsBlockingDatabaseCharsetFixAction
‪ResponseInterface upgradeWizardsBlockingDatabaseCharsetFixAction()
Definition: UpgradeController.php:1115
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\PropertyExistsStaticMatcher
Definition: PropertyExistsStaticMatcher.php:29
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeDocsGetChangelogForVersionAction
‪ResponseInterface upgradeDocsGetChangelogForVersionAction(ServerRequestInterface $request)
Definition: UpgradeController.php:996
‪TYPO3\CMS\Core\Package\PackageInterface
Definition: PackageInterface.php:22
‪TYPO3\CMS\Core\FormProtection\InstallToolFormProtection
Definition: InstallToolFormProtection.php:61
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\MethodArgumentRequiredMatcher
Definition: MethodArgumentRequiredMatcher.php:30
‪TYPO3\CMS\Install\Service\UpgradeWizardsService
Definition: UpgradeWizardsService.php:44
‪TYPO3\CMS\Install\Controller\UpgradeController\coreUpdateDownloadAction
‪ResponseInterface coreUpdateDownloadAction(ServerRequestInterface $request)
Definition: UpgradeController.php:263
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility
Definition: ExtensionManagementUtility.php:43
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\MethodAnnotationMatcher
Definition: MethodAnnotationMatcher.php:29
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\ConstantMatcher
Definition: ConstantMatcher.php:30
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeWizardsDoneUpgradesAction
‪ResponseInterface upgradeWizardsDoneUpgradesAction()
Definition: UpgradeController.php:1148
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\PropertyAnnotationMatcher
Definition: PropertyAnnotationMatcher.php:30
‪TYPO3\CMS\Install\Controller\UpgradeController\extensionCompatTesterLoadExtTablesForExtension
‪extensionCompatTesterLoadExtTablesForExtension(PackageInterface $package)
Definition: UpgradeController.php:1338
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\ClassNameMatcher
Definition: ClassNameMatcher.php:28
‪TYPO3\CMS\Core\Messaging\AbstractMessage\WARNING
‪const WARNING
Definition: AbstractMessage.php:30
‪TYPO3\CMS\Install\Service\CoreUpdateService\isCoreUpdateEnabled
‪bool isCoreUpdateEnabled()
Definition: CoreUpdateService.php:81
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeWizardsMarkUndoneAction
‪ResponseInterface upgradeWizardsMarkUndoneAction(ServerRequestInterface $request)
Definition: UpgradeController.php:1232
‪TYPO3\CMS\Install\Exception
Definition: Exception.php:23
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeWizardsGetDataAction
‪ResponseInterface upgradeWizardsGetDataAction(ServerRequestInterface $request)
Definition: UpgradeController.php:1264
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\PropertyPublicMatcher
Definition: PropertyPublicMatcher.php:29
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\MethodCallMatcher
Definition: MethodCallMatcher.php:30
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeWizardsBlockingDatabaseAddsAction
‪ResponseInterface upgradeWizardsBlockingDatabaseAddsAction()
Definition: UpgradeController.php:1053
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\MethodArgumentDroppedMatcher
Definition: MethodArgumentDroppedMatcher.php:31
‪TYPO3\CMS\Install\Controller
Definition: AbstractController.php:18
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\ArrayGlobalMatcher
Definition: ArrayGlobalMatcher.php:31
‪TYPO3\CMS\Install\Controller\UpgradeController\assertValidVersion
‪assertValidVersion(string $version)
Definition: UpgradeController.php:1446
‪TYPO3\CMS\Install\ExtensionScanner\CodeScannerInterface
Definition: CodeScannerInterface.php:24
‪TYPO3\CMS\Install\Controller\UpgradeController\coreUpdateMoveAction
‪ResponseInterface coreUpdateMoveAction(ServerRequestInterface $request)
Definition: UpgradeController.php:462
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeDocsUnmarkReadAction
‪ResponseInterface upgradeDocsUnmarkReadAction(ServerRequestInterface $request)
Definition: UpgradeController.php:1037
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\MethodArgumentRequiredStaticMatcher
Definition: MethodArgumentRequiredStaticMatcher.php:31
‪TYPO3\CMS\Install\Controller\UpgradeController\coreUpdateIsUpdateAvailableAction
‪ResponseInterface coreUpdateIsUpdateAvailableAction()
Definition: UpgradeController.php:322
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\MethodArgumentDroppedStaticMatcher
Definition: MethodArgumentDroppedStaticMatcher.php:31
‪TYPO3\CMS\Install\Controller\UpgradeController\coreUpdateCheckPreConditionsAction
‪ResponseInterface coreUpdateCheckPreConditionsAction(ServerRequestInterface $request)
Definition: UpgradeController.php:248
‪TYPO3\CMS\Install\Service\LateBootService
Definition: LateBootService.php:27
‪TYPO3\CMS\Core\Service\OpcodeCacheService
Definition: OpcodeCacheService.php:25
‪TYPO3\CMS\Install\Controller\UpgradeController\extensionScannerGetDataAction
‪ResponseInterface extensionScannerGetDataAction(ServerRequestInterface $request)
Definition: UpgradeController.php:642
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\FunctionCallMatcher
Definition: FunctionCallMatcher.php:30
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\ConstructorArgumentMatcher
Definition: ConstructorArgumentMatcher.php:37
‪TYPO3\CMS\Install\ExtensionScanner\Php\MatcherFactory
Definition: MatcherFactory.php:29
‪TYPO3\CMS\Install\Service\LoadTcaService
Definition: LoadTcaService.php:27
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\ClassConstantMatcher
Definition: ClassConstantMatcher.php:31
‪TYPO3\CMS\Install\Controller\UpgradeController\extensionCompatTesterLoadExtLocalconfForExtension
‪extensionCompatTesterLoadExtLocalconfForExtension(PackageInterface $package)
Definition: UpgradeController.php:1324
‪$errors
‪$errors
Definition: annotationChecker.php:123
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:38
‪TYPO3\CMS\Install\Service\CoreUpdateService
Definition: CoreUpdateService.php:40
‪TYPO3\CMS\Core\Core\Environment\isComposerMode
‪static bool isComposerMode()
Definition: Environment.php:152
‪TYPO3\CMS\Core\Messaging\AbstractMessage\INFO
‪const INFO
Definition: AbstractMessage.php:28
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static string getUniqueId($prefix='')
Definition: StringUtility.php:128
‪TYPO3\CMS\Core\Messaging\FlashMessage
Definition: FlashMessage.php:26
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory
Definition: FormProtectionFactory.php:48
‪TYPO3\CMS\Install\Controller\UpgradeController\$lateBootService
‪LateBootService $lateBootService
Definition: UpgradeController.php:101
‪TYPO3\CMS\Install\Controller\UpgradeController\getDocumentationFiles
‪array getDocumentationFiles(string $version)
Definition: UpgradeController.php:1364
‪TYPO3\CMS\Core\Http\JsonResponse
Definition: JsonResponse.php:28
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\MethodArgumentUnusedMatcher
Definition: MethodArgumentUnusedMatcher.php:33
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:43
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\ArrayDimensionMatcher
Definition: ArrayDimensionMatcher.php:31
‪TYPO3\CMS\Install\Controller\UpgradeController\tcaMigrationsCheckAction
‪ResponseInterface tcaMigrationsCheckAction(ServerRequestInterface $request)
Definition: UpgradeController.php:940
‪TYPO3\CMS\Install\Controller\AbstractController
Definition: AbstractController.php:31
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\extPath
‪static string extPath($key, $script='')
Definition: ExtensionManagementUtility.php:142
‪TYPO3\CMS\Core\Messaging\AbstractMessage\NOTICE
‪const NOTICE
Definition: AbstractMessage.php:27
‪TYPO3\CMS\Install\Controller\UpgradeController\tcaExtTablesCheckAction
‪ResponseInterface tcaExtTablesCheckAction(ServerRequestInterface $request)
Definition: UpgradeController.php:893
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Install\Controller\UpgradeController\extensionCompatTesterLoadExtLocalconfAction
‪ResponseInterface extensionCompatTesterLoadExtLocalconfAction(ServerRequestInterface $request)
Definition: UpgradeController.php:535
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Install\Controller\UpgradeController\coreUpdateGetVersionToHandle
‪CoreRelease coreUpdateGetVersionToHandle(ServerRequestInterface $request)
Definition: UpgradeController.php:1306
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:22
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeWizardsInputAction
‪ResponseInterface upgradeWizardsInputAction(ServerRequestInterface $request)
Definition: UpgradeController.php:1194
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeWizardsExecuteAction
‪ResponseInterface upgradeWizardsExecuteAction(ServerRequestInterface $request)
Definition: UpgradeController.php:1175
‪TYPO3\CMS\Core\Messaging\FlashMessageQueue
Definition: FlashMessageQueue.php:29
‪TYPO3\CMS\Install\Service\ClearCacheService
Definition: ClearCacheService.php:29
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded
‪static bool isLoaded($key)
Definition: ExtensionManagementUtility.php:114
‪TYPO3\CMS\Install\Controller\UpgradeController\$packageManager
‪PackageManager $packageManager
Definition: UpgradeController.php:97
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\InterfaceMethodChangedMatcher
Definition: InterfaceMethodChangedMatcher.php:35
‪TYPO3\CMS\Install\Controller\UpgradeController\$coreUpdateService
‪CoreUpdateService $coreUpdateService
Definition: UpgradeController.php:85
‪TYPO3\CMS\Install\Controller\UpgradeController\upgradeWizardsBlockingDatabaseExecuteAction
‪ResponseInterface upgradeWizardsBlockingDatabaseExecuteAction()
Definition: UpgradeController.php:1080
‪TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR
‪const ERROR
Definition: AbstractMessage.php:31
‪TYPO3\CMS\Install\ExtensionScanner\Php\Matcher\PropertyProtectedMatcher
Definition: PropertyProtectedMatcher.php:30
‪TYPO3\CMS\Install\Controller\UpgradeController\extensionScannerScanFileAction
‪ResponseInterface extensionScannerScanFileAction(ServerRequestInterface $request)
Definition: UpgradeController.php:768
‪TYPO3\CMS\Install\Controller\UpgradeController\getDocumentationDirectories
‪string[] getDocumentationDirectories()
Definition: UpgradeController.php:1349