diff options
| author | Stig Bakken <ssb@php.net> | 2002-01-02 17:12:26 +0000 |
|---|---|---|
| committer | Stig Bakken <ssb@php.net> | 2002-01-02 17:12:26 +0000 |
| commit | 7ab86afd3282b3befd126d2353d206ca89461675 (patch) | |
| tree | 4b4fbcaee127b32fbf0713b9740cf4cd1a699909 /pear/PEAR | |
| parent | 4fc3baefd2d141e4487f476ab44c92c32fcfe1d9 (diff) | |
| download | php-git-7ab86afd3282b3befd126d2353d206ca89461675.tar.gz | |
* support "pear-get install XML_RPC"
Diffstat (limited to 'pear/PEAR')
| -rw-r--r-- | pear/PEAR/Installer.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index dab9932190..39fe746a24 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -167,7 +167,7 @@ class PEAR_Installer extends PEAR_Common * @return bool true if successful, false if not */ - function install($pkgfile, $options = array()) + function install($pkgfile, $options = array(), $config = null) { // recognized options: // - register_only : update registry but don't install files @@ -181,6 +181,16 @@ class PEAR_Installer extends PEAR_Common if (preg_match('#^(http|ftp)://#', $pkgfile)) { $need_download = true; } elseif (!@is_file($pkgfile)) { + if (preg_match('/^[A-Z][A-Za-z0-9_]+$/', $pkgfile)) { + // valid package name + if ($config === null) { + $pkgfile = "http://pear.php.net/get/$pkgfile"; + } else { + $pkgfile = "http://" . $config->get('master_server') . + "/get/$pkgfile"; + } + $need_download = true; + } return $this->raiseError("could not open the package file: $pkgfile"); } @@ -328,6 +338,7 @@ class PEAR_Installer extends PEAR_Common } // }}} + // {{{ checkDeps() function checkDeps(&$pkginfo) { @@ -345,6 +356,8 @@ class PEAR_Installer extends PEAR_Common } return false; } + + // }}} } ?>
\ No newline at end of file |
