1
0
Fork 0

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
Nils Adermann 2011-05-22 23:54:48 +02:00
parent 273e12e386
commit 4dad9fa6ef
1 changed files with 8 additions and 8 deletions

View File

@ -25,24 +25,24 @@ class Request
$this->pool = $pool; $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( $this->jobs[] = array(
'packages' => $packages, 'packages' => $packages,