Class PEAR_Downloader

Description

Administration class used to download PEAR packages and maintain the installed package database.

Located in /maintenance/libraries/pear/PEAR/Downloader.php (line 42)

PEAR
   |
   --PEAR_Common
      |
      --PEAR_Downloader
Direct descendents
Class Description
 class PEAR_Installer Administration class used to install PEAR packages and maintain the installed package database.
Variable Summary
Method Summary
 PEAR_Downloader PEAR_Downloader (mixed &$ui, mixed $options, mixed &$config)
 void configSet (mixed $key, mixed $value, [mixed $layer = 'user'])
 void doDownload (array $packages)
 void download (array $packages)
 void extractDownloadFileName (mixed $pkgfile, mixed &$version)
 void getErrorMsgs ()
 void getPackageDownloadUrl (mixed $package, [mixed $version = null])
 void pushError (string $errmsg, [integer $code = -1])
 void setOptions (mixed $options)
 void _downloadCallback (mixed $msg, [mixed $params = null])
 null|PEAR_Error|string _downloadFile (string $pkgfile, string $version, string $origpkgfile, [string|null $state = null])
 false|PEAR_Error|string _downloadNonFile (mixed $pkgfile)
 void _prependPath (mixed $path, mixed $prepend)
 false|string|PEAR_Error _processDependency (array $package, array $info, mixed $mywillinstall)
Variables
PEAR_Config $_config (line 48)
  • access: private
array $_downloadedPackages = array() (line 96)

Downloaded Packages after a call to download().

Format of each entry:

  1. array('pkg' => 'package_name', 'file' => '/path/to/local/file',
  2. 'info' => array() // parsed package.xml
  3. );

  • access: private
array $_errorStack = array() (line 129)
  • access: private
array $_installed = array() (line 123)

Array of every package installed, with names lower-cased.

Format:

  1. array('package1' => 0, 'package2' => 1, );

array $_options (line 81)

Options from command-line passed to Install.

Recognized options:

  • onlyreqdeps : install all required dependencies as well
  • alldeps : install all dependencies, including optional
  • installroot : base relative path to install files in
  • force : force a download even if warnings would prevent it

string|null $_preferredState (line 67)

Preferred Installation State (snapshot, devel, alpha, beta, stable)

  • access: private
PEAR_Registry $_registry (line 54)
  • access: private
PEAR_Remote $_remote (line 60)
  • access: private
array $_toDownload = array() (line 112)

Packages slated for download.

This is used to prevent downloading a package more than once should it be a dependency for two packages to be installed. Format of each entry:

 array('package_name1' => parsed package.xml, 'package_name2' => parsed package.xml,
 );

  • access: private

Inherited Variables

Inherited from PEAR_Common

PEAR_Common::$config
PEAR_Common::$current_attributes
PEAR_Common::$current_element
PEAR_Common::$current_path
PEAR_Common::$element_stack
PEAR_Common::$pkginfo
PEAR_Common::$source_analyzer
PEAR_Common::$ui
PEAR_Common::$_validPackageFile
Methods
Constructor PEAR_Downloader (line 133)
PEAR_Downloader PEAR_Downloader (mixed &$ui, mixed $options, mixed &$config)
configSet (line 164)
void configSet (mixed $key, mixed $value, [mixed $layer = 'user'])
doDownload (line 339)

Download any files and their dependencies, if necessary

void doDownload (array $packages)
  • array $packages: a mixed list of package names, local files, or package.xml
download (line 326)

Download any files and their dependencies, if necessary

BC-compatible method name

void download (array $packages)
  • array $packages: a mixed list of package names, local files, or package.xml

Redefined in descendants as:
extractDownloadFileName (line 284)
void extractDownloadFileName (mixed $pkgfile, mixed &$version)
getDownloadedPackages (line 309)

Retrieve a list of downloaded packages after a call to download().

Also resets the list of downloaded packages.

array getDownloadedPackages ()
getErrorMsgs (line 665)
void getErrorMsgs ()
getPackageDownloadUrl (line 264)
void getPackageDownloadUrl (mixed $package, [mixed $version = null])
pushError (line 657)
void pushError (string $errmsg, [integer $code = -1])
  • string $errmsg
  • integer $code
setOptions (line 176)
void setOptions (mixed $options)
_downloadCallback (line 609)
void _downloadCallback (mixed $msg, [mixed $params = null])
_downloadFile (line 192)
  • access: private
null|PEAR_Error|string _downloadFile (string $pkgfile, string $version, string $origpkgfile, [string|null $state = null])
  • string $pkgfile: filename to download
  • string $version: version/state
  • string $origpkgfile: original value passed to command-line
  • string|null $state: preferred state (snapshot/devel/alpha/beta/stable) Defaults to configuration preferred state
_downloadNonFile (line 422)
  • return: false if loop should be broken out of, string if the file was downloaded, PEAR_Error on exception
  • access: private
false|PEAR_Error|string _downloadNonFile (mixed $pkgfile)
_prependPath (line 639)
void _prependPath (mixed $path, mixed $prepend)
_processDependency (line 525)

Process a dependency, download if necessary

  • todo: Add test for relation 'lt'/'le' -> make sure that the dependency requested is in fact lower than the required value. This will be very important for BC dependencies
  • access: private
false|string|PEAR_Error _processDependency (array $package, array $info, mixed $mywillinstall)
  • array $package: dependency information from PEAR_Remote call
  • array $info: packages that will be installed in this iteration

Inherited Methods

Inherited From PEAR_Common

 PEAR_Common::PEAR_Common()
 PEAR_Common::addTempFile()
 PEAR_Common::analyzeSourceCode()
 PEAR_Common::betterStates()
 PEAR_Common::buildProvidesArray()
 PEAR_Common::detectDependencies()
 PEAR_Common::downloadHttp()
 PEAR_Common::getDependencyRelations()
 PEAR_Common::getDependencyTypes()
 PEAR_Common::getFileRoles()
 PEAR_Common::getProvideTypes()
 PEAR_Common::getReleaseStates()
 PEAR_Common::getReplacementTypes()
 PEAR_Common::getScriptPhases()
 PEAR_Common::getUserRoles()
 PEAR_Common::infoFromAny()
 PEAR_Common::infoFromDescriptionFile()
 PEAR_Common::infoFromString()
 PEAR_Common::infoFromTgzFile()
 PEAR_Common::log()
 PEAR_Common::mkDirHier()
 PEAR_Common::mkTempDir()
 PEAR_Common::setFrontendObject()
 PEAR_Common::sortPkgDeps()
 PEAR_Common::validatePackageInfo()
 PEAR_Common::validPackageName()
 PEAR_Common::validPackageVersion()
 PEAR_Common::xmlFromInfo()
 PEAR_Common::_element_end()
 PEAR_Common::_element_end_1_0()
 PEAR_Common::_element_start()
 PEAR_Common::_element_start_1_0()
 PEAR_Common::_getPkgDeps()
 PEAR_Common::_getPkgDepTree()
 PEAR_Common::_getRevPkgDeps()
 PEAR_Common::_makeReleaseXml()
 PEAR_Common::_PEAR_Common()
 PEAR_Common::_pkginfo_cdata_1_0()
 PEAR_Common::_removedDependency()
 PEAR_Common::_sortPkgDeps()
 PEAR_Common::_sortPkgDepsRev()
 PEAR_Common::_unIndent()

Documentation generated on Thu, 20 Jan 2005 17:09:43 +0000 by phpDocumentor 1.3.0RC3