TYPO3 / CmsComposerInstallers

TYPO3 CMS Composer Installer
GNU General Public License v2.0
58 stars 39 forks source link

Extend plugin to generate PackageStates.php and ActiveExtensions.php #121

Closed ochorocho closed 3 years ago

ochorocho commented 3 years ago

This extends the plugin to collect all typo3 extensions and creates typo3conf/PackageStates.php file. In addition the class ActiveExtensions is created and stored in vendor/composer/ActiveExtensions.php

ActiveExtensions.php contains methods to interact with all TYPO3 packages:

⚠️This does not cover non-composer mode!

⚠️ Requires following PR to be merged https://github.com/composer/composer/pull/9699

see tests/setup-testing.sh for setup details

PackageStatesTest.php, ActiveExtensionsTest.php run only on PHP 7.4 and 8.0 with composer 2

helhum commented 3 years ago

Here is the code that hooks in into the post autoload dump of Composer build:

https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Composer/InstallerScripts.php

and here as an example the implementation of an installer script: https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Composer/CliEntryPoint.php

Such installer script should be added to TYPO3 sources to generate the package states file