Use pear to write your next PHP program

Source: Internet
Author: User
Tags pear php and php code

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.

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.