![]() |
Bearsampp 2026.9.23
|
Public Member Functions | |
| __construct ($ui=null, $options=array(), $config=null) | |
| _checkDepTree ($channel, $package, $b, $checked=array()) | |
| _dependsOn ($a, $b) | |
| _detectDepCycle (&$deplinks) | |
| _downloadCallback ($msg, $params=null) | |
| _getDepPackageDownloadUrl ($dep, $parr) | |
| _getPackageDownloadUrl ($parr) | |
| _prependPath ($path, $prepend) | |
| _setupGraph ($t, $reg, &$deplinks, &$nodes, $package) | |
| _sortInstall ($a, $b) | |
| _testCycle ($test, $deplinks, $dep) | |
| analyzeDependencies (&$params, $force=false) | |
| configSet ($key, $value, $layer='user', $channel=false) | |
| discover ($channel) | |
| & | download ($params) |
| & | getDependency2Object (&$c, $i, $p, $s) |
| getDownloadDir () | |
| getDownloadedPackages () | |
| getErrorMsgs () | |
| getOptions () | |
| getPackageDownloadUrl ($package, $version=null, $channel=false) | |
| newDownloaderPackage (&$t) | |
| pushError ($errmsg, $code=-1) | |
| setDownloadDir ($dir) | |
| setOptions ($options) | |
| sortPackagesForInstall (&$packages) | |
| sortPkgDeps (&$packages, $uninstall=false) | |
| Public Member Functions inherited from PEAR_Common | |
| __construct () | |
| _PEAR_Common () | |
| _postProcessChecks ($pf) | |
| _postProcessValidPackagexml (&$pf) | |
| buildProvidesArray ($srcinfo) | |
| detectDependencies ($any, $status_callback=null) | |
| downloadHttp ( $url, &$ui, $save_dir='.', $callback=null, $lastmodified=null, $accept=false, $channel=false) | |
| infoFromAny ($info) | |
| infoFromDescriptionFile ($descfile) | |
| infoFromString ($data) | |
| infoFromTgzFile ($file) | |
| log ($level, $msg, $append_crlf=true) | |
| mkDirHier ($dir) | |
| mkTempDir ($tmpdir='') | |
| setFrontendObject (&$ui) | |
| validatePackageInfo ($info, &$errors, &$warnings, $dir_prefix='') | |
| validPackageName ($name) | |
| validPackageVersion ($ver) | |
| xmlFromInfo ($pkginfo) | |
| Public Member Functions inherited from PEAR | |
| __call ($method, $arguments) | |
| __construct ($error_class=null) | |
| _checkDelExpect ($error_code) | |
| _PEAR () | |
| delExpect ($error_code) | |
| expectError ($code=' *') | |
| PEAR ($error_class=null) | |
| popExpect () | |
Static Public Member Functions | |
| static | _downloadHttp ( $object, $url, &$ui, $save_dir='.', $callback=null, $lastmodified=null, $accept=false, $channel=false) |
| Static Public Member Functions inherited from PEAR_Common | |
| static | addTempFile ($file) |
| static | analyzeSourceCode ($file) |
| static | betterStates ($state, $include=false) |
| static | getDependencyRelations () |
| static | getDependencyTypes () |
| static | getFileRoles () |
| static | getProvideTypes () |
| static | getReleaseStates () |
| static | getReplacementTypes () |
| static | getScriptPhases () |
| static | getUserRoles () |
| static | isIncludeable ($path) |
| Static Public Member Functions inherited from PEAR | |
| static | __callStatic ($method, $arguments) |
| static | getSourceDateEpoch () |
| static & | getStaticProperty ($class, $var) |
| static | isError ($data, $code=null) |
| static | loadExtension ($ext) |
| static | registerShutdownFunc ($func, $args=array()) |
| static | staticPopErrorHandling () |
| static | staticPushErrorHandling ($mode, $options=null) |
Data Fields | |
| $_downloadDir | |
| $_downloadedPackages = array() | |
| $_errorStack = array() | |
| $_installed = array() | |
| $_internalDownload = false | |
| $_options | |
| $_packageSortTree | |
| $_preferredState | |
| $_registry | |
| $_toDownload = array() | |
| Data Fields inherited from PEAR_Common | |
| $_validPackageFile | |
| $config = null | |
| $current_attributes = array() | |
| $current_element | |
| $current_path = null | |
| $element_stack = array() | |
| $pkginfo = array() | |
| $ui = null | |
| Data Fields inherited from PEAR | |
| $_debug = false | |
| $_default_error_handler = '' | |
| $_default_error_mode = null | |
| $_default_error_options = null | |
| $_error_class = 'PEAR_Error' | |
| $_expected_errors = array() | |
Static Protected Attributes | |
| static | $bivalentMethods |
| Static Protected Attributes inherited from PEAR | |
| static | $bivalentMethods |
Additional Inherited Members | |
| Static Protected Member Functions inherited from PEAR | |
| static | _popErrorHandling ($object) |
| static | _pushErrorHandling ($object, $mode, $options=null) |
| static | _raiseError ($object, $message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false) |
| static | _setErrorHandling ( $object, $mode=null, $options=null) |
| static | _throwError ($object, $message=null, $code=null, $userinfo=null) |
Definition at line 46 of file Downloader.php.
| __construct | ( | $ui = null, | |
| $options = array(), | |||
| $config = null ) |
| PEAR_Frontend_* | |
| array | |
| PEAR_Config |
Definition at line 162 of file Downloader.php.
References PEAR_Common\$config, $options, and PEAR_Common\$ui.
| _checkDepTree | ( | $channel, | |
| $package, | |||
| $b, | |||
| $checked = array() ) |
Definition at line 1464 of file Downloader.php.
References _checkDepTree().
Referenced by _checkDepTree(), and _dependsOn().
| _dependsOn | ( | $a, | |
| $b ) |
Definition at line 1459 of file Downloader.php.
References _checkDepTree().
Referenced by _sortInstall().
| _detectDepCycle | ( | & | $deplinks | ) |
Detect recursive links between dependencies and break the cycles
| array | @access private |
Definition at line 1374 of file Downloader.php.
References _testCycle().
Referenced by sortPackagesForInstall().
| _downloadCallback | ( | $msg, | |
| $params = null ) |
Definition at line 1122 of file Downloader.php.
References PEAR_Common\log().
|
static |
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.
| string | $url | the URL to download |
| object | $ui | PEAR_Frontend_* instance |
| object | $config | PEAR_Config instance |
| string | $save_dir | directory to save file in |
| mixed | $callback | function/method to call for status updates |
| false | string | array | $lastmodified | header values to check against for caching use false to return the header values from this download |
| false | array | $accept | Accept headers to send |
| false | string | $channel | Channel to use for retrieving authentication |
@access public
Definition at line 1558 of file Downloader.php.
References PEAR_Common\$config, $port, PEAR_Common\$ui, and PEAR\isError().
Referenced by PEAR_Common\downloadHttp().
| _getDepPackageDownloadUrl | ( | $dep, | |
| $parr ) |
| array | dependency array @access private |
Definition at line 947 of file Downloader.php.
References configSet(), discover(), PEAR\isError(), PEAR_Common\log(), newDownloaderPackage(), PEAR_ERROR_RETURN, PEAR_PackageFile_v2\setRawChannel(), PEAR\staticPopErrorHandling(), and PEAR\staticPushErrorHandling().
| _getPackageDownloadUrl | ( | $parr | ) |
| array | output of parsePackageName() @access private |
Definition at line 811 of file Downloader.php.
References configSet(), PEAR\isError(), PEAR_ERROR_RETURN, PEAR_PackageFile_v2\setRawChannel(), PEAR\staticPopErrorHandling(), and PEAR\staticPushErrorHandling().
| _prependPath | ( | $path, | |
| $prepend ) |
Definition at line 1154 of file Downloader.php.
Referenced by PEAR_Installer\_compileSourceFiles(), PEAR_Installer\_installFile(), PEAR_Installer\_installFile2(), PEAR_Installer\commitFileTransaction(), download(), and PEAR_Installer\install().
| _setupGraph | ( | $t, | |
| $reg, | |||
| & | $deplinks, | ||
| & | $nodes, | ||
| $package ) |
Set up the dependency for installation parsing
| array | $t | dependency information |
| PEAR_Registry | $reg | |
| array | $deplinks | list of dependency links already established |
| array | $nodes | all existing package nodes |
| string | $package | parent package name @access private |
Definition at line 1440 of file Downloader.php.
Referenced by sortPackagesForInstall().
| _sortInstall | ( | $a, | |
| $b ) |
Definition at line 1487 of file Downloader.php.
References _dependsOn().
| _testCycle | ( | $test, | |
| $deplinks, | |||
| $dep ) |
Definition at line 1396 of file Downloader.php.
References _testCycle().
Referenced by _detectDepCycle(), and _testCycle().
| analyzeDependencies | ( | & | $params, |
| $force = false ) |
| array | all packages to be installed |
Definition at line 516 of file Downloader.php.
References getDependency2Object(), getOptions(), PEAR\isError(), PEAR_Common\log(), PEAR_ERROR_RETURN, PEAR_VALIDATE_DOWNLOADING, PEAR_Downloader_Package\removeDuplicates(), and PEAR\staticPushErrorHandling().
Referenced by download(), and PEAR_Installer\setDownloadedPackages().
| configSet | ( | $key, | |
| $value, | |||
| $layer = 'user', | |||
| $channel = false ) |
Definition at line 786 of file Downloader.php.
Referenced by PEAR_Installer\_compileSourceFiles(), _getDepPackageDownloadUrl(), _getPackageDownloadUrl(), PEAR_Installer\install(), and PEAR_Installer\uninstall().
| discover | ( | $channel | ) |
Attempt to discover a channel's remote capabilities from its server name
| string |
Definition at line 201 of file Downloader.php.
References PEAR_Common\downloadHttp(), PEAR\isError(), PEAR_Common\log(), and PEAR_ERROR_RETURN.
Referenced by _getDepPackageDownloadUrl().
| & download | ( | $params | ) |
Definition at line 281 of file Downloader.php.
References _prependPath(), analyzeDependencies(), PEAR_Downloader_Package\detectStupidDuplicates(), PEAR_Common\downloadHttp(), getDownloadDir(), PEAR\isError(), PEAR_Common\log(), PEAR_Downloader_Package\mergeDependencies(), newDownloaderPackage(), PEAR_ERROR_RETURN, PEAR_INSTALLER_FAILED, PEAR_INSTALLER_SKIPPED, PEAR_RUNTYPE, pushError(), PEAR_Downloader_Package\removeDuplicates(), PEAR_Downloader_Package\removeInstalled(), PEAR\staticPopErrorHandling(), and PEAR\staticPushErrorHandling().
| & getDependency2Object | ( | & | $c, |
| $i, | |||
| $p, | |||
| $s ) |
For simpler unit-testing
| PEAR_Config | |
| array | |
| array | |
| int |
Definition at line 272 of file Downloader.php.
Referenced by analyzeDependencies().
| getDownloadDir | ( | ) |
Retrieve the directory that downloads will happen in @access private
Definition at line 738 of file Downloader.php.
References PEAR\isError(), and PEAR_Common\log().
Referenced by download().
| getDownloadedPackages | ( | ) |
Retrieve a list of downloaded packages after a call to download().
Also resets the list of downloaded packages.
Definition at line 1114 of file Downloader.php.
| getErrorMsgs | ( | ) |
Definition at line 1180 of file Downloader.php.
| getOptions | ( | ) |
Definition at line 801 of file Downloader.php.
Referenced by analyzeDependencies().
| getPackageDownloadUrl | ( | $package, | |
| $version = null, | |||
| $channel = false ) |
Definition at line 1088 of file Downloader.php.
References PEAR\isError().
| newDownloaderPackage | ( | & | $t | ) |
For simpler unit-testing
| PEAR_Downloader |
Definition at line 256 of file Downloader.php.
Referenced by _getDepPackageDownloadUrl(), and download().
| pushError | ( | $errmsg, | |
| $code = -1 ) |
| string | |
| integer |
Definition at line 1175 of file Downloader.php.
Referenced by download().
| setDownloadDir | ( | $dir | ) |
Definition at line 774 of file Downloader.php.
References PEAR\isError().
| setOptions | ( | $options | ) |
Reimplemented in PEAR_Installer.
Definition at line 796 of file Downloader.php.
References $options.
| sortPackagesForInstall | ( | & | $packages | ) |
Sort a list of arrays of array(downloaded packagefilename) by dependency.
This uses the topological sort method from graph theory, and the Structures_Graph package to properly sort dependencies for installation.
| array | an array of downloaded PEAR_Downloader_Packages |
Definition at line 1211 of file Downloader.php.
References _detectDepCycle(), _setupGraph(), Structures_Graph_Node\setData(), and Structures_Graph_Manipulator_TopologicalSorter\sort().
Referenced by sortPkgDeps().
| sortPkgDeps | ( | & | $packages, |
| $uninstall = false ) |
for BC
Definition at line 1196 of file Downloader.php.
References sortPackagesForInstall().
| $_downloadDir |
Definition at line 142 of file Downloader.php.
| $_downloadedPackages = array() |
Definition at line 90 of file Downloader.php.
| $_errorStack = array() |
Definition at line 123 of file Downloader.php.
| $_installed = array() |
Definition at line 117 of file Downloader.php.
| $_internalDownload = false |
Definition at line 129 of file Downloader.php.
| $_options |
Definition at line 75 of file Downloader.php.
| $_packageSortTree |
Definition at line 136 of file Downloader.php.
| $_preferredState |
Definition at line 59 of file Downloader.php.
| $_registry |
Definition at line 52 of file Downloader.php.
Referenced by PEAR_Installer\install().
| $_toDownload = array() |
Definition at line 106 of file Downloader.php.
|
staticprotected |
Definition at line 148 of file Downloader.php.