/* pear的指令 */

◎、列出全部指令
pear

‧命令列視窗,輸入指令
C:>pear

-------------------------------------------------------------------------
Commands:
build 從C原始程式碼建立一個延伸 Build an Extension From C Source
bundle 解開pear套件 Unpacks a Pecl Package
clear-cache 清除XML-RPC快取 Clear XML-RPC Cache
config-get 顯示一個設定 Show One Setting
config-help 顯示設定資訊 Show Information About Setting
config-set 變更設定 Change Setting
config-show 顯示全部設定 Show All Settings
cvsdiff 對一個套件中所有檔案執行"CVS diff" Run a "cvs diff" for all files in a package
cvstag 設定套件版本標記 Set CVS Release Tag
download 下載套件 Download Package
download-all 自master_server下載全部可取得套件 Downloads each available package from master_server
info 顯示一個套件資訊 Display information about a package
install 安裝套件 Install Package
list 列出已安裝套件 List Installed Packages
list-all 列出全部套件 List All Packages
list-upgrades 列出可取得之升級項目 List Available Upgrades
login 連結遠端伺服器並取得驗證 Connects and authenticates to remote server
logout 登出遠端伺服器 Logs out from the remote server
makerpm 由pear套件建立一個RPM spec檔案 Builds an RPM spec file from a PEAR package
package 建立套件 Build Package
package-dependencies 顯示套件相依性 Show package dependencies
package-validate 驗證套件一致性 Validate Package Consistency
remote-info 遠端套件資訊 Information About Remote Packages
remote-list 列出遠端套件 List Remote Packages
run-tests 執行復原測試 Run Regression Tests
search 搜尋遠端套件資料庫 Search remote package database
shell-test Shell腳本語言測試 Shell Script Test
sign 簽入一套件版本檔案 Sign a package distribution file
uninstall 移除套件 Un-install Package
upgrade 昇級套件 Upgrade Package
upgrade-all 昇級所有套件 Upgrade All Packages
以下四行為pear基本使用方法
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.
-------------------------------------------------------------------------

◎、查詢指令資訊
pear help 指令名稱

‧命令列視窗,輸入指令
C:>pear help install

-------------------------------------------------------------------------
pear install [options] <package> ...
Installs one or more PEAR packages. You can specify a package to
install in four ways:

"Package-1.0.tgz" : installs from a local file

"http://example.com/Package-1.0.tgz" : installs from
anywhere on the net.

"package.xml" : installs the package described in
package.xml. Useful for testing, or for wrapping a PEAR package in
another package manager such as RPM.

"Package" : queries your configured server
(pear.php.net) and downloads the newest package with
the preferred quality/state (stable).

More than one package may be specified at once. It is ok to mix these
four ways of specifying packages.

Options:
-f, --force
will overwrite newer installed packages
-n, --nodeps
ignore dependencies, install anyway
-r, --register-only
do not install files, only register the package as installed
-s, --soft
soft install, fail silently, or upgrade if already installed
-B, --nobuild
don't build C extensions
-Z, --nocompress
request uncompressed files when downloading
-R DIR, --installroot=DIR
root directory used when installing files (ala PHP's INSTALL_ROOT)
--ignore-errors
force install even if there were errors
-a, --alldeps
install all required and optional dependencies
-o, --onlyreqdeps
install all required dependencies
-------------------------------------------------------------------------

◎、安裝套件
pear install 套件名稱

‧某些套件需要一並安裝其所有相依套件,必須加上〝-a〞參數,例如 pear install -a 套件名稱,否則會產生錯誤。
‧命令列視窗,輸入指令
C:>pear install HTML_QuickForm

-------------------------------------------------------------------------
downloading HTML_QuickForm-3.2.5.tgz ...
Starting to download HTML_QuickForm-3.2.5.tgz (97,612 bytes)
......................done: 97,612 bytes
requires package `HTML_Common' >= 1.2.1
HTML_QuickForm: Dependencies failed
-------------------------------------------------------------------------
‧出現錯誤

‧命令列視窗,輸入指令加上〝-a〞參數,一並安裝其所有相依套件
C:>pear install -a HTML_QuickForm

-------------------------------------------------------------------------
downloading HTML_QuickForm-3.2.5.tgz ...
Starting to download HTML_QuickForm-3.2.5.tgz (97,612 bytes)
......................done: 97,612 bytes
downloading HTML_Common-1.2.1.tgz ...
Starting to download HTML_Common-1.2.1.tgz (3,637 bytes)
...done: 3,637 bytes
install ok: HTML_Common 1.2.1
install ok: HTML_QuickForm 3.2.5
-------------------------------------------------------------------------
‧相依套件HTML_Common也一併安裝了。

◎、昇級套件
pear upgrade 套件名稱

‧如果目前套件已是最新版本將會提示
‧命令列視窗,輸入指令
C:>pear upgrade HTML_QuickForm

-------------------------------------------------------------------------
Package 'HTML_QuickForm-3.2.5' already installed, skipping
-------------------------------------------------------------------------

◎、移除套件
pear uninstall 套件名稱

‧如果要移除套件有其他套件依付於此套件,則無法移除,將會提示錯誤訊息。
‧命令列視窗,輸入指令
C:>pear uninstall HTML_Common

-------------------------------------------------------------------------
Package 'html_quickform' depends on 'HTML_Common'
uninstall failed
-------------------------------------------------------------------------
‧HTML_QuickForm依附於HTML_Common,所以HTML_Common無法移除。
‧若要強制移除,不管套件依附性,加入〝-n〞參數。
pear uninstall -n 套件名稱

arrow
arrow
    全站熱搜

    yoonow 發表在 痞客邦 留言(0) 人氣()