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

Optimized symlink to package matching #4

Merged
merged 2 commits into from
Nov 27, 2017

Conversation

InfopactMLoos
Copy link
Contributor

Instead of looping through all packages to see if they have a matching symlink defined in extra I switched it around and search a package for each defined symlink. This improves the speed, especially when having a big dependency list. Your defined symlinks are likely less in numbers then your defined packages ;)

Copy link
Owner

@ajgarlag ajgarlag left a comment

Choose a reason for hiding this comment

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

Good catch! Rename the $symlink variable to $symlinkDefinitions and I will merge it ASAP

@@ -26,12 +26,12 @@ public static function createSymlinks(Event $event)
$symlinks = static::getSymlinks($event);
$fs = new Filesystem();

foreach ($event->getComposer()->getRepositoryManager()->getLocalRepository()->getPackages() as $package) {
if (isset($symlinks[$package->getName()])) {
foreach ($symlinks as $packageName => $symlink) {
Copy link
Owner

Choose a reason for hiding this comment

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

Please, rename $symlink to $symlinkDefinitions

@InfopactMLoos
Copy link
Contributor Author

Ok I changed the variable name

@ajgarlag ajgarlag merged commit 76379ec into ajgarlag:master Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants