You may already be a veteran of PHP and write a lot of great code. But is it a bit of a struggle if you want to add them to your current project now? Your friend wants to use your code as a module in his project, but you find that you are using a different coding style to adapt to it, or even rewrite it!
Come with me, please. Using the pear Standard to write your PHP program, your program will have more energy, your program and code will be easily integrated with other master code, pear, like CPAN for Perl, will make PHP more energy.
What is Pear
Pear is an abbreviation of the PHP extension and the application library (the PHP Extension and application Repository). It is a PHP extension and application of a code warehouse, simply, pear is the PHP cpan.
Why do you use pear?
PHP is a very good scripting language, concise, efficient, with the release of 4.0, more and more people use it for dynamic web site development, it can be said that PHP has become one of the best Internet development language, especially for those who need to be able to quickly, PHP is the preferred language for Web developers who efficiently develop small and medium sized business applications. But with the growing application of PHP and the lack of uniform standards and effective management of these applications, it is difficult for the PHP community to share each other's code and applications as easily as people in the Perl community, Because PHP lacks a unified code base like CPAN to classify the code modules that govern applications (people familiar with Perl know that Cpan is a huge Perl expansion module warehouse, the written application module can be placed under the appropriate classification directory below CPAN, the other people can easily reuse, Of course, you also need to follow the guidelines when writing application modules. )
For this reason, pear came into being and, starting with 4.04, was distributed along with the PHP core.
What good can pear bring me?
1. As mentioned above, pear manages the Pear application code base according to certain classifications, and your pear code can be organized into the appropriate directory where other people can easily retrieve and share your results.
2.PEAR is not just a code warehouse, it is also a standard, use this standard to write your PHP code, will enhance your program readability, reusability, reduce the chance of error.
3.PEAR builds a framework for you by providing 2 classes, implementing such functions as destructors and error trapping, which you can use to inherit.