Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 137 lines (101 sloc) 5.138 kB
ea1608e Sigh. Fix grammar of title
Christopher Jones authored
1 Submitting Patches to PHP
2 =========================
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
3
09205f9 Update and fix grammar
Christopher Jones authored
4 This document describes how to submit a patch for PHP. Creating a
5 patch for PHP is easy!
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
6
95af340 Mention account access so we can refer account-requestors to this README
Christopher Jones authored
7 You don't need any login accounts or special access to download,
8 build, debug and begin submitting PHP code, tests or documentation for
9 inclusion in PHP. Once you've followed this README and had several
10 patches accepted, PHP commit privileges are often quickly granted.
11
afb5209 Add auroraeos's article URL. Add IRC channels
Christopher Jones authored
12 An excellent article to read first is:
13 http://phpadvent.org/2008/less-whining-more-coding-by-elizabeth-smith
14
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
15
09205f9 Update and fix grammar
Christopher Jones authored
16 Prework
17 -------
18 If you are fixing broken functionality then create a bug or identify
19 an existing bug at http://bugs.php.net/. This can be used to track
20 the patch progress and prevent your changes getting lost in the PHP
21 mail archives.
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
22
ea0105a Add pecl mail list
Christopher Jones authored
23 If your code change is large then first discuss it with the extension
24 maintainer and/or a development mail list. Extension maintainers can
25 be found in the EXTENSIONS file in the PHP source. Use the
26 internals@lists.php.net mail list to discuss changes to the base PHP
27 code. Use pecl-dev@lists.php.net for changes to code that is only
28 available from PECL (http://pecl.php.net/). Use pear-dev@lists.php.net
29 for PEAR modules (http://pear.php.net/). Mail list subscription is
30 explained on http://www.php.net/mailing-lists.php.
31
32 If a PHP or PECL patch affects user-functionality or makes significant
33 internal changes then create a simple RFC on http://wiki.php.net/rfc
34 before starting discussion. This RFC can be used for initial
35 discussion and later for documentation. Wiki accounts can be requested
36 on http://wiki.php.net/start?do=register
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
37
afb5209 Add auroraeos's article URL. Add IRC channels
Christopher Jones authored
38 There are several IRC channels where PHP developers are often
39 available to discuss questions. They include #php.pecl on the EFNet
40 network and #php-dev-win on FreeNode.
41
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
42
09205f9 Update and fix grammar
Christopher Jones authored
43 How to create your patch
44 ------------------------
45 PHP uses Subversion (SVN) for revision control. Read
46 http://www.php.net/svn.php for help on using SVN to get and build PHP
47 source code. We recommend using a Sparse Directory checkout described
48 in http://wiki.php.net/vcs/svnfaq. If you are new to SVN, read
49 http://svnbook.red-bean.com.
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
50
09205f9 Update and fix grammar
Christopher Jones authored
51 Generally we ask that patches work on the current stable PHP
52 development branch and on "trunk".
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
53
09205f9 Update and fix grammar
Christopher Jones authored
54 Read CODING_STANDARDS before you start working.
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
55
09205f9 Update and fix grammar
Christopher Jones authored
56 After modifying the source see README.TESTING and
ea0105a Add pecl mail list
Christopher Jones authored
57 http://qa.php.net/write-test.php for how to test. Submitting test
58 scripts helps us to understand what functionality has changed. It is
59 important for the stability and maintainability of PHP that tests are
60 comprehensive.
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
61
ea0105a Add pecl mail list
Christopher Jones authored
62 After testing is finished, create a patch file using the command:
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
63
09205f9 Update and fix grammar
Christopher Jones authored
64 svn diff > your_patch.txt
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
65
09205f9 Update and fix grammar
Christopher Jones authored
66 For ease of review and later troubleshooting, submit individual
67 patches for each bug or feature.
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
68
69
09205f9 Update and fix grammar
Christopher Jones authored
70 Checklist for submitting your patch
71 -----------------------------------
ea0105a Add pecl mail list
Christopher Jones authored
72 - Update SVN source just before running your final 'diff' and
73 before testing.
09205f9 Update and fix grammar
Christopher Jones authored
74 - Run "make test" to check your patch doesn't break other features.
75 - Rebuild PHP with --enable-debug (which will show some kinds of
76 memory errors) and check the PHP and web server error logs after
77 running the PHP tests.
78 - Rebuild PHP with --enable-maintainer-zts to check your patch compiles
79 on multi-threaded web servers.
80 - Create test scripts for use with "make test".
81 - Add in-line comments and/or have external documentation ready.
82 - Review the patch once more just before submitting it.
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
83
87e3b97 Add a note about the mime-type
Melvyn Sopacua authored
84
09205f9 Update and fix grammar
Christopher Jones authored
85 Where to send your patch
86 ------------------------
ea0105a Add pecl mail list
Christopher Jones authored
87 If you are patching PHP C source then email the patch to
88 internals@lists.php.net
89
90 If you patching a PECL extension then send the patch to
91 pecl-dev@lists.php.net
92
93 If you are patching PEAR then send the patch to
94 pear-dev@lists.php.net
87e3b97 Add a note about the mime-type
Melvyn Sopacua authored
95
ea0105a Add pecl mail list
Christopher Jones authored
96 The mail can be CC'd to the extension maintainer (see EXTENSIONS).
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
97
ea0105a Add pecl mail list
Christopher Jones authored
98 Please make the subject prefix "[PATCH]".
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
99
ea0105a Add pecl mail list
Christopher Jones authored
100 Include the patch as an attachment. Note: only MIME attachments of
101 type 'text/*' are accepted. The easiest way to accomplish this is to
102 make the file extension '.txt'.
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
103
09205f9 Update and fix grammar
Christopher Jones authored
104 Explain what has been fixed/added/changed by your patch. Test scripts
105 should be included in the email.
106
107 Include the bug id(s) which can be closed by your patch.
108
ea0105a Add pecl mail list
Christopher Jones authored
109 Finally, update any open bugs and add a link to the source of your
110 patch.
0459ad7 some typo fixing, and following The Little Book, omitting needless words
Sascha Schumann authored
111
112
09205f9 Update and fix grammar
Christopher Jones authored
113 What happens after you submit your patch
114 ----------------------------------------
115 If your patch is easy to review and obviously has no side-effects,
116 it might be committed relatively quickly.
117
118 Because PHP is a volunteer-driven effort more complex patches will
119 require patience on your side. If you do not receive feedback in a few
120 days, consider resubmitting the patch. Before doing this think about
0459ad7 some typo fixing, and following The Little Book, omitting needless words
Sascha Schumann authored
121 these questions:
122
09205f9 Update and fix grammar
Christopher Jones authored
123 - Did I review the mail list archives to see if these kind of
124 changes had been discussed before?
125 - Did I explain my patch clearly?
126 - Is my patch too hard to review? Because of which factors?
127 - Are there any unwanted white space changes?
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
128
129
09205f9 Update and fix grammar
Christopher Jones authored
130 What happens when your patch is applied
131 ---------------------------------------
9421ad5 @rlerdorf cvs->svn
rlerdorf authored
132 Your name will be included together with your email address in the SVN
09205f9 Update and fix grammar
Christopher Jones authored
133 commit log. If your patch affects end users, a brief description
0459ad7 some typo fixing, and following The Little Book, omitting needless words
Sascha Schumann authored
134 and your name might be added to the NEWS file.
69d6f1e Added README.SUBMITTING_PATCH file. Please fix/add/change.
Yasuo Ohgaki authored
135
09205f9 Update and fix grammar
Christopher Jones authored
136 Thank you for patching PHP!
Something went wrong with that request. Please try again.