-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
draft support for Pickle in Composer #3897
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
Changes from all commits
daeaebf
1a8ee01
8e850ee
b353c3f
14b47e0
f85d7be
8929c3a
5bd5e0a
567b07d
0bac263
4aacd4e
b708265
7f85097
6206a2c
df287ee
a278fc0
1066f27
291ea96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,7 @@ class Installer | |
protected $dumpAutoloader = true; | ||
protected $runScripts = true; | ||
protected $ignorePlatformReqs = false; | ||
protected $installExtensions = false; | ||
protected $preferStable = false; | ||
protected $preferLowest = false; | ||
/** | ||
|
@@ -488,7 +489,7 @@ protected function doInstall($localRepo, $installedRepo, $platformRepo, $aliases | |
$links = $this->package->getRequires(); | ||
} | ||
|
||
foreach ($links as $link) { | ||
foreach ($links as $link) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you should remove these trailing whitespaces |
||
$request->install($link->getTarget(), $link->getConstraint()); | ||
} | ||
} | ||
|
@@ -499,6 +500,7 @@ protected function doInstall($localRepo, $installedRepo, $platformRepo, $aliases | |
// solve dependencies | ||
$this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::PRE_DEPENDENCIES_SOLVING, $this->devMode, $policy, $pool, $installedRepo, $request); | ||
$solver = new Solver($policy, $pool, $installedRepo); | ||
|
||
try { | ||
$operations = $solver->solve($request, $this->ignorePlatformReqs); | ||
$this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::POST_DEPENDENCIES_SOLVING, $this->devMode, $policy, $pool, $installedRepo, $request, $operations); | ||
|
@@ -523,6 +525,10 @@ protected function doInstall($localRepo, $installedRepo, $platformRepo, $aliases | |
foreach ($operations as $operation) { | ||
// collect suggestions | ||
if ('install' === $operation->getJobType()) { | ||
if (!$this->installExtensions && $operation->getPackage()->getType() == 'extension') { | ||
$this->io->writeError('<warning>This package has extensions dependencies, run composer install --install-extensons</warning>'); | ||
continue; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should maybe support 'update' operations too There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If an extension is loaded it cannot be updated. That's the tricky part. It
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah right, this kinda sucks though
|
||
foreach ($operation->getPackage()->getSuggests() as $target => $reason) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nadernan this is actually where it skips extension. I suppose the part in the other file is not required anymore, right? Can test again tomorrow but advice's welcome There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So no, it is still required. |
||
$this->suggestedPackages[] = array( | ||
'source' => $operation->getPackage()->getPrettyName(), | ||
|
@@ -1253,6 +1259,19 @@ public function setIgnorePlatformRequirements($ignorePlatformReqs = false) | |
return $this; | ||
} | ||
|
||
/** | ||
* set install Extensions flag | ||
* | ||
* @param boolean $installExtensions | ||
* @return Installer | ||
*/ | ||
public function setInstallExtensions($installExtensions = false) | ||
{ | ||
$this->installExtensions = (boolean) $installExtensions; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* restrict the update operation to a few packages, all other packages | ||
* that are already installed will be kept at their current version | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong indentation (in all lines changed in this file btw)