Skip to content
Snippets Groups Projects
Commit 473c7e39 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[!!!][TASK] No longer consider extensions not installed by Composer

Installations in composer mode should always
rely on the corresponding mechanisms for
installing extensions.

As consequence, all extensions, manually placed
in `typo3conf/ext`, are no longer evaluated.

Resolves: #96304
Related: #94996
Releases: main
Change-Id: Ic25a7d69c564771cabbb5c240b010161f4b0aca6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72592


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarHelmut Hummel <typo3@helhum.io>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarHelmut Hummel <typo3@helhum.io>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
parent fd2eed45
Branches
Tags
No related merge requests found
......@@ -45,10 +45,6 @@ parameters:
message: "#^Call to static method isPlatformPackage\\(\\) on an unknown class Composer\\\\Repository\\\\PlatformRepository\\.$#"
count: 1
path: typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php
-
message: "#^Instantiated class Composer\\\\Package\\\\Package not found\\.$#"
count: 1
path: typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php
-
message: "#^Instantiated class Composer\\\\Util\\\\Filesystem not found\\.$#"
count: 4
......
......@@ -21,7 +21,6 @@ use Composer\Package\PackageInterface;
use Composer\Repository\PlatformRepository;
use Composer\Script\Event;
use Composer\Util\Filesystem;
use Symfony\Component\Finder\Finder;
use TYPO3\CMS\Composer\Plugin\Config;
use TYPO3\CMS\Composer\Plugin\Core\InstallerScript;
use TYPO3\CMS\Composer\Plugin\Util\ExtensionKeyResolver;
......@@ -214,7 +213,6 @@ class PackageArtifactBuilder extends PackageManager implements InstallerScript
)
);
$installedTypo3Packages = $this->amendWithLocallyAvailableExtensions($installedTypo3Packages);
$this->publishResources($installedTypo3Packages);
return $installedTypo3Packages;
......@@ -282,68 +280,4 @@ class PackageArtifactBuilder extends PackageManager implements InstallerScript
}
}
}
/**
* Add extensions, that are located in typo3conf/ext, but are not installed by Composer
* to the list of known packages. This is now deprecated and will be removed with TYPO3 12.
* From then on all Extension for Composer enabled TYPO3 projects must be installed with Composer.
*
* @deprecated Will be removed with TYPO3 12
* @param array $installedTypo3Packages
* @return array
*/
private function amendWithLocallyAvailableExtensions(array $installedTypo3Packages): array
{
$installedExtensionKeys = array_map(
static function (array $packageAndPathAndKey) {
[, , $extensionKey] = $packageAndPathAndKey;
return $extensionKey;
},
$installedTypo3Packages
);
foreach ($this->scanForRootExtensions($installedExtensionKeys) as [$composerPackage, $path, $extensionKey]) {
$this->event->getIO()->warning(sprintf('Extension "%s" not installed with Composer. This is deprecated and will not work any more with TYPO3 12.', $extensionKey));
$installedTypo3Packages[] = [$composerPackage, $path, $extensionKey];
}
return $installedTypo3Packages;
}
/**
* Scans typo3conf/ext folder for extensions
*
* @param array $installedExtensionKeys
* @return array
*/
private function scanForRootExtensions(array $installedExtensionKeys): array
{
$thirdPartyExtensionDir = $this->config->get('root-dir') . self::LEGACY_EXTENSION_INSTALL_PATH;
if (!is_dir($thirdPartyExtensionDir) || !$this->hasSubDirectories($thirdPartyExtensionDir)) {
return [];
}
$rootExtensionPackages = [];
$finder = new Finder();
$finder
->name('composer.json')
->followLinks()
->depth(0)
->ignoreUnreadableDirs()
->in($thirdPartyExtensionDir . '/*/');
foreach ($finder as $splFileInfo) {
$foundExtensionKey = basename($splFileInfo->getPath());
if (in_array($foundExtensionKey, $installedExtensionKeys, true)) {
// Found the extension to be installed with Composer, so no need to register it again
continue;
}
$composerJson = json_decode($splFileInfo->getContents(), true);
$extPackage = new \Composer\Package\Package($composerJson['name'], '1.0.0', '1.0.0.0');
$extPackage->setExtra($composerJson['extra'] ?? []);
$extPackage->setType($composerJson['type'] ?? 'typo3-cms-extension');
$rootExtensionPackages[] = [$extPackage, $splFileInfo->getPath(), $foundExtensionKey];
}
return $rootExtensionPackages;
}
}
......@@ -371,6 +371,7 @@ The following fallbacks have been removed:
- Usage of the :html:`t3js-toggle-new-content-element-wizard` class to trigger the new content element wizard
- Usage of the :php:`DataHandler->inlineLocalizeSynchronize()` functionality without an array as input argument
- The :php:`route` parameter is no longer added to backend urls
- Extensions, which are located in `typo3conf/ext`, but not installed by Composer, are no longer evaluated for installations in "composer mode"
- Extbase no longer accepts :php:`MyVendor.` prefixed :php:`MyExtensionName` as first argument in
:php:`\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin()`, :php:`\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin()`
and :php:`\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule()` and controller class names must be registered
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment