From: Stig Bakken Date: Wed, 2 Jan 2002 17:12:26 +0000 (+0000) Subject: * support "pear-get install XML_RPC" X-Git-Tag: PRE_ISSET_PATCH~329 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ab86afd3282b3befd126d2353d206ca89461675;p=php * support "pear-get install XML_RPC" --- 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