Re: [Patch] Optional dependencies

From: Date: Thu, 15 May 2003 20:59:13 +0000
Subject: Re: [Patch] Optional dependencies
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16328@lists.php.net to get a copy of this message
On Thu, May 15, 2003 at 09:43:37PM +0200, Martin Jansen wrote: > Attached you'll find a patch against the latest CVS version of the PEAR > installer, which implements optional dependencies. This kind of > dependency is recognized by the attribute optional="yes" in the > <dep> tag. Cool! > @@ -599,12 +601,18 @@ > > // Check dependencies ------------------------------------------- > if (isset($pkginfo['release_deps']) && > empty($options['nodeps'])) { > - $error = $this->checkDeps($pkginfo); > - if ($error) { > + $dep_errors = ""; Please use '' instead of "" (for consistency with the rest of the file). > + $error = $this->checkDeps($pkginfo, $dep_errors); > + if ($error == true) { > if (empty($options['soft'])) { > - $this->log(0, $error); > + $this->log(0, substr($dep_errors, 1)); > + } > + return $this->raiseError("$pkgname: Dependencies failed"); > + } else if ($dep_errors != "") { !empty($dep_errors) ? > - $failed_deps[] = array($dep, $code, $error); > + if (isset($dep['optional']) && > $dep['optional'] == "yes") { 'yes' instead of 'yes', please. > + // Ugly hack to adjust the error messages > + $error = str_replace("requires ", "", $error); Single quotes here, as well. > + $n = count($optional_deps); Please use a more descriptive variable name than $n. -- Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)

« previous php.pear.dev (#16328) next »