PHP 클래스 PEAR_Downloader_Package

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.
파일 보기 프로젝트 열기: sourcefabric/newscoop 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_analyzed boolean
$_config PEAR_Config
$_downloadDeps array
$_downloadURL array
$_downloader PEAR_Downloader
$_explicitGroup If this package is invoked with Package#group, this variable will be true
$_explicitState string | false This allows temporary reassignment of preferred_state for a parent package and all of its dependencies.
$_installRegistry PEAR_Registry Used to implement packagingroot properly
$_packagefile PEAR_PackageFile_v1 | PEAR_PackageFile | v2
$_parsedname array
$_rawpackagefile string | false Contents of package.xml, if downloaded from a remote channel
$_registry PEAR_Registry
$_type string Package type local|url
$_valid boolean
$_validated boolean

공개 메소드들

메소드 설명
PEAR_Downloader_Package ( &$downloader )
_analyzeDownloadURL ( $info, $param, $pname, $params = null, $optional = false, $isdependency = false )
_detect1 ( $deps, $pname, $options, $params )
_detect2 ( $deps, $pname, $options, $params )
_detect2Dep ( $dep, $pname, $group, $params )
_fromFile ( &$param ) This will retrieve from a local file if possible, and parse out a group name as well. The original parameter will be modified to reflect this.
_fromString ( $param )
_fromUrl ( $param, $saveparam = '' )
alreadyValidated ( )
canDefault ( )
detectDependencies ( $params )
detectStupidDuplicates ( array $params, array &$errorparams ) : array Detect duplicate package names with differing versions
download ( ) : PEAR_PackageFile_v1 | PEAR_PackageFile_v2 | PEAR_Error Retrieve any non-local packages
explicitState ( )
fromDepURL ( $dep ) Like {@link initialize()}, but operates on a dependency
getChannel ( )
getDeps ( )
getDownloadURL ( )
getDownloader ( )
getGroup ( )
getPackage ( )
getPackageFile ( )
getPackageType ( )
getPackageXmlVersion ( )
getPackagefileObject ( &$c, $d ) For simpler unit-testing
getParsedPackage ( )
getShortName ( )
getType ( )
getURI ( )
getVersion ( )
initialize ( $param ) : boolean | PEAR_Error Parse the input and determine whether this is a local file, a remote uri, or an abstract package name.
isBundle ( )
isCompatible ( $pf )
isEqual ( $param )
isExtension ( $name )
isInstalled ( $dep, $oper = '==' )
isSubpackage ( &$pf )
mergeDependencies ( &$params )
removeDuplicates ( &$params, $ignoreGroups = false )
removeInstalled ( &$params ) Remove packages to be downloaded that are already installed
setDownloadURL ( $pkg )
setExplicitState ( $s )
setGroup ( $group )
setPackageFile ( PEAR_PackageFile_v1 | PEAR_PackageFile_v2 &$pkg ) Set the package.xml object for this downloaded package
setValidated ( )
willDownload ( $param, $params )

메소드 상세

PEAR_Downloader_Package() 공개 메소드

public PEAR_Downloader_Package ( &$downloader )

_analyzeDownloadURL() 공개 메소드

public _analyzeDownloadURL ( $info, $param, $pname, $params = null, $optional = false, $isdependency = false )

_detect1() 공개 메소드

public _detect1 ( $deps, $pname, $options, $params )

_detect2() 공개 메소드

public _detect2 ( $deps, $pname, $options, $params )

_detect2Dep() 공개 메소드

public _detect2Dep ( $dep, $pname, $group, $params )

_fromFile() 공개 메소드

This will retrieve from a local file if possible, and parse out a group name as well. The original parameter will be modified to reflect this.
public _fromFile ( &$param )

_fromString() 공개 메소드

public _fromString ( $param )

_fromUrl() 공개 메소드

public _fromUrl ( $param, $saveparam = '' )

alreadyValidated() 공개 메소드

public alreadyValidated ( )

canDefault() 공개 메소드

public canDefault ( )

detectDependencies() 공개 메소드

public detectDependencies ( $params )

detectStupidDuplicates() 공개 메소드

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.
public detectStupidDuplicates ( array $params, array &$errorparams ) : array
$params array array of PEAR_Downloader_Package objects
$errorparams array empty array
리턴 array array of stupid duplicated packages in PEAR_Downloader_Package obejcts

download() 공개 메소드

Retrieve any non-local packages
public download ( ) : PEAR_PackageFile_v1 | PEAR_PackageFile_v2 | PEAR_Error
리턴 PEAR_PackageFile_v1 | PEAR_PackageFile_v2 | PEAR_Error

explicitState() 공개 메소드

public explicitState ( )

fromDepURL() 공개 메소드

Like {@link initialize()}, but operates on a dependency
public fromDepURL ( $dep )

getChannel() 공개 메소드

public getChannel ( )

getDeps() 공개 메소드

public getDeps ( )

getDownloadURL() 공개 메소드

public getDownloadURL ( )

getDownloader() 공개 메소드

public getDownloader ( )

getGroup() 공개 메소드

public getGroup ( )

getPackage() 공개 메소드

public getPackage ( )

getPackageFile() 공개 메소드

public getPackageFile ( )

getPackageType() 공개 메소드

public getPackageType ( )

getPackageXmlVersion() 공개 메소드

getPackagefileObject() 공개 메소드

For simpler unit-testing
public getPackagefileObject ( &$c, $d )

getParsedPackage() 공개 메소드

public getParsedPackage ( )

getShortName() 공개 메소드

public getShortName ( )

getType() 공개 메소드

public getType ( )

getURI() 공개 메소드

public getURI ( )

getVersion() 공개 메소드

public getVersion ( )

initialize() 공개 메소드

This is the heart of the PEAR_Downloader_Package(), and is used in {@link PEAR_Downloader::download()}
public initialize ( $param ) : boolean | PEAR_Error
리턴 boolean | PEAR_Error

isBundle() 공개 메소드

public isBundle ( )

isCompatible() 공개 메소드

public isCompatible ( $pf )

isEqual() 공개 메소드

public isEqual ( $param )

isExtension() 공개 메소드

public isExtension ( $name )

isInstalled() 공개 메소드

public isInstalled ( $dep, $oper = '==' )

isSubpackage() 공개 메소드

public isSubpackage ( &$pf )

mergeDependencies() 공개 메소드

public mergeDependencies ( &$params )

removeDuplicates() 공개 메소드

public removeDuplicates ( &$params, $ignoreGroups = false )

removeInstalled() 공개 메소드

Remove packages to be downloaded that are already installed
public removeInstalled ( &$params )

setDownloadURL() 공개 메소드

public setDownloadURL ( $pkg )

setExplicitState() 공개 메소드

public setExplicitState ( $s )

setGroup() 공개 메소드

public setGroup ( $group )

setPackageFile() 공개 메소드

Set the package.xml object for this downloaded package
public setPackageFile ( PEAR_PackageFile_v1 | PEAR_PackageFile_v2 &$pkg )
$pkg PEAR_PackageFile_v1 | PEAR_PackageFile_v2

setValidated() 공개 메소드

public setValidated ( )

willDownload() 공개 메소드

public willDownload ( $param, $params )

프로퍼티 상세

$_analyzed 공개적으로 프로퍼티

public bool $_analyzed
리턴 boolean

$_config 공개적으로 프로퍼티

public PEAR_Config $_config
리턴 PEAR_Config

$_downloadDeps 공개적으로 프로퍼티

public array $_downloadDeps
리턴 array

$_downloadURL 공개적으로 프로퍼티

public array $_downloadURL
리턴 array

$_downloader 공개적으로 프로퍼티

public PEAR_Downloader $_downloader
리턴 PEAR_Downloader

$_explicitGroup 공개적으로 프로퍼티

If this package is invoked with Package#group, this variable will be true
public $_explicitGroup

$_explicitState 공개적으로 프로퍼티

This allows temporary reassignment of preferred_state for a parent package and all of its dependencies.
public string|false $_explicitState
리턴 string | false

$_installRegistry 공개적으로 프로퍼티

Used to implement packagingroot properly
public PEAR_Registry $_installRegistry
리턴 PEAR_Registry

$_packagefile 공개적으로 프로퍼티

public PEAR_PackageFile_v1|PEAR_PackageFile|v2 $_packagefile
리턴 PEAR_PackageFile_v1 | PEAR_PackageFile | v2

$_parsedname 공개적으로 프로퍼티

public array $_parsedname
리턴 array

$_rawpackagefile 공개적으로 프로퍼티

Contents of package.xml, if downloaded from a remote channel
public string|false $_rawpackagefile
리턴 string | false

$_registry 공개적으로 프로퍼티

public PEAR_Registry $_registry
리턴 PEAR_Registry

$_type 공개적으로 프로퍼티

Package type local|url
public string $_type
리턴 string

$_valid 공개적으로 프로퍼티

public bool $_valid
리턴 boolean

$_validated 공개적으로 프로퍼티

public bool $_validated
리턴 boolean