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

[FEATURE] Add task to list installed extensions #291

Merged
merged 3 commits into from
Oct 17, 2016
Merged
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
27 changes: 27 additions & 0 deletions Classes/Command/ExtensionCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,33 @@ public function dumpAutoloadCommand()
}
}

/**
* List active extensions
*
* @param bool $raw True for a comma separated list of extension keys
* @return void
*/
public function listActiveCommand($raw = false)
{
$extensionInformation = [];
foreach ($this->packageManager->getActivePackages() as $package) {
$metaData = $package->getPackageMetaData();
$extensionInformation[] = [
'package_key' => $package->getPackageKey(),
'version' => $metaData->getVersion(),
'description' => $metaData->getDescription(),
];
}
if ($raw) {
$this->outputLine('%s', [implode(',', array_column($extensionInformation, 'package_key'))]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it easier for later processing on command line if these are separated by line feed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For us it doesn't matter. We can process both of them. Your decision.

} else {
$this->output->outputTable(
$extensionInformation,
['Package key', 'Version', 'Description']
);
}
}

/**
* Emits packages may have changed signal
*/
Expand Down