Home  >  Article  >  Backend Development  >  How to contribute code to PHP_PHP Tutorial

How to contribute code to PHP_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:50:29713browse

PHP previously migrated the source code to git for management, and also made a mirror on github (https://github.com/php/php-src). This will facilitate more development. Those who contribute code for PHP.
I am writing this article today to give students in China who are willing to contribute to the PHP open source community an example of how to contribute your wisdom to PHP.
Now, suppose you want to contribute a new feature to wiki. In addition to the following steps, you also need to submit an RFC on wiki.php.net. I will introduce this later. Let us keep it simple for now. Suppose You just want to fix a bug for PHP (generally speaking, you can find reported bugs in PHP here: PHP Bugs). Now assume that you have figured out how to fix this bug.
1. First, you need to have a github account. If not, register here: Register github.
2. Fork the source code of PHP. There is a fork button in the upper right corner of the PHP Github page, click it
3. After Fork, you will have your own PHP source code repository. Now you can modify the PHP source code in this repository to fix bugs for it.
There is nothing to say about specific development, but if you have questions about the use of Git, you can refer to the Git manual, such as this: ProGit
I will provide you with a simple explanation here. If you start development on Github, there will be an explanation on your own PHP code repository page, such as on my PHP repository page https://github.com/laruence /php-src:
ssh git@github.com:laruence/php-src.git
Then, I executed on the local development environment:
$git clone git@github.com:laruence/php-src.git
Then, you will get a php-src directory, go in and develop,
4. After you complete the repair, you submit it to your own PHP repository. Then, in the upper right corner of the Github page of your PHP source code repository, there will be a pull request button. Click it.
When submitting, please pay attention to the format of your submission description. First of all, the first line should be a short description (up to 79 characters) explaining what changes you have made. If you cannot finish the sentence, insert a blank line and enter A long explanation (see New Commit Message Format):
n
n

n
If you are fixing a bug listed on bugs.php.net, your brief description should look like this:
1 Fixed Bug #bug number (Bug description)
5. Then, fill in the relevant information, and Github will send a Pull Request email containing your update to the PHP pull request email group (you don’t have to worry about your English, as long as you can speak it, we can understand it) , of course, if you really don’t want to write in English, it doesn’t matter. Just write in Chinese. I will deal with it when I see it. If I can’t handle it, I will also translate it for you).
6. Finally, if the PHP Committers think your fix is ​​correct (there are some options to pay attention to when contributing code to PHP, I leave them below). Your Pull Request will be merged into the PHP source code.
Now, assuming that what you want to submit is an update (adding new functions, adding new syntax), then when you submit the Pull Request, you also need to send an email to the internals@lists.php.net mailing group to explain Why do you want to submit this update? Let people in this mailing group discuss it and help you improve your ideas.
Finally, after you have contributed some updates to PHP (updates accepted by the Committer), then you can try to apply for your own PHP Developer account on: Register Svn Accout.
Appendix:
There are a few things to note when contributing source code to PHP (frequently asked questions):
1. Only write C89-compatible code. For example, do not use single-line comments (//). The definition of variables must be before all statements (the beginning of the block)..
2. When naming variables, follow the existing specifications of PHP and do not use camel case naming.
3. For some very small updates, such as spelling errors in the code, everyone is still encouraged to submit a patch on bugs.php.net. After all, Merge Pull Request can sometimes be more troublesome.

Excerpted from laruence

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478258.htmlTechArticlePHP previously migrated the source code to git for management, and also managed it on github (https://github.com /php/php-src), this will make it easier for more developers to contribute code to PHP...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn