|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-13 16:16 UTC] cellog@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 17:00:01 2025 UTC |
Description: ------------ if a package has an optional dependency, it can't be uninstalled if the optional dependency is installed. This patch fixes that Index: pear/PEAR/Dependency.php =================================================================== RCS file: /repository/php-src/pear/PEAR/Dependency.php,v retrieving revision 1.23 diff -u -r1.23 Dependency.php --- pear/PEAR/Dependency.php 3 Aug 2003 13:44:36 -0000 1.23 +++ pear/PEAR/Dependency.php 13 Aug 2003 21:13:31 -0000 @@ -151,11 +151,12 @@ * Check package dependencies on uninstall * * @param string $error The resultant error string + * @param string $warning The resultant warning string * @param string $name Name of the package to test * * @return bool true if there were errors */ - function checkPackageUninstall(&$error, $package) + function checkPackageUninstall(&$error, &$warning, $package) { $error = null; $packages = $this->registry->listPackages(); @@ -169,7 +170,11 @@ } foreach ($deps as $dep) { if ($dep['type'] == 'pkg' && strcasecmp($dep['name'], $package) == 0) { - $error .= "Package '$pkg' depends on '$package'\n"; + if (isset($dep['optional']) && $dep['optional'] == 'yes') { + $warning .= "\nWarning: Package '$pkg' optionally depends on '$package'"; + } else { + $error .= "Package '$pkg' depends on '$package'\n"; + } } } }