PEAR_Dependency2::validatePackageDependency() – validatePackageDependency


require_once '/Dependency2.php';

array|true|PEAR_Error PEAR_Dependency2::validatePackageDependency ( array $dep , boolean $required , array $params , bool $depv1 = false )


Validate a package-style dependency. Validation is performed in this sequence:

  1. If the dependency package provides an extension through the <providesextension> tag, then see if it passes the extension validation test first and return if so.

  2. If the list of packages to be installed contains a match for the dependency, use that to validate the dependency and return.

  3. If the dependency package is already installed, make sure the installed version passes the conditions.

  4. At this point, the dependency has failed. If the dependency is required, return a PEAR_Error containing the failure error message, otherwise return an array containing the error message.


array $dep

dependency array as defined by package.xml 2.0

boolean $required

whether this is a required or optional dependency

array $params

array of PEAR_Downloader_Package objects representing packages to be downloaded that can be used to validate dependencies

boolean $depv1

if TRUE, then deps on that fail will also check against packages to accommodate extensions that have moved to from


throws no exceptions thrown


This function can not be called statically.

validatePackage (Previous) validatePackageUninstall (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.