mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-07-05 16:29:03 +02:00
Merge pull request #1872 from RaspAP/fix/plugin-installers-packages
Fix installDependencies() to correctly handle packageList array
This commit is contained in:
commit
f4adbc1725
@ -269,10 +269,16 @@ class PluginInstaller
|
|||||||
*/
|
*/
|
||||||
private function installDependencies(array $dependencies): void
|
private function installDependencies(array $dependencies): void
|
||||||
{
|
{
|
||||||
$packages = array_keys($dependencies);
|
if (empty($dependencies)) {
|
||||||
$packageList = implode(' ', $packages);
|
return; // nothing to do
|
||||||
|
}
|
||||||
|
|
||||||
$cmd = sprintf('sudo %s packages %s', escapeshellarg($this->helperScriptPath), escapeshellarg($packageList));
|
$packageList = implode(' ', array_map('escapeshellarg', array_keys($dependencies)));
|
||||||
|
$cmd = sprintf(
|
||||||
|
'sudo %s packages %s',
|
||||||
|
escapeshellarg($this->helperScriptPath),
|
||||||
|
$packageList
|
||||||
|
);
|
||||||
$return = shell_exec($cmd);
|
$return = shell_exec($cmd);
|
||||||
if (strpos(strtolower($return), 'ok') === false) {
|
if (strpos(strtolower($return), 'ok') === false) {
|
||||||
throw new \Exception('Plugin helper failed to install depedencies.');
|
throw new \Exception('Plugin helper failed to install depedencies.');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user