Skip to content

Commit

Permalink
* support "pear-get install XML_RPC"
Browse files Browse the repository at this point in the history
  • Loading branch information
stigsb committed Jan 2, 2002
1 parent 4fc3bae commit 7ab86af
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pear/PEAR/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function _installFile($file, $atts, $tmp_path)
* @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
Expand All @@ -181,6 +181,16 @@ function install($pkgfile, $options = array())
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");
}

Expand Down Expand Up @@ -328,6 +338,7 @@ function uninstall($package)
}

// }}}
// {{{ checkDeps()

function checkDeps(&$pkginfo)
{
Expand All @@ -345,6 +356,8 @@ function checkDeps(&$pkginfo)
}
return false;
}

// }}}
}

?>

0 comments on commit 7ab86af

Please sign in to comment.