PEAR: PHP extension and application library

Source: Internet
Author: User
1 PEAR introduction PEAR: PHPExtensionandApplicationRepository, php extension and application library. Pear's mission: to provide reusable components and lead php innovation. Provides PHP code packages and applications. Pear or php code Standard, 1. PEAR introduction
PEAR: PHP Extension and Application Repository, php Extension and Application library. Pear's mission: to provide reusable components and lead php innovation. Provides PHP code packages and applications. Pear or php code standards make php code easy to read and improve reusability.
2. install PEAR
When installing php, pear is installed by default in the bin directory. You can use the version parameter to view the version number.
$ ./pear versionPEAR Version: 1.9.4PHP Version: 5.4.26Zend Engine Version: 2.4.0
Verify that the include pathpear extension of php is installed under include path of php.
$ ./pear config-get php_dir/home/gang/php/lib/php

3. pear parameters
Directly running pear will output its parameters.
$ ./pearCommands:build                  Build an Extension From C Sourcebundle                 Unpacks a Pecl Packagechannel-add            Add a Channelchannel-alias          Specify an alias to a channel namechannel-delete         Remove a Channel From the List...

Common parameters: info view package information install installation package uninstall Package list View locally installed package remote-list View online package
View the config configuration of the upgrade package config-show

View common parameter usage through help
$ ./pear help install

4. install the php package
For example, we want to install the LOG package
$ ./pear install LOG
After running successfully, the Log. php and Log directories are generated under the php/lib directory, and the doc directory contains examples and instructions under the doc/Log directory.
Upgrade LOG package:
./pear upgrade LOG

5. use of the installation package
The Log package we installed above. In the php code of the application, enter require.
 log("Log entry $i");}

6. common php packages
PHPDoc? Document extraction tools
PHPUnit? Unit test framework
DB? Database encapsulation
You can run the following command to view all of them:
$ ./pear remote-list

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.