Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Always exclude extensions when requested #560

Merged
merged 1 commit into from
Sep 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/Command/InstallCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function setupCommand(
*
* @param array $frameworkExtensions TYPO3 system extensions that should be marked as active. Extension keys separated by comma.
* @param bool $activateDefault 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.
* @param array $excludedExtensions Extensions in typo3conf/ext/ directory, which should stay inactive
* @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.
*/
public function generatePackageStatesCommand(array $frameworkExtensions = [], $activateDefault = false, array $excludedExtensions = [])
{
Expand Down
23 changes: 9 additions & 14 deletions Classes/Install/PackageStatesGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,16 @@ public function generate(array $frameworkExtensionsToActivate = [], $activateDef
$this->ensureDirectoryExists(PATH_site . 'typo3conf');
$this->packageManager->scanAvailablePackages();
foreach ($this->packageManager->getAvailablePackages() as $package) {
if (
in_array($package->getPackageKey(), $frameworkExtensionsToActivate, true)
|| $package->isProtected()
|| $package->isPartOfMinimalUsableSystem()
|| ($activateDefaultExtensions && $package->isPartOfFactoryDefault())
// Every extension available in typo3conf/ext is meant to be active
// except it is added to the exclude array. The latter is useful in dev mode or non composer mode
|| (
strpos(PathUtility::stripPathSitePrefix($package->getPackagePath()), 'typo3conf/ext/') !== false
&& !in_array($package->getPackageKey(), $excludedExtensions, true)
)
) {
$this->packageManager->activatePackage($package->getPackageKey());
$extKey = $package->getPackageKey();
$isLocalExt = strpos(PathUtility::stripPathSitePrefix($package->getPackagePath()), 'typo3conf/ext/') !== false;
$isFrameWorkExtToActivate = in_array($extKey, $frameworkExtensionsToActivate, true);
$isExcludedExt = in_array($extKey, $excludedExtensions, true);
$isFactoryDefault = $activateDefaultExtensions && $package->isPartOfFactoryDefault();
$isRequiredFrameworkExt = !$isLocalExt && ($isFrameWorkExtToActivate || $package->isProtected() || $package->isPartOfMinimalUsableSystem());
if (($isRequiredFrameworkExt || $isLocalExt || $isFactoryDefault) && (!$isExcludedExt || $isRequiredFrameworkExt)) {
$this->packageManager->activatePackage($extKey);
} else {
$this->packageManager->deactivatePackage($package->getPackageKey());
$this->packageManager->deactivatePackage($extKey);
}
}
$this->packageManager->forceSortAndSavePackageStates();
Expand Down
2 changes: 1 addition & 1 deletion Documentation/CommandReference/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ Options
``--activate-default``
If true, ``typo3/cms`` extensions that are marked as TYPO3 factory default, will be activated, even if not in the list of configured active framework extensions.
``--excluded-extensions``
Extensions in typo3conf/ext/ directory, which should stay inactive
Extensions which should stay inactive. This does not affect provided framework extensions or framework extensions that are required or part as minimal usable system.



Expand Down