Handle error when trying to remove a package that other packages depend on.

This commit is contained in:
Flavio Copes
2016-03-17 15:57:10 +01:00
parent a88bd75c02
commit 2c00618b87
4 changed files with 42 additions and 0 deletions

View File

@@ -522,6 +522,23 @@ class Admin
return $dependencies;
}
/**
* Get list of packages that depend on the passed package slug
*
* @param string $slug The package slug
*
* @return array|bool
*/
public function getPackagesThatDependOnPackage($slug)
{
$gpm = $this->gpm();
if (!$gpm) {
return false;
}
return $gpm->getPackagesThatDependOnPackage($slug);
}
/**
* Check the passed packages list can be updated
*