在没有用户提示的情况下安装PHP Pear

是否有一个命令行参数,允许您在没有用户提示的情况下安装PHP Pear?我想自动执行以下执行:

wget http://pear.PHP.net/go-pear.phar
PHP go-pear.phar
pear config-set preferred_state beta
pear channel-discover pear.PHPunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear install --alldeps PHPunit/PHPUnit
rm go-pear.phar

PHP go-pear.phar提示用户输入安装/配置信息.

解决方法:

原来expect做了伎俩.这是我最终得到的:

install-pear.sh

#!/usr/bin/expect
spawn wget -O /tmp/go-pear.phar http://pear.PHP.net/go-pear.phar
expect eof

spawn PHP /tmp/go-pear.phar

expect "1-11, 'all' or Enter to continue:"
send "\r"
expect eof

spawn rm /tmp/go-pear.phar

install-PHPunit.sh

#!/bin/bash
./install-pear.sh
pear config-set preferred_state beta
pear channel-discover pear.PHPunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear install --alldeps PHPunit/PHPUnit

跑步:

sudo apt-get install expect
chmod 744 ./install-pear.sh
chmod 744 ./install-PHPunit.sh
sudo ./install-PHPunit.sh

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...