Source for file Dependency2.php
Documentation is available at Dependency2.php
* PEAR_Dependency2, advanced dependency validation
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id: Dependency2.php 313023 2011-07-06 19:17:11Z dufuz $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
* Required for the PEAR_VALIDATE_* constants
require_once 'PEAR/Validate.php';
* Dependency check for PEAR packages
* This class handles both version 1.0 and 2.0 dependencies
* WARNING: *any* changes to this class must be duplicated in the
* test_PEAR_Dependency2 class found in tests/PEAR_Dependency2/setup.php.inc,
* or unit tests will not actually validate the changes
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version Release: 1.9.4
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
* One of the PEAR_VALIDATE_* states
* @see PEAR_VALIDATE_NORMAL
* Command-line options to install/upgrade/uninstall commands
* Output of PEAR_Registry::parsedPackageName()
* @param array installation options
* @param array format of PEAR_Registry::parsedPackageName()
* @param int installation state (one of PEAR_VALIDATE_*)
$state = PEAR_VALIDATE_INSTALLING )
$this->_config = &$config;
require_once 'PEAR/DependencyDB.php';
if (isset ($installoptions['packagingroot'])) {
// make sure depdb is in the right location
$config->setInstallRoot ($installoptions['packagingroot']);
$this->_registry = &$config->getRegistry ();
if (isset ($installoptions['packagingroot'])) {
$config->setInstallRoot (false );
$this->_options = $installoptions;
require_once 'OS/Guess.php';
$this->_currentPackage = $package;
function _getExtraString ($dep)
if (isset ($dep['uri'])) {
if (isset ($dep['recommended'])) {
$extra .= 'recommended version ' . $dep['recommended'];
if (isset ($dep['min'])) {
$extra .= 'version >= ' . $dep['min'];
if (isset ($dep['max'])) {
$extra .= 'version <= ' . $dep['max'];
if (isset ($dep['exclude'])) {
$dep['exclude'] = array ($dep['exclude']);
$extra .= 'excluded versions: ';
foreach ($dep['exclude'] as $i => $exclude) {
* This makes unit-testing a heck of a lot easier
* This makes unit-testing a heck of a lot easier
* Specify a dependency on an OS. Use arch for detailed os/processor information
* There are two generic OS dependencies that will be the most common, unix and windows.
* Other options are linux, freebsd, darwin (OS X), sunos, irix, hpux, aix
if ($dep['name'] == '*') {
$not = isset ($dep['conflicts']) ? true : false;
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError("Cannot install %s on Windows");
return $this->warning("warning: Cannot install %s on Windows");
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError("Can only install %s on Windows");
return $this->warning("warning: Can only install %s on Windows");
$unices = array ('linux', 'freebsd', 'darwin', 'sunos', 'irix', 'hpux', 'aix');
if (in_array($this->getSysname (), $unices)) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError("Cannot install %s on any Unix system");
return $this->warning( "warning: Cannot install %s on any Unix system");
if (!in_array($this->getSysname (), $unices)) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError("Can only install %s on a Unix system");
return $this->warning("warning: Can only install %s on a Unix system");
if (!isset ($this->_options['nodeps']) &&
!isset ($this->_options['force'])) {
return $this->raiseError('Cannot install %s on ' . $dep['name'] .
return $this->warning('warning: Cannot install %s on ' .
$dep['name'] . ' operating system');
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('Cannot install %s on ' .
' operating system, can only install on ' . $dep['name']);
return $this->warning('warning: Cannot install %s on ' .
' operating system, can only install on ' . $dep['name']);
* This makes unit-testing a heck of a lot easier
* Specify a complex dependency on an OS/processor/kernel version,
* Use OS for simple operating system dependency.
* This is the only dependency that accepts an eregable pattern. The pattern
* will be matched against the php_uname() output parsed by OS_Guess
$not = isset ($dep['conflicts']) ? true : false;
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s Architecture dependency failed, does not ' .
'match "' . $dep['pattern'] . '"');
return $this->warning('warning: %s Architecture dependency failed, does ' .
'not match "' . $dep['pattern'] . '"');
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s Architecture dependency failed, required "' .
return $this->warning('warning: %s Architecture dependency failed, ' .
'required "' . $dep['pattern'] . '"');
* This makes unit-testing a heck of a lot easier
* This makes unit-testing a heck of a lot easier
$extra = $this->_getExtraString ($dep);
if (isset ($dep['exclude'])) {
$dep['exclude'] = array ($dep['exclude']);
if (!isset ($dep['min']) && !isset ($dep['max']) &&
!isset ($dep['recommended']) && !isset ($dep['exclude'])
if (isset ($dep['conflicts'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s conflicts with PHP extension "' .
$dep['name'] . '"' . $extra);
return $this->warning('warning: %s conflicts with PHP extension "' .
$dep['name'] . '"' . $extra);
if (isset ($dep['conflicts'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s requires PHP extension "' .
$dep['name'] . '"' . $extra);
return $this->warning('warning: %s requires PHP extension "' .
$dep['name'] . '"' . $extra);
return $this->warning('%s can optionally use PHP extension "' .
$dep['name'] . '"' . $extra);
if (isset ($dep['conflicts'])) {
return $this->warning('%s can optionally use PHP extension "' .
$dep['name'] . '"' . $extra);
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s requires PHP extension "' . $dep['name'] .
return $this->warning('warning: %s requires PHP extension "' . $dep['name'] .
$version = (string) $this->phpversion($dep['name']);
if ($fail && !isset ($dep['conflicts'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s requires PHP extension "' . $dep['name'] .
'"' . $extra . ', installed version is ' . $version);
return $this->warning('warning: %s requires PHP extension "' . $dep['name'] .
'"' . $extra . ', installed version is ' . $version);
} elseif ((isset ($dep['min']) || isset ($dep['max'])) && !$fail && isset ($dep['conflicts'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s conflicts with PHP extension "' .
$dep['name'] . '"' . $extra . ', installed version is ' . $version);
return $this->warning('warning: %s conflicts with PHP extension "' .
$dep['name'] . '"' . $extra . ', installed version is ' . $version);
if (isset ($dep['exclude'])) {
foreach ($dep['exclude'] as $exclude) {
if (isset ($dep['conflicts'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s is not compatible with PHP extension "' .
$dep['name'] . '" version ' .
return $this->warning('warning: %s is not compatible with PHP extension "' .
$dep['name'] . '" version ' .
} elseif (version_compare($version, $exclude, '!=') && isset ($dep['conflicts'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s conflicts with PHP extension "' .
$dep['name'] . '"' . $extra . ', installed version is ' . $version);
return $this->warning('warning: %s conflicts with PHP extension "' .
$dep['name'] . '"' . $extra . ', installed version is ' . $version);
if (isset ($dep['recommended'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s dependency: PHP extension ' . $dep['name'] .
' version "' . $version . '"' .
' is not the recommended version "' . $dep['recommended'] .
'", but may be compatible, use --force to install');
return $this->warning('warning: %s dependency: PHP extension ' .
$dep['name'] . ' version "' . $version . '"' .
' is not the recommended version "' . $dep['recommended']. '"');
$extra = $this->_getExtraString ($dep);
if (isset ($dep['exclude'])) {
$dep['exclude'] = array ($dep['exclude']);
if (isset ($dep['min'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
$extra . ', installed version is ' . $version);
return $this->warning('warning: %s requires PHP' .
$extra . ', installed version is ' . $version);
if (isset ($dep['max'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
$extra . ', installed version is ' . $version);
return $this->warning('warning: %s requires PHP' .
$extra . ', installed version is ' . $version);
if (isset ($dep['exclude'])) {
foreach ($dep['exclude'] as $exclude) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s is not compatible with PHP version ' .
'warning: %s is not compatible with PHP version ' .
* This makes unit-testing a heck of a lot easier
$extra = $this->_getExtraString ($dep);
if (isset ($dep['exclude'])) {
$dep['exclude'] = array ($dep['exclude']);
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s requires PEAR Installer' . $extra .
', installed version is ' . $pearversion);
return $this->warning('warning: %s requires PEAR Installer' . $extra .
', installed version is ' . $pearversion);
if (isset ($dep['max'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s requires PEAR Installer' . $extra .
', installed version is ' . $pearversion);
return $this->warning('warning: %s requires PEAR Installer' . $extra .
', installed version is ' . $pearversion);
if (isset ($dep['exclude'])) {
if (!isset ($dep['exclude'][0 ])) {
$dep['exclude'] = array ($dep['exclude']);
foreach ($dep['exclude'] as $exclude) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s is not compatible with PEAR Installer ' .
return $this->warning('warning: %s is not compatible with PEAR ' .
'Installer version ' . $exclude);
* @param array dependency information (2.0 format)
* @param boolean whether this is a required dependency
* @param array a list of downloaded packages to be installed, if any
* @param boolean if true, then deps on pear.php.net that fail will also check
* against pecl.php.net packages to accomodate extensions that have
* moved to pecl.php.net from pear.php.net
if (isset ($dep['providesextension'])) {
$subdep['name'] = $subdep['providesextension'];
return $this->_validatePackageInstall ($dep, $required, $depv1);
return $this->_validatePackageDownload ($dep, $required, $params, $depv1);
function _validatePackageDownload ($dep, $required, $params, $depv1 = false )
$dep['package'] = $dep['name'];
if (isset ($dep['uri'])) {
$dep['channel'] = '__uri';
foreach ($params as $param) {
array ('package' => $dep['name'],
'channel' => $dep['channel']))) {
if ($depv1 && $dep['channel'] == 'pear.php.net') {
array ('package' => $dep['name'],
'channel' => 'pecl.php.net'))) {
if (!$found && isset ($dep['providesextension'])) {
foreach ($params as $param) {
if ($param->isExtension ($dep['providesextension'])) {
$version = $param->getVersion ();
if ($this->_registry->packageExists($dep['name'], $dep['channel'])) {
$version = $this->_registry->packageinfo ($dep['name'], 'version',
if ($dep['channel'] == 'pecl.php.net' && $this->_registry->packageExists($dep['name'],
$version = $this->_registry->packageinfo ($dep['name'], 'version',
$version = 'not installed or downloaded';
$extra = $this->_getExtraString ($dep);
if (isset ($dep['exclude']) && !is_array($dep['exclude'])) {
$dep['exclude'] = array ($dep['exclude']);
if (!isset ($dep['min']) && !isset ($dep['max']) &&
!isset ($dep['recommended']) && !isset ($dep['exclude'])
if ($installed || $downloaded) {
$installed = $installed ? 'installed' : 'downloaded';
if (isset ($dep['conflicts'])) {
$rest = " , $installed version is " . $version;
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s conflicts with package "' . $depname . '"' . $extra . $rest);
return $this->warning('warning: %s conflicts with package "' . $depname . '"' . $extra . $rest);
if (isset ($dep['conflicts'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s requires package "' . $depname . '"' . $extra);
return $this->warning('warning: %s requires package "' . $depname . '"' . $extra);
return $this->warning('%s can optionally use package "' . $depname . '"' . $extra);
if (!$installed && !$downloaded) {
if (isset ($dep['conflicts'])) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s requires package "' . $depname . '"' . $extra);
return $this->warning('warning: %s requires package "' . $depname . '"' . $extra);
return $this->warning('%s can optionally use package "' . $depname . '"' . $extra);
if ($fail && !isset ($dep['conflicts'])) {
$installed = $installed ? 'installed' : 'downloaded';
$dep['package'] = $dep['name'];
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s requires package "' . $depname . '"' .
$extra . " , $installed version is " . $version);
return $this->warning('warning: %s requires package "' . $depname . '"' .
$extra . " , $installed version is " . $version);
} elseif ((isset ($dep['min']) || isset ($dep['max'])) && !$fail &&
isset ($dep['conflicts']) && !isset ($dep['exclude'])) {
$installed = $installed ? 'installed' : 'downloaded';
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s conflicts with package "' . $depname . '"' . $extra .
" , $installed version is " . $version);
return $this->warning('warning: %s conflicts with package "' . $depname . '"' .
$extra . " , $installed version is " . $version);
if (isset ($dep['exclude'])) {
$installed = $installed ? 'installed' : 'downloaded';
foreach ($dep['exclude'] as $exclude) {
if (version_compare($version, $exclude, '==') && !isset ($dep['conflicts'])) {
if (!isset ($this->_options['nodeps']) &&
!isset ($this->_options['force'])
return $this->raiseError('%s is not compatible with ' .
$installed . ' package "' .
$depname . '" version ' .
return $this->warning('warning: %s is not compatible with ' .
$installed . ' package "' .
$depname . '" version ' .
} elseif (version_compare($version, $exclude, '!=') && isset ($dep['conflicts'])) {
$installed = $installed ? 'installed' : 'downloaded';
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('%s conflicts with package "' . $depname . '"' .
$extra . " , $installed version is " . $version);
return $this->warning('warning: %s conflicts with package "' . $depname . '"' .
$extra . " , $installed version is " . $version);
if (isset ($dep['recommended'])) {
$installed = $installed ? 'installed' : 'downloaded';
if (!$found && $installed) {
$param = $this->_registry->getPackage($dep['name'], $dep['channel']);
foreach ($params as $parent) {
if ($parent->isEqual ($this->_currentPackage)) {
if ($param->isCompatible ($parent)) {
} else { // this is for validPackage() calls
$parent = $this->_registry->getPackage($this->_currentPackage['package'],
$this->_currentPackage['channel']);
if ($parent !== null && $param->isCompatible ($parent)) {
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force']) &&
!isset ($this->_options['loose'])
return $this->raiseError('%s dependency package "' . $depname .
'" ' . $installed . ' version ' . $version .
' is not the recommended version ' . $dep['recommended'] .
', but may be compatible, use --force to install');
return $this->warning('warning: %s dependency package "' . $depname .
'" ' . $installed . ' version ' . $version .
' is not the recommended version ' . $dep['recommended']);
function _validatePackageInstall ($dep, $required, $depv1 = false )
return $this->_validatePackageDownload ($dep, $required, array (), $depv1);
* Verify that uninstalling packages passed in to command line is OK.
* @param PEAR_Installer $dl
* @return PEAR_Error|true
return $this->_dependencydb;
// construct an array of "downloaded" packages to fool the package dependency checker
// into using these to validate uninstalls of circular dependencies
$downloaded = &$dl->getUninstallPackages ();
foreach ($downloaded as $i => $pf) {
require_once 'PEAR/Downloader/Package.php';
$dp->setPackageFile ($downloaded[$i]);
$memyselfandI = strtolower($this->_currentPackage['channel']) . '/' .
if (isset ($dl->___uninstall_package_cache )) {
$badpackages = $dl->___uninstall_package_cache;
if (isset ($badpackages[$memyselfandI]['warnings'])) {
foreach ($badpackages[$memyselfandI]['warnings'] as $warning) {
$dl->log (0 , $warning[0 ]);
if (isset ($badpackages[$memyselfandI]['errors'])) {
foreach ($badpackages[$memyselfandI]['errors'] as $error) {
$dl->log (0 , $error->getMessage ());
if (isset ($this->_options['nodeps']) || isset ($this->_options['force'])) {
'warning: %s should not be uninstalled, other installed packages depend ' .
'%s cannot be uninstalled, other installed packages depend on this package');
// first, list the immediate parents of each package to be uninstalled
$perpackagelist = array ();
foreach ($params as $i => $param) {
foreach ($pardeps as $dep) {
if (strtolower($dep['dep']['channel']) == $a['channel'] &&
strtolower($dep['dep']['name']) == $a['package']) {
if (!isset ($perpackagelist[$a['channel'] . '/' . $a['package']])) {
$perpackagelist[$a['channel'] . '/' . $a['package']] = array ();
$perpackagelist[$a['channel'] . '/' . $a['package']][]
= array ($d['channel'] . '/' . $d['package'], $dep);
if (!isset ($allparents[$d['channel'] . '/' . $d['package']])) {
$allparents[$d['channel'] . '/' . $d['package']] = array ();
if (!isset ($allparents[$d['channel'] . '/' . $d['package']][$a['channel'] . '/' . $a['package']])) {
$allparents[$d['channel'] . '/' . $d['package']][$a['channel'] . '/' . $a['package']] = array ();
$allparents[$d['channel'] . '/' . $d['package']]
[$a['channel'] . '/' . $a['package']][]
// next, remove any packages from the parents list that are not installed
foreach ($allparents as $parent => $d1) {
if ($this->_registry->packageExists($d[0 ][0 ]['package'], $d[0 ][0 ]['channel'])) {
// next remove any packages from the parents list that are not passed in for
foreach ($allparents as $parent => $d1) {
foreach ($params as $param) {
if (strtolower($param->getChannel ()) == $d[0 ][0 ]['channel'] &&
strtolower($param->getPackage ()) == $d[0 ][0 ]['package']) {
// remove all packages whose dependencies fail
// save which ones failed for error reporting
foreach ($remove as $package => $unused) {
if (!isset ($allparents[$package])) {
foreach ($allparents[$package] as $kid => $d1) {
foreach ($d1 as $depinfo) {
if ($depinfo[1 ]['type'] != 'optional') {
if (isset ($badchildren[$kid])) {
$badchildren[$kid] = true;
// start over, we removed some children
// next, construct the list of packages that can't be uninstalled
$save = $this->_currentPackage;
foreach ($perpackagelist as $package => $packagedeps) {
foreach ($packagedeps as $parent) {
if (!isset ($remove[$parent[0 ]])) {
$packagename['channel'] = $this->_registry->channelAlias($packagename['channel']);
$pa = $this->_registry->getPackage($packagename['package'], $packagename['channel']);
$packagename['package'] = $pa->getPackage ();
$this->_currentPackage = $packagename;
// parent is not present in uninstall list, make sure we can actually
// uninstall it (parent dep is optional)
$parentname['channel'] = $this->_registry->channelAlias($parent[1 ]['dep']['channel']);
$pa = $this->_registry->getPackage($parent[1 ]['dep']['name'], $parent[1 ]['dep']['channel']);
$parentname['package'] = $pa->getPackage ();
$parent[1 ]['dep']['package'] = $parentname['package'];
$parent[1 ]['dep']['channel'] = $parentname['channel'];
if ($parent[1 ]['type'] == 'optional') {
$test = $this->_validatePackageUninstall ($parent[1 ]['dep'], false , $dl);
$badpackages[$package]['warnings'][] = $test;
$test = $this->_validatePackageUninstall ($parent[1 ]['dep'], true , $dl);
$badpackages[$package]['errors'][] = $test;
$this->_currentPackage = $save;
$dl->___uninstall_package_cache = $badpackages;
if (isset ($badpackages[$memyselfandI])) {
if (isset ($badpackages[$memyselfandI]['warnings'])) {
foreach ($badpackages[$memyselfandI]['warnings'] as $warning) {
$dl->log (0 , $warning[0 ]);
if (isset ($badpackages[$memyselfandI]['errors'])) {
foreach ($badpackages[$memyselfandI]['errors'] as $error) {
$dl->log (0 , $error->getMessage ());
if (isset ($this->_options['nodeps']) || isset ($this->_options['force'])) {
'warning: %s should not be uninstalled, other installed packages depend ' .
'%s cannot be uninstalled, other installed packages depend on this package');
function _validatePackageUninstall ($dep, $required, $dl)
$version = $this->_registry->packageinfo ($dep['package'], 'version', $dep['channel']);
$extra = $this->_getExtraString ($dep);
if (isset ($dep['exclude']) && !is_array($dep['exclude'])) {
$dep['exclude'] = array ($dep['exclude']);
if (isset ($dep['conflicts'])) {
return true; // uninstall OK - these packages conflict (probably installed with --force)
if (!isset ($dep['min']) && !isset ($dep['max'])) {
return $this->warning('"' . $depname . '" can be optionally used by ' .
'installed package %s' . $extra);
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError('"' . $depname . '" is required by ' .
'installed package %s' . $extra);
return $this->warning('warning: "' . $depname . '" is required by ' .
'installed package %s' . $extra);
// we re-use this variable, preserve the original value
$saverequired = $required;
return $this->warning($depname . $extra . ' can be optionally used by installed package' .
if (!isset ($this->_options['nodeps']) && !isset ($this->_options['force'])) {
return $this->raiseError($depname . $extra . ' is required by installed package' .
return $this->raiseError('warning: ' . $depname . $extra .
' is required by installed package "%s"');
* validate a downloaded package against installed packages
* As of PEAR 1.4.3, this will only validate
* @param array|PEAR_Downloader_Package|PEAR_PackageFile_v1|PEAR_PackageFile_v2
* $pkg package identifier (either
* array('package' => blah, 'channel' => blah) or an array with
* index 'info' referencing an object)
* @param PEAR_Downloader $dl
* @param array $params full list of packages to install
* @return true|PEAR_Error
if (is_array($pkg) && isset ($pkg['info'])) {
require_once 'PEAR/Downloader/Package.php';
$dp->setPackageFile ($pkg);
$dp->setDownloadURL ($pkg);
foreach ($deps as $channel => $info) {
foreach ($info as $package => $ds) {
foreach ($params as $packd) {
$packd->getChannel () == $channel) {
$dl->log (3 , 'skipping installed package check of "' .
array ('channel' => $channel, 'package' => $package),
'", version "' . $packd->getVersion () . '" will be ' .
'downloaded and installed');
continue 2; // jump to next package
array ('channel' => $channel, 'package' => $package), $this->_state);
$required = $d['type'] == 'required';
$ret = $checker->_validatePackageDownload ($dep, $required, array (&$dp));
$dl->log (0 , $ret->getMessage ());
'%s cannot be installed, conflicts with installed packages');
* validate a package.xml 1.0 dependency
if (!isset ($dep['optional'])) {
return $this->{" validate{$type}Dependency" }($newdep, $dep['optional'] == 'no',
* Convert a 1.0 dep into a 2.0 dep
if (!isset ($types[$dep['type']])) {
return array (false , false );
$type = $types[$dep['type']];
$newdep['channel'] = 'pear.php.net';
$newdep['name'] = $dep['name'];
return array ($newdep, $type);
$newdep['conflicts'] = true;
$newdep['min'] = $dep['version'];
if ($dep['rel'] == '>') {
$newdep['exclude'] = $dep['version'];
$newdep['max'] = $dep['version'];
if ($dep['rel'] == '<') {
$newdep['exclude'] = $dep['version'];
$newdep['max'] = '100000';
$newdep['exclude'] = $dep['version'];
$newdep['min'] = $dep['version'];
$newdep['max'] = $dep['version'];
if (!isset ($newdep['min'])) {
$newdep['min'] = '4.4.0';
if (!isset ($newdep['max'])) {
$newdep['max'] = '6.0.0';
return array ($newdep, $type);
* Converts text comparing operators to them sign equivalents
* @return string Sign equivalent
if (isset ($this->_options ['ignore-errors'])) {
$this->_currentPackage , true )));
return array (sprintf($msg, $this->_registry ->parsedPackageNameToString (
$this->_currentPackage , true )));
Documentation generated on Wed, 06 Jul 2011 23:30:42 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.
|