pear常用命令

1  pear -V

2  pear help

3  pear list 

4  pear list-all

5  pear list-upgrades 列出需要升级的包

6  升级symfony:

  pear upgrade symfony/symfony-1.4.1 

 

7  phpunit的安装:

  (转自:http://www.phpunit.de/manual/current/en/installation.html)

  PHPUnit should be installed using the PEAR Installer. This installer is the backbone of PEAR, which provides a distribution system for PHP packages, and is shipped with every release of PHP since version 4.3.0.

Note

PHPUnit 3.5 requires PHP 5.2.7 (or later) but PHP 5.3.3 (or later) is highly recommended.

PHP_CodeCoverage, the library that is used by PHPUnit 3.5 to collect and process code coverage information, depends on Xdebug 2.0.5 (or later) but Xdebug 2.1.0 (or later) is highly recommended.

The PEAR channel (pear.phpunit.de) that is used to distribute PHPUnit needs to be registered with the local PEAR environment. Furthermore, a component that PHPUnit depends upon is hosted on the Symfony Components PEAR channel (pear.symfony-project.com).

pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com

This has to be done only once. Now the PEAR Installer can be used to install packages from the PHPUnit channel:

pear install phpunit/PHPUnit

After the installation you can find the PHPUnit source files inside your local PEAR directory; the path is usually/usr/lib/php/PHPUnit.

Although using the PEAR Installer is the only supported way to install PHPUnit, you can install PHPUnit manually. For manual installation, do the following:

  1. Download a release archive from http://pear.phpunit.de/get/ and extract it to a directory that is listed in theinclude_path of your php.ini configuration file.

  2. Prepare the phpunit script:

    1. Rename the phpunit.php script to phpunit.

    2. Replace the @php_bin@ string in it with the path to your PHP command-line interpreter (usually/usr/bin/php).

    3. Copy it to a directory that is in your path and make it executable (chmod +x phpunit).

  3. Prepare the PHPUnit/Util/PHP.php script:

    1. Replace the @php_bin@ string in it with the path to your PHP command-line interpreter (usually/usr/bin/php).

 

8  pear升级(在windows下测试ok): 

    pear upgrade -a PEAR (升级到最新)

    pear upgrade -a PEAR-1.7.1 (指定版本)

 

9  卸载包:

    pear uninstall date 

 

10 安装包:

    A  pear install Date  (适用于没有依赖项的简单包)

    B  pear install -a XML_RSS  (-a选项自动判断并安装所有依赖项,适用于依赖于其他包的复杂包)

 

11  pear命令汇总: 

Commands:

build                  Build an Extension From C Source

bundle                 Unpacks a Pecl Package

channel-add            Add a Channel

channel-alias          Specify an alias to a channel name

channel-delete         Remove a Channel From the List

channel-discover       Initialize a Channel from its server

channel-info           Retrieve Information on a Channel

channel-login          Connects and authenticates to remote channel server

channel-logout         Logs out from the remote channel server

channel-update         Update an Existing Channel

clear-cache            Clear Web Services Cache

config-create          Create a Default configuration file

config-get             Show One Setting

config-help            Show Information About Setting

config-set             Change Setting

config-show            Show All Settings

convert                Convert a package.xml 1.0 to package.xml 2.0 format

cvsdiff                Run a "cvs diff" for all files in a package

cvstag                 Set CVS Release Tag

download               Download Package

download-all           Downloads each available package from the default channel

info                   Display information about a package

install                Install Package

list                   List Installed Packages In The Default Channel

list-all               List All Packages

list-channels          List Available Channels

list-files             List Files In Installed Package

list-upgrades          List Available Upgrades

login                  Connects and authenticates to remote server [Deprecated in favor of channel-login]

logout                 Logs out from the remote server [Deprecated in favor of channel-logout]

makerpm                Builds an RPM spec file from a PEAR package

package                Build Package

package-dependencies   Show package dependencies

package-validate       Validate Package Consistency

pickle                 Build PECL Package

remote-info            Information About Remote Packages

remote-list            List Remote Packages

run-scripts            Run Post-Install Scripts bundled with a package

run-tests              Run Regression Tests

search                 Search remote package database

shell-test             Shell Script Test

sign                   Sign a package distribution file

svntag                 Set SVN Release Tag

uninstall              Un-install Package

update-channels        Update the Channel List

upgrade                Upgrade Package

upgrade-all            Upgrade All Packages [Deprecated in favor of calling upgrade with no parameters]

Usage: pear [options] command [command-options] <parameters>

Type "pear help options" to list all options.

Type "pear help shortcuts" to list all command shortcuts.

Type "pear help <command>" to get the help for the specified command.

 

posted @ 2009-12-10 13:36  rethink  阅读(834)  评论(0编辑  收藏  举报