Add getDependenciesNeededToInstall, used by the controller

This commit is contained in:
Flavio Copes
2016-03-07 11:31:18 +01:00
parent fa8b584d63
commit 532093e86d

View File

@@ -487,7 +487,8 @@ class Admin
}
/**
* Generate an array of dependencies for a package
* Generate an array of dependencies for a package, used to generate a list of
* packages that can be removed when removing a package.
*
* @param string $slug The package slug
*
@@ -521,6 +522,26 @@ class Admin
return $dependencies;
}
/**
* Get an array of dependencies needed to be installed or updated for a package
* to be installed.
*
* @param string $slug The package slug
*
* @return array|bool
*/
public function getDependenciesNeededToInstall($slug)
{
$gpm = $this->gpm();
if (!$gpm) {
return false;
}
$dependencies = $this->gpm->getDependencies([$slug]);
return $dependencies;
}
/**
* Get all themes.
*