Class PEAR_Dependency

Description

Dependency check for PEAR packages

The class is based on the dependency RFC that can be found at http://cvs.php.net/cvs.php/pearweb/rfc. It requires PHP >= 4.1

Located in /maintenance/libraries/pear/PEAR/Dependency.php (line 43)


	
			
Method Summary
 void PEAR_Dependency (object Registry &$registry)
 boolean callCheckMethod (string &$errmsg, array $opts)
 mixed checkExtension (mixed &$errmsg, string $name, [mixed $req = null], [string $relation = 'has'], [bool $opt = false], string $req_ext_ver)
 mixed checkOS (mixed &$errmsg, string $os)
 mixed checkPackage (string &$errmsg, string $name, [string $req = null], [string $relation = 'has'], [bool $opt = false])
 bool checkPackageUninstall (string &$error, string &$warning, mixed $package, string $name)
 mixed checkPHP (mixed &$errmsg, string $req, [string $relation = 'ge'])
 mixed checkProgram (mixed &$errmsg, string $program)
 mixed checkSAPI (mixed &$errmsg, string $name, [string $req = null], [string $relation = 'has'])
 mixed checkZend (mixed &$errmsg, string $req, [string $relation = 'ge'])
 integer codeFromRelation (string $relation, string $version, string $req, [bool $opt = false])
 string signOperator (string $operator)
Methods
Constructor PEAR_Dependency (line 53)

Constructor

  • access: public
void PEAR_Dependency (object Registry &$registry)
  • object Registry &$registry: object
callCheckMethod (line 80)

This method maps the XML dependency definition to the corresponding one from PEAR_Dependency

 $opts => Array
    (
        [type] => pkg
        [rel] => ge
        [version] => 3.4
        [name] => HTML_Common
        [optional] => false
    )

boolean callCheckMethod (string &$errmsg, array $opts)
  • string &$errmsg: Error message
  • array $opts: Options
checkExtension (line 234)

Extension dependencies check method

  • return: bool false if no error or the error string
mixed checkExtension (mixed &$errmsg, string $name, [mixed $req = null], [string $relation = 'has'], [bool $opt = false], string $req_ext_ver)
  • string $name: Name of the extension to test
  • string $req_ext_ver: Required extension version to compare with
  • string $relation: How to compare versions with eachother
  • bool $opt: Whether the relationship is optional
checkOS (line 290)

Operating system dependencies check method

  • return: bool false if no error or the error string
mixed checkOS (mixed &$errmsg, string $os)
  • string $os: Name of the operating system
checkPackage (line 129)

Package dependencies check method

  • return: bool false if no error or the error string
mixed checkPackage (string &$errmsg, string $name, [string $req = null], [string $relation = 'has'], [bool $opt = false])
  • string $errmsg: Empty string, it will be populated with an error message, if any
  • string $name: Name of the package to test
  • string $req: The package version required
  • string $relation: How to compare versions with each other
  • bool $opt: Whether the relationship is optional
checkPackageUninstall (line 193)

Check package dependencies on uninstall

  • return: true if there were errors
bool checkPackageUninstall (string &$error, string &$warning, mixed $package, string $name)
  • string $error: The resultant error string
  • string $warning: The resultant warning string
  • string $name: Name of the package to test
checkPHP (line 318)

PHP version check method

  • return: bool false if no error or the error string
mixed checkPHP (mixed &$errmsg, string $req, [string $relation = 'ge'])
  • string $req: which version to compare
  • string $relation: how to compare the version
checkProgram (line 352)

External program check method. Looks for executable files in directories listed in the PATH environment variable.

  • return: bool false if no error or the error string
mixed checkProgram (mixed &$errmsg, string $program)
  • string $program: which program to look for
checkSAPI (line 380)

SAPI backend check method. Version comparison is not yet available here.

  • return: bool false if no error or the error string
mixed checkSAPI (mixed &$errmsg, string $name, [string $req = null], [string $relation = 'has'])
  • string $name: name of SAPI backend
  • string $req: which version to compare
  • string $relation: how to compare versions (currently hardcoded to 'has')
checkZend (line 406)

Zend version check method

  • return: bool false if no error or the error string
mixed checkZend (mixed &$errmsg, string $req, [string $relation = 'ge'])
  • string $req: which version to compare
  • string $relation: how to compare the version
codeFromRelation (line 460)

Convert relation into corresponding code

  • access: public
integer codeFromRelation (string $relation, string $version, string $req, [bool $opt = false])
  • string $relation: Relation
  • string $version: Version
  • string $req: Requirement
  • bool $opt: Optional dependency indicator
signOperator (line 433)

Converts text comparing operators to them sign equivalents

Example: 'ge' to '>='

  • return: Sign equivalent
  • access: public
string signOperator (string $operator)
  • string $operator: Operator

Documentation generated on Fri, 3 Dec 2004 12:26:31 +0000 by phpDocumentor 1.3.0RC3