Php what is PEAR? (Article 2) _ PHP Tutorial

Source: Internet
Author: User
Php what is PEAR? (Article 2 ). Deployment Kit introduction PEAR most importantly, it has a lot of libraries available for developers to reference for free. these libraries will be packaged into a package kit, and each package will include a package starter kit introduction
The most important thing about PEAR is that it has many library programs that developers can reference for free. these libraries will be packaged into a package. xml file. this is the PEAR team's rule. This file is based on the file architecture, version number, and other materials of the program library. with this file, after the library is compressed, it can be called a "suite 」, with this xml file, the "suite management commands" provided by PEAR can easily manage the library, for example: you can use commands to install the suite, except the suite, view the suite information, or upgrade the suite.
In addition. in terms of the security of the suite, if a user finds a problem with the suite, they can discuss it through the forum or return it to the development team, so that they can quickly make corrections and revisions, therefore, each suite has a version number to differentiate the revision process.
For details about the content, see the introduction on the official website "Appendix A. PEAR.
Note: Do not be surprised if you find that the results are different from those described in this article, this is because the update speed of the PEAR suite is too fast. the method and intent we introduced will not change, but the process will change with the change of the suite.
How does supervisor learn about the suite?
To download the suite or learn about it, you can go to the official PEAR website (http://pear.php.net)
The circled hyperlink is the location of the placement kit.
The characters in the No. 1 circle that are relatively dark represent the class of the suite. for example, the 1st class is called Authentication ). This class does not currently contain 8 suites, which are used to handle login and logout, identity authentication, and permission settings.
A small number of characters in the circle 2 represents the name of the suite, such as Auth and Auth HTTP. You can click the name of each suite to view more detailed suite information or download the suite.
Up to now, PEAR's suite has a total of 35 categories, more than three hundred suites, and a total of 202 developers, but these figures are continuously increasing. if you will one day, you can also apply to become a developer of the suite if you want to contribute your own strength to a member of the PEAR community.
To use the PEAR Library, follow these steps:
1. set up a Web server, such as Apache, and install PHP and MySOL.
2. some basic suites of PEAR must be installed. The so-called basic suite is required by all PEAR suites. for example, all the basic suites are required by debugging, therefore, the basic kit contains the debugging kit. only the debugging kit is installed first, and other kits can be used for debugging.
3. install a specific suite based on developers' needs. For example, after installing the basic suite. if a developer wants to add the computing execution time function to the webpage, he must use commands to install the Benchmark Suite. This suite is not a basic suite and must be installed by the developer.
4. reference the Library of the suite in the PHP program.
The following describes how to install and manage the PEAR suite in Windows and Unix-like operating systems.
3-2 install and manage PEAR on Windows operating systems
▓ Install Apache + PHP + MySQL
If you have not yet built the PHP execution environment, we recommend that you install the AppServ six-in-one software. The author uses AppServ as the server environment for windows. This software can be downloaded at http://www.appservnetwork.com/official website.
▓ PEAR installation method
After AppServ is installed, you can start to install the basic suite of PEAR on Windows. the installation process can be divided into four steps.
Step 2: go to http; // go-pear.org/website
Please first connect to the http; // go-pear.org/website
Then, after completely copying the text in the webpage, open the notepad in the system's ancillary application, paste the copied text, and store the file in C: AppServ \ www, that is, the location of the root directory of the website. Note that all files must be selected for the archive type. the backup file name must be php and the backup file name must be named by yourself, assume that my custom archive name is pear. php, for example:
If you don't want to worry about it, you can also use web editing software such as Dreamweaver to open a blank PHP file, and then paste the text copied by the http://go-pear.org and archive it.
Step 2: install the basic kit
Open your browser and enter "http; // 127.0.0.1" in the URL bar to copy the go-pear website file. php or "http; // localhost/copy the go-pear website file. php ", the so-called" copy the go-pear website file. php is the file name that just copied and saved the copied text. In this example, it is pear. php, so I enter "http; // 127.0.0.1/pear. php, you can see the online installation of PEAR web page
The first screen is the welcome screen. I will not introduce it much. Follow the NEXT> steps to install
This page is used to set the installation location of the PEAR suite. there is an HTTP proxy column at the top. if the installer needs to connect to the network through the proxy, enter the proxy IP address and port number here. if no proxy is used, this field can be left blank. Next, you can set the installation path for l0. Note that three of the installation paths must be modified. the differences are as follows:
1. Install prefix of item l. change the default c: AppServ into www to c: AppServ into php, because
For the PEAR library I want to install, do not mix it with the webpage of the root object in www.
2. change the default value of Filename of WebFrontend to c: AppServ into www ?pear =index. php. Create a folder named pear in www with the index in the folder. php is a suite management interface generated by the system. this interface will be mentioned later (to prevent subsequent operations from failing, create a folder named pear in C: AppServ prepare www ).
3.change the php.exe path in the 10th item to c: appserv1_php1_php.exe. you must also specify the location of your php.exe file.
You can use the default values for other settings. here I will briefly introduce the meaning of other settings:
● Binaries Direetory of item 1 is to specify the c: AppServ serving php of item 1 as the root object of PEAR, which is represented by the variable $ prefix.
● The PHP code Directory in item 1 is the location of the file after the PEAR suite is installed. In this example, the files downloaded from the PEAR suite will be installed in c: AppServ plugin php connector PEAR.
● If the installed package contains an internal description file, this example will be stored in c: AppServ plugin php javaspear plugin docs.
● 5th if the installed suite contains an example file, this example will be placed in c: AppServ plugin php plugin PEAR Plugin data.
● The 6th items are included in the test file if the installed suite is installed. this example will be placed in c: AppServ plugin php plugin PEAR plugin test.
● The first item is the location where the PEAR cache file is stored. this example will be placed in the c: AppServ sort php sort PEAR sort cache.
● The first item is the life cycle of the Cache file. In this example, the life cycle of the Cache file is 8th seconds, that is, the Cache will be recached after 300 seconds.
In addition, you must note that the viewer of the web page must have the write permission on these paths; otherwise, the installation cannot be performed.
After the configuration item is modified, click the install button on the smallest side to install it.
When the installation progress at the top reaches 100%, congratulations, you have completed the installation of the basic suite. According to my tests in an environment with a download speed of 2 MB using ADSL, the installation is completed in about 2 minutes. if your network connection speed is not high, or the license is interrupted when the installation is halfway through. please refresh the button at the top of the browser or press F5 to reinstall it.
After installation. don't be happy. PEAR has more than three hundred suites. so far, only the basic suite of PEAR has been installed, and no suites have been installed, packages other than basic kits will be installed one by one when developers need to use them.
You may ask, "How do I install other suites? Will it be very troublesome ?」 You can rest assured that this is not troublesome. the installation and management of the suite will be detailed in the next small unit.
After installing the basic kit, you will find a folder named PEAR in c: Appserv plugin php. This folder is the path where the library is placed after the kit is downloaded and decompressed.
For everyone, the docs and tests folders will have good things to learn about PEAR. Some kits contain teaching files. if you install the kits, the teaching files will be placed in the docs folder. Some suites are examples included. after you install the suite, the sample program will appear in the tests folder.
▓ PEAR suite management
After the basic suite is installed, when developers need to use a suite other than the basic suite, they will need to install the suite. if they do not need a suite, they will want to remove it, if the suite version is outdated, you need to upgrade the suite, that is, the developer needs a PEAR suite management system.
There are two ways to install and manage a suite in a Windows operating system: one is to use a Web management interface and the other is to use the "suite command 」. I recommend the latter because the execution speed is fast. However, if you are afraid of instructions, you can use the first method to easily manage the suite.

The most important thing about the deployment kit PEAR is to have a lot of libraries available for developers to reference for free. these libraries will be packaged into a package, and each package will contain a package named pack...

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.