mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-07 11:27:09 +02:00
Add getDependenciesNeededToInstall, used by the controller
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user