Classes/Console/Command/ExtensionCommandController.php
public function activateCommand(array $extensionKeys)
    {
        // @deprecated for composer usage in 5.0 will be removed with 6.0
        $verbose = $this->output->getSymfonyConsoleOutput()->isVerbose();
        $this->showDeprecationMessageIfApplicable();
        $this->emitPackagesMayHaveChangedSignal();
        $activatedExtensions = [];
        $extensionsToSetUp = [];
        foreach ($extensionKeys as $extensionKey) {
            $extensionsToSetUp[] = $this->packageManager->getPackage($extensionKey);
            if (!$this->packageManager->isPackageActive($extensionKey)) {
                $this->packageManager->activatePackage($extensionKey);
                $activatedExtensions[] = $extensionKey;
            }
        }

        if (!empty($activatedExtensions)) {
            $this->cacheService->flush();
            $this->getExtensionInstaller()->reloadCaches();

            $extensionKeysAsString = implode('", "', $activatedExtensions);
            if (count($activatedExtensions) === 1) {
                $this->outputLine('<info>Extension "%s" is now active.</info>', [$extensionKeysAsString]);
            } else {
                $this->outputLine('<info>Extensions "%s" are now active.</info>', [$extensionKeysAsString]);
            }
        }

        if (!empty($extensionsToSetUp)) {
            $this->setupExtensions($extensionsToSetUp, $verbose);
        }
    }
public function activateCommand(array $extensionKeys)
    {
        // @deprecated for composer usage in 5.0 will be removed with 6.0
        $verbose = $this->output->getSymfonyConsoleOutput()->isVerbose();
        $this->showDeprecationMessageIfApplicable();
        $this->emitPackagesMayHaveChangedSignal();
        $activatedExtensions = [];
        $extensionsToSetUp = [];
        foreach ($extensionKeys as $extensionKey) {
            $extensionsToSetUp[] = $this->packageManager->getPackage($extensionKey);
            if (!$this->packageManager->isPackageActive($extensionKey)) {
                $this->packageManager->activatePackage($extensionKey);
                $activatedExtensions[] = $extensionKey;
            }
        }

        if (!empty($activatedExtensions)) {
            $this->cacheService->flush();
            $this->getExtensionInstaller()->reloadCaches();

            $extensionKeysAsString = implode('", "', $activatedExtensions);
            if (count($activatedExtensions) === 1) {
                $this->outputLine('<info>Extension "%s" is now active.</info>', [$extensionKeysAsString]);
            } else {
                $this->outputLine('<info>Extensions "%s" are now active.</info>', [$extensionKeysAsString]);
            }
        }

        if (!empty($extensionsToSetUp)) {
            $this->setupExtensions($extensionsToSetUp, $verbose);
        }
    }
Activate extension(s)

Activates one or more extensions by key.
Marks extensions as active, sets them up and clears caches for every activated extension.

This command is deprecated (and hidden) in Composer mode.

@param array $extensionKeys Extension keys to activate. Separate multiple extension keys with comma.
@throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException