install/upgrade required PEAR packages on install/upgrade of EGroupware package

This commit is contained in:
Ralf Becker 2011-06-30 20:59:57 +00:00
parent 99c18003a4
commit 25b81ce4da

View File

@ -560,14 +560,18 @@ function check_install_pear_packages()
$need_upgrade[] = $package; $need_upgrade[] = $package;
} }
} }
if (($to_install || $need_upgrade) && getmyuid()) if (($to_install || $need_upgrade))
{ {
echo "You need to run as user root to be able to install/upgrade required PEAR packages!\n"; if (getmyuid())
} {
else echo "You need to run as user root to be able to install/upgrade required PEAR packages!\n";
{ }
if ($to_install) system($config['pear'].' install '.implode(' ',$to_install)); else
if ($need_upgrade) system($config['pear'].' upgrade '.implode(' ',$need_upgrade)); {
echo "Install/upgrade required PEAR packages:\n";
if ($to_install) system($config['pear'].' install '.implode(' ',$to_install));
if ($need_upgrade) system($config['pear'].' upgrade '.implode(' ',$need_upgrade));
}
} }
} }