[ Index ]
 

Code source de GeekLog 1.4.1

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/system/pear/PEAR/ -> Downloader.php (sommaire)

PEAR_Downloader, the PEAR Installer's download utility class PHP versions 4 and 5

Author: Greg Beaver <cellog@php.net>
Author: Stig Bakken <ssb@php.net>
Author: Tomas V. V. Cox <cox@idecnet.com>
Author: Martin Jansen <mj@php.net>
Copyright: 1997-2006 The PHP Group
License: http://www.php.net/license/3_0.txt PHP License 3.0
Version: CVS: $Id: Downloader.php,v 1.99.2.2 2006/06/16 12:35:12 pajoye Exp $
Poids: 1547 lignes (61 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

PEAR_Downloader:: (27 méthodes):
  PEAR_Downloader()
  discover()
  newDownloaderPackage()
  getDependency2Object()
  download()
  analyzeDependencies()
  getDownloadDir()
  setDownloadDir()
  configSet()
  setOptions()
  getOptions()
  getPackagefileObject()
  _getPackageDownloadUrl()
  _getDepPackageDownloadUrl()
  getPackageDownloadUrl()
  getDownloadedPackages()
  _downloadCallback()
  _prependPath()
  pushError()
  getErrorMsgs()
  sortPkgDeps()
  _getDepTreeDP()
  sortPackagesForInstall()
  _dependsOn()
  _checkDepTree()
  _sortInstall()
  downloadHttp()


Classe: PEAR_Downloader  - X-Ref

Administration class used to download anything from the internet (PEAR Packages,
static URLs, xml files)

PEAR_Downloader(&$ui, $options, &$config)   X-Ref

param: PEAR_Frontend_*
param: array
param: PEAR_Config

discover($channel)   X-Ref
Attempt to discover a channel's remote capabilities from
its server name

param: string
return: boolean

newDownloaderPackage(&$t)   X-Ref
For simpler unit-testing

param: PEAR_Downloader
return: PEAR_Downloader_Package

getDependency2Object(&$c, $i, $p, $s)   X-Ref
For simpler unit-testing

param: PEAR_Config
param: array
param: array
param: int

download($params)   X-Ref
Pas de description

analyzeDependencies(&$params)   X-Ref

param: array all packages to be installed

getDownloadDir()   X-Ref
Retrieve the directory that downloads will happen in

return: string

setDownloadDir($dir)   X-Ref
Pas de description

configSet($key, $value, $layer = 'user', $channel = false)   X-Ref
Pas de description

setOptions($options)   X-Ref
Pas de description

getOptions()   X-Ref
Pas de description

getPackagefileObject(&$c, $d, $t = false)   X-Ref
For simpler unit-testing

param: PEAR_Config
param: int
param: string

_getPackageDownloadUrl($parr)   X-Ref

param: array output of {@link parsePackageName()}

_getDepPackageDownloadUrl($dep, $parr)   X-Ref

param: array dependency array

getPackageDownloadUrl($package, $version = null, $channel = false)   X-Ref


getDownloadedPackages()   X-Ref
Retrieve a list of downloaded packages after a call to {@link download()}.

Also resets the list of downloaded packages.
return: array

_downloadCallback($msg, $params = null)   X-Ref
Pas de description

_prependPath($path, $prepend)   X-Ref
Pas de description

pushError($errmsg, $code = -1)   X-Ref

param: string
param: integer

getErrorMsgs()   X-Ref
Pas de description

sortPkgDeps(&$packages, $uninstall = false)   X-Ref
for BC


_getDepTreeDP($package, $packages, &$deps, &$checked)   X-Ref
Pas de description

sortPackagesForInstall(&$packages)   X-Ref
Sort a list of arrays of array(downloaded packagefilename) by dependency.

It also removes duplicate dependencies
param: array an array of downloaded PEAR_Downloader_Packages
return: array array of array(packagefilename, package.xml contents)

_dependsOn($a, $b)   X-Ref
Pas de description

_checkDepTree($channel, $package, $b, $checked = array()   X-Ref
Pas de description

_sortInstall($a, $b)   X-Ref
Pas de description

downloadHttp($url, &$ui, $save_dir = '.', $callback = null, $lastmodified = null,$accept = false)   X-Ref
Download a file through HTTP.  Considers suggested file name in
Content-disposition: header and can run a callback function for
different events.  The callback will be called with two
parameters: the callback type, and parameters.  The implemented
callback types are:

'setup'       called at the very beginning, parameter is a UI object
that should be used for all output
'message'     the parameter is a string with an informational message
'saveas'      may be used to save with a different file name, the
parameter is the filename that is about to be used.
If a 'saveas' callback returns a non-empty string,
that file name will be used as the filename instead.
Note that $save_dir will not be affected by this, only
the basename of the file.
'start'       download is starting, parameter is number of bytes
that are expected, or -1 if unknown
'bytesread'   parameter is the number of bytes read so far
'done'        download is complete, parameter is the total number
of bytes read
'connfailed'  if the TCP/SSL connection fails, this callback is called
with array(host,port,errno,errmsg)
'writefailed' if writing to disk fails, this callback is called
with array(destfile,errmsg)

If an HTTP proxy has been configured (http_proxy PEAR_Config
setting), the proxy will be used.

param: string  $url       the URL to download
param: object  $ui        PEAR_Frontend_* instance
param: object  $config    PEAR_Config instance
param: string  $save_dir  directory to save file in
param: mixed   $callback  function/method to call for status
param: false|string|array $lastmodified header values to check against for caching
param: false|array $accept Accept headers to send
return: string|array  Returns the full path of the downloaded file or a PEAR



Généré le : Wed Nov 21 12:27:40 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics