Overview
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.