Skip to content

Commit

Permalink
Added uninstall method
Browse files Browse the repository at this point in the history
  • Loading branch information
gossi committed Jul 5, 2013
1 parent fce26f2 commit 75ef90f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/keeko/composer/KeekoComposerInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,27 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
}
}


/**
* {@inheritDoc}
*/
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) {
if (!$repo->hasPackage($package)) {
// TODO throw exception again here, when update is fixed and we don't have to remove+install (see #125)
return;
throw new \InvalidArgumentException('Package is not installed: '.$package);
}

$path = $this->getInstallPath($initial);

if (is_link($path)) {
unlink($path);
} else {
parent::uninstall($repo, $package);
}
}


/**
* {@inheritDoc}
*/
Expand Down

0 comments on commit 75ef90f

Please sign in to comment.