PEAR
[ class tree: PEAR ] [ index: PEAR ] [ all elements ]

Class: PEAR_Downloader_Package

Source Location: /PEAR-1.10.0dev2/PEAR/Downloader/Package.php

Class Overview


Coordinates download parameters and manages their dependencies prior to downloading them.


Author(s):

Version:

  • Release: 1.10.0dev2

Copyright:

  • 1997-2009 The Authors

Methods


Inherited Variables

Inherited Methods


Class Details

[line 56]
Coordinates download parameters and manages their dependencies prior to downloading them.

Input can come from three sources:

  • local files (archives or package.xml)
  • remote files (downloadable urls)
  • abstract package names
The first two elements are handled cleanly by PEAR_PackageFile, but the third requires accessing pearweb's xml-rpc interface to determine necessary dependencies, and the format returned of dependencies is slightly different from that used in package.xml.

This class hides the differences between these elements, and makes automatic dependency resolution a piece of cake. It also manages conflicts when two classes depend on incompatible dependencies, or differing versions of the same package dependency. In addition, download will not be attempted if the php version is not supported, PEAR installer version is not supported, or non-PECL extensions are not installed.



[ Top ]


Method Detail

__construct (Constructor)   [line 132]

PEAR_Downloader_Package __construct( PEAR_Downloader &$downloader)


Parameters:

PEAR_Downloader   &$downloader   — 

[ Top ]

alreadyValidated   [line 391]

void alreadyValidated( )


[ Top ]

canDefault   [line 921]

void canDefault( )


[ Top ]

detectDependencies   [line 357]

void detectDependencies( $params)


Parameters:

   $params   — 

[ Top ]

detectStupidDuplicates   [line 1244]

array detectStupidDuplicates( array $params, &$errorparams, array $errorparams)

Detect duplicate package names with differing versions

If a user requests to install Date 1.4.6 and Date 1.4.7, for instance, this is a logic error. This method detects this situation.

  • Return: array of stupid duplicated packages in PEAR_Downloader_Package obejcts
  • Access: public

Parameters:

array   $params   —  array of PEAR_Downloader_Package objects
array   $errorparams   —  empty array
   &$errorparams   — 

[ Top ]

download   [line 248]

PEAR_PackageFile_v1|PEAR_PackageFile_v2|PEAR_Error &download( )

Retrieve any non-local packages

[ Top ]

explicitState   [line 1334]

void explicitState( )


[ Top ]

fromDepURL   [line 319]

void fromDepURL( $dep)

Like initialize(), but operates on a dependency

Parameters:

   $dep   — 

[ Top ]

getChannel   [line 986]

void getChannel( )


[ Top ]

getDeps   [line 1059]

void getDeps( )


[ Top ]

getDownloader   [line 306]

void &getDownloader( )


[ Top ]

getDownloadURL   [line 916]

void getDownloadURL( )


[ Top ]

getGroup   [line 1035]

void getGroup( )


[ Top ]

getPackage   [line 930]

void getPackage( )


[ Top ]

getPackageFile   [line 301]

void &getPackageFile( )


[ Top ]

getPackagefileObject   [line 1495]

void &getPackagefileObject( PEAR_Config &$c, int $d, string 2)

For simpler unit-testing

Parameters:

string   2   — 
PEAR_Config   &$c   — 
int   $d   — 

[ Top ]

getPackageType   [line 955]

void getPackageType( )


[ Top ]

getPackageXmlVersion   [line 975]

void getPackageXmlVersion( )


[ Top ]

getParsedPackage   [line 905]

void getParsedPackage( )


[ Top ]

getShortName   [line 899]

void getShortName( )


[ Top ]

getType   [line 311]

void getType( )


[ Top ]

getURI   [line 997]

void getURI( )


[ Top ]

getVersion   [line 1008]

void getVersion( )


[ Top ]

initialize   [line 157]

bool|PEAR_Error initialize( string $param)

Parse the input and determine whether this is a local file, a remote uri, or an abstract package name.

This is the heart of the PEAR_Downloader_Package(), and is used in PEAR_Downloader::download()


Parameters:

string   $param   — 

[ Top ]

isBundle   [line 966]

void isBundle( )


[ Top ]

isCompatible   [line 1019]

void isCompatible( $pf)


Parameters:

   $pf   — 

[ Top ]

isEqual   [line 1084]

void isEqual( array $param)


Parameters:

array   $param   —  Parsed array from PEAR_Registry::parsePackageName() or a dependency returned from getDepDownloadURL()

[ Top ]

isExtension   [line 1044]

void isExtension( $name)


Parameters:

   $name   — 

[ Top ]

isInstalled   [line 1170]

void isInstalled( $dep, [ $oper = '=='])


Parameters:

   $dep   — 
   $oper   — 

[ Top ]

isSubpackage   [line 944]

void isSubpackage( PEAR_PackageFile_v1|PEAR_PackageFile_v2 &$pf)


Parameters:


[ Top ]

mergeDependencies   [line 1346]

void mergeDependencies( &$params)

  • Access: public

Parameters:

   &$params   — 

[ Top ]

removeDuplicates   [line 1283]

void removeDuplicates( array &$params, [bool $ignoreGroups = false])

  • Access: public

Parameters:

array   &$params   — 
bool   $ignoreGroups   —  ignore install groups - for final removal of dupe packages

[ Top ]

removeInstalled   [line 400]

void removeInstalled( array &$params)

Remove packages to be downloaded that are already installed
  • Access: public

Parameters:

array   &$params   —  of PEAR_Downloader_Package objects

[ Top ]

setDownloadURL   [line 884]

void setDownloadURL( $pkg)


Parameters:

   $pkg   — 

[ Top ]

setExplicitState   [line 1339]

void setExplicitState( $s)


Parameters:

   $s   — 

[ Top ]

setGroup   [line 1030]

void setGroup( $group)


Parameters:

   $group   — 

[ Top ]

setPackageFile   [line 894]

void setPackageFile( &$pkg, PEAR_PackageFile_v1|PEAR_PackageFile_v2 $pkg)

Set the package.xml object for this downloaded package

Parameters:

PEAR_PackageFile_v1|PEAR_PackageFile_v2   $pkg   — 
   &$pkg   — 

[ Top ]

setValidated   [line 386]

void setValidated( )


[ Top ]

willDownload   [line 1474]

void willDownload( $param, $params)

  • Access: public

Parameters:

   $param   — 
   $params   — 

[ Top ]


Documentation generated on Fri, 31 Jul 2015 09:30:23 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.