How to contribute code for PHP

Source: Internet
Author: User

PHP previously migrated the source code to git management, but also GitHub (HTTPS://GITHUB.COM/PHP/PHP-SRC) on the mirror, so that more developers for PHP to contribute to the code.

Today, to write this article, is to give students in the country, willing to contribute to the open source PHP community students, to do an example, how to contribute to PHP for your wisdom.

Now, suppose you want to contribute a new feature, or simply, you're going to fix a bug for PHP (in general, you can find the bugs that PHP has reported here: Register GitHub

2. Fork PHP source code, in the PHP GitHub page on the top right corner of a fork button, point it

3. After fork, you will have a copy of your own PHP source code warehouse, now you can in this warehouse, modify the PHP source code to fix the bug for it.

4. After you fix it, you submit it to your own PHP warehouse, and then, in the upper-right corner of the GitHub page of your PHP source code warehouse, there will be a pull request button. Dot it.

5. Then, fill in the relevant information and GitHub will send a copy of the pull request email containing your update to the Pull request mail Group in PHP (people do not worry about your English, as long as you can say, we can read, of course, if you really do not want to write in English, It does not matter, write Chinese, I saw will deal with, I can not handle, I will also translate for you.

6. Finally, if PHP's committers think your fix is correct (there are some options to note for the PHP contribution code, I'll stay below). Will merge your pull request to the source code of PHP.

There are a few things you should be aware of when contributing to your PHP source code (common errors):

1. Write only C89 compatible code, for example, do not use single-line annotation (//), the definition of the variable must be before all statements (block start).

2. Variable naming, follow PHP's existing specifications, do not use the hump name.

3. For some very small updates, such as spelling mistakes in the code, or to encourage everyone to submit to the bugs.php.net patch, after all, the merge Pull request sometimes will be more trouble.

More PHP code specifications, see here: Submitting patch



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.