This is the first phase of the PHP performance optimization series. How to install PEAR in a Windows environment and use the Benchmark tool class as an example to explain how to install the extension class for PEAR.
This is the first phase of the PHP performance optimization series. How to install PEAR in a Windows environment and use the Benchmark tool class as an example to explain how to install the extension class for PEAR.
PEAR is the abbreviation of the PHP Extension and Application Repository. It is a code repository for PHP extensions and applications. In short, PEAR is the CPAN of PHP.
PEAR provides a wide range of PHP extension tools, which are easy to use and can be used in various projects. Benchmark is an extension package of PEAR. It provides three tool classes: Timer, Iterate, and Profiler. It can be used for breakpoint debugging during performance optimization to obtain the code execution time.
Open the source code installed PHP root directory, such as C: \ Program Files \ php5 \ php-5.2.6 \, double-click the go-pear.bat file, the installation process is illustrated as follows
In this way, PEAR is successfully installed. Basically, you only need to press Enter during the installation process, which is very simple.
Visit: http://pear.php.net/search for benchmark
(1) install the Benchmark tool class using the doscommand
Enter the following command
> Pear install Benchmark-1.2.7
For example: C: \ Program Files \ php5 \ php-5.2.6> pear install Benchmark-1.2.7
Directly access the PEAR directory after installation, such as C: \ Program Files \ php5 \ php-5.2.6 \ PEAR
(2) directly download the Benchmark tool File
:
Benchmark:
Directly download and unzip the PEAR directory, such as C: \ Program Files \ php5 \ php-5.2.6 \ PEAR
Here we will only discuss PEAR installation, and use the Benchmark Toolkit as an example to discuss how to use PEAR to download and install the tool package. In the next issue, we will discuss how to use the Benchmark tool to obtain the code execution time and the average function execution time.
What is CPAN?
CPAN is a huge extension module repository of PERL. The application modules written can be placed under the appropriate classification directory under CPAN. Other people can reuse them conveniently. Of course, you also need to follow the rules when writing the application module.
PEAR
PEAR introduction: