Ten PHP coding tools to improve development efficiency

Source: Internet
Author: User
Tags php coding tools continuous integration tools
We are often frustrated when we often have to deal with repetitive tasks such as manual code testing and deployment. However, we have been striving to become highly efficient, as stated in the DRY principle. (For more information, see en. wikipedia. orgwikiDon % 27t_repeat_yourself ). So

We are often frustrated when we often have to deal with repetitive tasks such as manual code testing and deployment. However, we have been striving to become efficient, as stated by the DRY principle (TRANSLATOR: DRY = Don't Repeat Yourself, do not Repeat the principle, see: http://en.wikipedia.org/wiki/Don%27t_repeat_yourself ). So

We are often frustrated when we often have to deal with repetitive tasks such as manual code testing and deployment. However, we have been striving to become efficient, as stated by the DRY principle (TRANSLATOR: DRY = Don't Repeat Yourself, do not Repeat the principle, see: http://en.wikipedia.org/wiki/Don%27t_repeat_yourself ). So why not apply such principles to other lifecycles of software development so that they can be efficiently and smoothly completed automatically? This article will introduce you to the 10 PHP development tools that can help you meet that requirement, so that you can spend more time focusing on building better Web pages.

  1. PHPUnit

Testing is a very important part in software development, but many developers only give a small amount of time to test, because the work is indeed time-consuming, boring and error-prone. To solve the preceding problems, automated testing tools allow developers to write a series of test scripts that can be easily executed and executed according to scheduled tasks. These automated testing tools usually provide test reports that detail the results of each test. PHP developers have a very good testing framework PHPUNIT in terms of automatic testing. Based on popular test-driven development methods, such as xUnit and PHPUNIT, developers can use PHP syntax to write test cases, and then run the test using a very simple command line tool. You can even integrate PHPUNIT with some continuous integration tools such as phpUnderControl (http://phpundercontrol.org/), which will be discussed later in this article. If you are not familiar with phpunit, you can view the previous article Use PHPUnit to Implement Unit Testing in Your PHP Development (http://www.phpbuilder.com/columns/Jason_Gilmore052510.php3), detailed how to Use phpunit.

  2. Phing

As WEB development projects become more and more complex, developers are faced with a lot of deployment tasks. These tasks are not just as easy as uploading files to the production server from the developer's machine. For example, to avoid uploading files and templates in the development environment, and to process the permissions and parameter configurations of specified files on the server, such as the user name and password, and how to restore the files as soon as a change error occurs, these problems are frequently encountered by developers. To solve these problems, developers use a dedicated build tool to make the file transfer process more efficient, because it only synchronizes the transferred files. Build tools can also be easily customized based on the deployment environment. If you haven't used the build tool yet, you can look at Phing, (http://phing.info/) which is an Apache Ant-based build tool. It supports all operating systems and can easily be configured using XML syntax. It can be integrated with version control tools such as CVS and SVN, you can even create a PEAR package from your custom library.

  3. GitHub

I have repeatedly mentioned the benefits of using a version control tool. Version Control can bring many benefits to the project, including creating an experiment branch for code, rolling back unwanted changes, and checking which team members have recently changed a file, and monitor the progress through logs. Although there are many open-source version control tools, Git is my favorite. The rise of Git has largely benefited from a GitHub (http://github.com/) website that provides third-party hosting services for developers. GitHub satisfies developers' needs and even provides host-managed services for open-source projects. More than 1 million of hosted applications are now available. GitHub provides valuable services for developers so that they do not have to spend a lot of money or time looking for third-party hosting services.

  4. FirePHP

Many developers are very familiar with FireFox plug-in Firebug, which allows you to easily check the syntax of HTML, CSS, and Javascript on a webpage. With FirePHP (http://www.firephp.org/), you can also use interfaces like FireBug to check PHP syntax errors and selected analysis data. For more information about Firebug and FirePHP, see "Firebug: Add Browser-based Debugging to Your Ajax Development". (http://www.developer.com/lang/jscript/article.php/10939_3879711_2/Firebug-Add-Browser-based-Debugging-to-Your-Ajax-Development.htm ).

  5. XDebug

After using a testing tool like PHPUNIT, you can capture errors after writing the Code. On the other hand, you sometimes need some help tools to help you understand the causes of these problems. Many PHP developers use a good debugging tool, XDebug (http://xdebug.org/), which can help you check the code status and provide tools to track and analyze code performance, view object content and other functions. If you want to familiarize yourself with XDebug, you can view previous articles.

A Sanity-Saving Debugging Solution for Your PHP Development (http://www.phpbuilder.com/columns/Jason_Gilmore051410.php3 ).

  6. PHP extension and application library

Although you may think that your idea is unique and special, you still have a great opportunity to write the code that you are working on. Many other programmers have already compiled it. To help developers overcome such obstacles, PHP developers regularly contribute PHP extensions and application libraries, such as the famous PEAR. PEAR contains 560 packages, providing quick solutions, such as caching, encryption, user verification, and payment processing. You can always find a suitable solution in PEAR.

To help manage PEAR package applications, you can install the PEAR package management tool (http://pear.php.net/manual/en/installation.getting.php), which provides a command line interface to install, upgrade, and delete packages.

  7. PHP_CodeSniffer

As with the editor debate, the debate on the encoding style is more ironic. Even so, the encoding standards promoted by PEAR seem to have gained a place in the PHP community. However, you or your team may still not adopt such standards, this will cause code with different styles.

To avoid code style inconsistencies, you can consider installing PHP_CodeSniffer (http://pear.php.net/package/PHP_CodeSniffer), it is a very good PEAR package, it can analyze PHP programs, JAVASCRIP and CSS files and check which are against the defined code style. Although you can define your own encoding style, the PHP_CodeSniffer encoding style is very convenient.

  8. phpDocumentor

Understanding the code from obscure code comments is a very frustrating task, even if the code was previously written by yourself. Like testing, writing documents is still one of the several tasks developers want to escape. To alleviate this pain, you can consider using

Automatic documentation tools such as phpDocumentor. PhpDocumentor supports simple document rule syntax, which can parse your code and generate friendly documents. To learn more

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.