public function generatePackageStatesCommand(array $frameworkExtensions = [], array $excludedExtensions = [], $activateDefault = false)
    {
        if ($activateDefault && CompatibilityScripts::isComposerMode()) {
            // @deprecated for composer usage in 5.0 will be removed with 6.0
            $this->outputLine('<warning>Using --activate-default is deprecated in composer managed TYPO3 installations.</warning>');
            $this->outputLine('<warning>Instead of requiring typo3/cms in your project, you should consider only requiring individual packages you need.</warning>');
        }
        $frameworkExtensions = $frameworkExtensions ?: explode(',', (string)getenv('TYPO3_ACTIVE_FRAMEWORK_EXTENSIONS'));
        $packageStatesGenerator = new PackageStatesGenerator($this->packageManager);
        $activatedExtensions = $packageStatesGenerator->generate($frameworkExtensions, $excludedExtensions, $activateDefault);

        try {
            // Make sure file caches are empty after generating package states file
            CommandDispatcher::createFromCommandRun()->executeCommand('cache:flush', ['--files-only']);
        } catch (FailedSubProcessCommandException $e) {
            // Ignore errors here.
            // They might be triggered from extensions accessing db or having other things
            // broken in ext_tables or ext_localconf
            // In such case we cannot do much about it other than ignoring it for
            // generating packages states
        }

        $this->outputLine(
            '<info>The following extensions have been added to the generated PackageStates.php file:</info> %s',
            [
                implode(', ', array_map(function (PackageInterface $package) {
                    return $package->getPackageKey();
                }, $activatedExtensions)),
            ]
        );
        if (!empty($excludedExtensions)) {
            $this->outputLine(
                '<info>The following third party extensions were excluded during this process:</info> %s',
                [
                    implode(', ', $excludedExtensions),
                ]
            );
        }
    }
public function generatePackageStatesCommand(array $frameworkExtensions = [], array $excludedExtensions = [], $activateDefault = false)
    {
        if ($activateDefault && CompatibilityScripts::isComposerMode()) {
            // @deprecated for composer usage in 5.0 will be removed with 6.0
            $this->outputLine('<warning>Using --activate-default is deprecated in composer managed TYPO3 installations.</warning>');
            $this->outputLine('<warning>Instead of requiring typo3/cms in your project, you should consider only requiring individual packages you need.</warning>');
        }
        $frameworkExtensions = $frameworkExtensions ?: explode(',', (string)getenv('TYPO3_ACTIVE_FRAMEWORK_EXTENSIONS'));
        $packageStatesGenerator = new PackageStatesGenerator($this->packageManager);
        $activatedExtensions = $packageStatesGenerator->generate($frameworkExtensions, $excludedExtensions, $activateDefault);

        try {
            // Make sure file caches are empty after generating package states file
            CommandDispatcher::createFromCommandRun()->executeCommand('cache:flush', ['--files-only']);
        } catch (FailedSubProcessCommandException $e) {
            // Ignore errors here.
            // They might be triggered from extensions accessing db or having other things
            // broken in ext_tables or ext_localconf
            // In such case we cannot do much about it other than ignoring it for
            // generating packages states
        }

        $this->outputLine(
            '<info>The following extensions have been added to the generated PackageStates.php file:</info> %s',
            [
                implode(', ', array_map(function (PackageInterface $package) {
                    return $package->getPackageKey();
                }, $activatedExtensions)),
            ]
        );
        if (!empty($excludedExtensions)) {
            $this->outputLine(
                '<info>The following third party extensions were excluded during this process:</info> %s',
                [
                    implode(', ', $excludedExtensions),
                ]
            );
        }
    }
public function generatePackageStatesCommand ( array $ frameworkExtensions = [ ] , array $ excludedExtensions = [ ] , $ activateDefault = false ) { if ( $ activateDefault && CompatibilityScripts :: isComposerMode ( ) ) { // @deprecated for composer usage in 5.0 will be removed with 6.0 $ this -> outputLine ( '<warning>Using --activate-default is deprecated in composer managed TYPO3 installations.</warning>' ) ; $ this -> outputLine ( '<warning>Instead of requiring typo3/cms in your project, you should consider only requiring individual packages you need.</warning>' ) ; } $ frameworkExtensions = $ frameworkExtensions ? : explode ( ',' , ( string ) getenv ( 'TYPO3_ACTIVE_FRAMEWORK_EXTENSIONS' ) ) ; $ packageStatesGenerator = new PackageStatesGenerator ( $ this -> packageManager ) ; $ activatedExtensions = $ packageStatesGenerator -> generate ( $ frameworkExtensions , $ excludedExtensions , $ activateDefault ) ; try { // Make sure file caches are empty after generating package states file CommandDispatcher :: createFromCommandRun ( ) -> executeCommand ( 'cache:flush' , [ '--files-only' ] ) ; } catch ( FailedSubProcessCommandException $ e ) { // Ignore errors here. // They might be triggered from extensions accessing db or having other things // broken in ext_tables or ext_localconf // In such case we cannot do much about it other than ignoring it for // generating packages states } $ this -> outputLine ( '<info>The following extensions have been added to the generated PackageStates.php file:</info> %s' , [ implode ( ', ' , array_map ( function ( PackageInterface $ package ) { return $ package -> getPackageKey ( ) ; } , $ activatedExtensions ) ) , ] ) ; if ( ! empty ( $ excludedExtensions ) ) { $ this -> outputLine ( '<info>The following third party extensions were excluded during this process:</info> %s' , [ implode ( ', ' , $ excludedExtensions ) , ] ) ; } }
Generate PackageStates.php file

Generates and writes <code>typo3conf/PackageStates.php</code> file.
Goal is to not have this file in version control, but generate it on <code>composer install</code>.

Marks the following extensions as active:

- Third party extensions
- All core extensions that are required (or part of minimal usable system)
- All core extensions which are provided with the <code>--framework-extensions</code> argument.
- In composer mode all composer dependencies to TYPO3 framework extensions are detected and activated by default.

To require TYPO3 core extensions use the following command:

<code>composer require typo3/cms-foo "*"</code>

This updates your composer.json and composer.lock without any other changes.

<b>Example:</b> <code>%command.full_name%</code>

@param array $frameworkExtensions TYPO3 system extensions that should be marked as active. Extension keys separated by comma.
@param array $excludedExtensions Extensions which should stay inactive. This does not affect provided framework extensions or framework extensions that are required or part as minimal usable system.
@param bool $activateDefault (DEPRECATED) If true, <code>typo3/cms</code> extensions that are marked as TYPO3 factory default, will be activated, even if not in the list of configured active framework extensions.
Generate PackageStates . php file