Adding support for LinkConstraints to the solver requests.
Constraints are directly passed on to the pool's whatProvides method which returns a set of packages that satisfy name and constraint conditions.pull/1/head
parent
273e12e386
commit
4dad9fa6ef
|
@ -25,24 +25,24 @@ class Request
|
|||
$this->pool = $pool;
|
||||
}
|
||||
|
||||
public function install($packageName)
|
||||
public function install($packageName, LinkConstraintInterface $constraint = null)
|
||||
{
|
||||
$this->addJob($packageName, 'install');
|
||||
$this->addJob($packageName, $constraint, 'install');
|
||||
}
|
||||
|
||||
public function update($packageName)
|
||||
public function update($packageName, LinkConstraintInterface $constraint = null)
|
||||
{
|
||||
$this->addJob($packageName, 'update');
|
||||
$this->addJob($packageName, $constraint, 'update');
|
||||
}
|
||||
|
||||
public function remove($packageName)
|
||||
public function remove($packageName, LinkConstraintInterface $constraint = null)
|
||||
{
|
||||
$this->addJob($packageName, 'remove');
|
||||
$this->addJob($packageName, $constraint, 'remove');
|
||||
}
|
||||
|
||||
protected function addJob($packageName, $cmd)
|
||||
protected function addJob($packageName, LinkConstraintInterface $constraint, $cmd)
|
||||
{
|
||||
$packages = $this->pool->whatProvides($packageName);
|
||||
$packages = $this->pool->whatProvides($packageName, $constraint);
|
||||
|
||||
$this->jobs[] = array(
|
||||
'packages' => $packages,
|
||||
|
|
Loading…
Reference in New Issue