1
- Submitting Patches to PHP
2
- =========================
1
+ Submitting Enhancements and Patches to PHP
2
+ ==========================================
3
3
4
- This document describes how to submit a patch for PHP. Creating a
5
- patch for PHP is easy!
4
+ This document describes how to submit an enhancement or patch for PHP.
5
+ It's easy!
6
6
7
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.
8
+ build, debug and begin submitting PHP, PECL or PEAR code, tests or
9
+ documentation. Once you've followed this README and had several
10
+ patches accepted, commit privileges are often quickly granted.
11
11
12
12
An excellent article to read first is:
13
13
http://phpadvent.org/2008/less-whining-more-coding-by-elizabeth-smith
14
14
15
15
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.
22
-
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
- [email protected] mail list to discuss changes to the base PHP
27
- code. Use
[email protected] for changes to code that is only
28
- available from PECL (http://pecl.php.net/). Use
[email protected]
29
- for PEAR modules (http://pear.php.net/). Use
[email protected] for
30
- PHP documentation questions. Mail list subscription is explained on
31
- http://www.php.net/mailing-lists.php.
16
+ Online Forums
17
+ -------------
18
+ There are several IRC channels where PHP developers are often
19
+ available to discuss questions. They include #php.pecl, #php.doc and
20
+ #pear on the EFNet network and #php-dev-win on FreeNode.
21
+
22
+
23
+ PHP Patches
24
+ -----------
25
+ If you are fixing broken functionality in PHP C source code first
26
+ create a bug or identify an existing bug at http://bugs.php.net/. A
27
+ bug can be used to track the patch progress and prevent your changes
28
+ getting lost in the PHP mail archives.
29
+
30
+ If your change is large then create a Request For Comment (RFC) page
31
+ on http://wiki.php.net/rfc, discuss it with the extension maintainer,
32
+ and discuss it on the development mail list
[email protected] .
33
+ RFC Wiki accounts can be requested on
34
+ http://wiki.php.net/start?do=register. PHP extension maintainers can
35
+ be found in the EXTENSIONS file in the PHP source. Mail list
36
+ subscription is explained on http://www.php.net/mailing-lists.php.
37
+
38
+ Information on PHP internal C functions is at
39
+ http://www.php.net/internals, though this is considered incomplete.
40
+ Various external resources can be found on the web. A standard
41
+ printed reference is the book "Extending and Embedding PHP" by Sara
42
+ Golemon.
32
43
33
- If a PHP or PECL patch affects user functionality or makes significant
34
- internal changes then create a simple Request For Comment (RFC) page
35
- on http://wiki.php.net/rfc before starting discussion. This RFC can be
36
- used for initial discussion and later for documentation. Wiki accounts
37
- can be requested on http://wiki.php.net/start?do=register
44
+ Attach the patch to the PHP bug and consider sending a notification
45
+ email about the change to
[email protected] . Also CC the
46
+ extension maintainer. Explain what has been changed by your patch.
47
+ Test scripts should be included.
38
48
39
- Online information on PHP internal C functions is at
40
- http://www.php.net/internals, though this is considered
41
- incomplete. Various external resources can be found on the web. A
42
- standard reference is the book "Extending and Embedding PHP" by Sara
43
- Golemon.
49
+ Please make the mail subject prefix "[PATCH]". If attaching a patch,
50
+ ensure it has a file extension of ".txt". This is because only MIME
51
+ attachments of type 'text/*' are accepted.
44
52
45
- Information on contributing to PEAR is available at
46
- http://pear.php.net/manual/en/guide-developers.php
53
+
54
+ PHP Documentation Patches
55
+ -------------------------
56
+ If you are fixing incorrect PHP documentation first create a bug or
57
+ identify an existing bug at http://bugs.php.net/. A bug can be used
58
+ to track the patch progress and prevent your changes getting lost in
59
+ the PHP mail archives.
60
+
61
+ If your change is large, then first discuss it with the mail list
62
+ [email protected] . Subscription is explained on
63
+ http://www.php.net/mailing-lists.php.
47
64
48
65
Information on contributing to PHP documentation is at
49
66
http://php.net/dochowto and http://wiki.php.net/doc/howto
50
67
51
- There are several IRC channels where PHP developers are often
52
- available to discuss questions. They include #php.pecl and #php.doc
53
- on the EFNet network and #php-dev-win on FreeNode.
68
+ Attach the patch to the PHP bug and consider sending a notification
69
+ email about the change to
[email protected] . Explain what has been
70
+ fixed/added/changed by your patch.
71
+
72
+ Please make the mail subject prefix "[PATCH]". Include the bug id(s)
73
+ which can be closed by your patch. If attaching a patch, ensure it
74
+ has a file extension of ".txt". This is because only MIME attachments
75
+ of type 'text/*' are accepted.
76
+
77
+
78
+ PECL Extension Patches: http://pecl.php.net/
79
+ --------------------------------------------
80
+ If you are fixing broken functionality in a PECL extension then create
81
+ a bug or identify an existing bug at http://pecl.php.net/bugs/. A bug
82
+ can be used to track the patch progress and prevent your changes
83
+ getting lost in the PHP mail archives.
84
+
85
+ If your change is large then create a Request For Comment (RFC) page
86
+ on http://wiki.php.net/rfc, discuss it with the extension maintainer,
87
+ and discuss it on the development mail list
[email protected] .
88
+ PECL mail list subscription is explained on
89
+ http://pecl.php.net/support.php. RFC Wiki accounts can be requested
90
+ on http://wiki.php.net/start?do=register
91
+
92
+ Information on PHP internal C functions is at
93
+ http://www.php.net/internals, though this is considered incomplete.
94
+ Various external resources can be found on the web. A standard
95
+ printed reference is the book "Extending and Embedding PHP" by Sara
96
+ Golemon.
97
+
98
+ Update any open bugs and add a link to the source of your patch. Send
99
+ the patch or pointer to the bug to
[email protected] . Also CC
100
+ the extension maintainer. Explain what has been changed by your
101
+ patch. Test scripts should be included.
102
+
103
+ Please make the mail subject prefix "[PATCH] ...". Include the patch
104
+ as an attachment with a file extension of ".txt". This is because
105
+ only MIME attachments of type 'text/*' are accepted.
106
+
107
+
108
+ PEAR Package Patches: http://pear.php.net/
109
+ ------------------------------------------
110
+ Information on contributing to PEAR is available at
111
+ http://pear.php.net/manual/en/developers-newmaint.php and
112
+ http://pear.php.net/manual/en/guide-developers.php
54
113
55
114
56
- How to create your patch
57
- ------------------------
58
- PHP uses Subversion (SVN) for revision control. Read
115
+ How to create your PHP, PHP Documentation or PECL patch
116
+ -------------------------------------------------------
117
+ PHP and PECL use Subversion (SVN) for revision control. Read
59
118
http://www.php.net/svn.php for help on using SVN to get and build PHP
60
- source code. We recommend using a Sparse Directory checkout described
61
- in http://wiki.php.net/vcs/svnfaq. If you are new to SVN, read
119
+ source code. We recommend using a Sparse Directory checkout described
120
+ in http://wiki.php.net/vcs/svnfaq. If you are new to SVN, read
62
121
http://svnbook.red-bean.com.
63
122
64
- Generally we ask that patches work on the current stable PHP
65
- development branch and on "trunk".
123
+ Generally we ask that bug fix patches work on the current stable PHP
124
+ development branches and on "trunk". New PHP features only need to
125
+ work on "trunk".
66
126
67
127
Read CODING_STANDARDS before you start working.
68
128
69
129
After modifying the source see README.TESTING and
70
- http://qa.php.net/write-test.php for how to test. Submitting test
71
- scripts helps us to understand what functionality has changed. It is
130
+ http://qa.php.net/write-test.php for how to test. Submitting test
131
+ scripts helps us to understand what functionality has changed. It is
72
132
important for the stability and maintainability of PHP that tests are
73
133
comprehensive.
74
134
@@ -80,73 +140,43 @@ For ease of review and later troubleshooting, submit individual
80
140
patches for each bug or feature.
81
141
82
142
83
- Checklist for submitting your patch
84
- -----------------------------------
143
+ Checklist for submitting your PHP or PECL code patch
144
+ ----------------------------------------------------
85
145
- Update SVN source just before running your final 'diff' and
86
146
before testing.
147
+ - Add in-line comments and/or have external documentation ready.
148
+ Use only "/* */" style comments, not "//".
149
+ - Create test scripts for use with "make test".
87
150
- Run "make test" to check your patch doesn't break other features.
88
151
- Rebuild PHP with --enable-debug (which will show some kinds of
89
152
memory errors) and check the PHP and web server error logs after
90
- running the PHP tests.
91
- - Rebuild PHP with --enable-maintainer-zts to check your patch compiles
92
- on multi-threaded web servers.
93
- - Create test scripts for use with "make test".
94
- - Add in-line comments and/or have external documentation ready.
153
+ running your PHP tests.
154
+ - Rebuild PHP with --enable-maintainer-zts to check your patch
155
+ compiles on multi-threaded web servers.
95
156
- Review the patch once more just before submitting it.
96
157
97
158
98
- Where to send your patch
99
- ------------------------
100
- If you are patching PHP C source then email the patch to
101
-
102
-
103
- If you patching a PECL extension then send the patch to
104
-
105
-
106
- If you are patching PEAR then send the patch to
107
-
108
-
109
- If you are patching PHP's documentation then send the patch to
110
-
111
-
112
- The mail can be CC'd to the extension maintainer (see EXTENSIONS).
113
-
114
- Please make the subject prefix "[PATCH]", for example "[PATCH] Fix
115
- return value of all array functions"
116
-
117
- Include the patch as an attachment with a file extension of ".txt".
118
- This is because only MIME attachments of type 'text/*' are accepted.
119
-
120
- Explain what has been fixed/added/changed by your patch. Test scripts
121
- should be included in the email.
122
-
123
- Include the bug id(s) which can be closed by your patch.
124
-
125
- Finally, update any open bugs and add a link to the source of your
126
- patch.
127
-
128
-
129
- What happens after you submit your patch
130
- ----------------------------------------
159
+ What happens after submitting your PHP, PHP Documentation or PECL patch
160
+ -----------------------------------------------------------------------
131
161
If your patch is easy to review and obviously has no side-effects,
132
162
it might be committed relatively quickly.
133
163
134
164
Because PHP is a volunteer-driven effort more complex patches will
135
- require patience on your side. If you do not receive feedback in a few
136
- days, consider resubmitting the patch. Before doing this think about
137
- these questions:
165
+ require patience on your side. If you do not receive feedback in a
166
+ few days, consider resubmitting the patch. Before doing this think
167
+ about these questions:
138
168
169
+ - Did I send the patch to the right mail list?
139
170
- Did I review the mail list archives to see if these kind of
140
171
changes had been discussed before?
141
172
- Did I explain my patch clearly?
142
- - Is my patch too hard to review? Because of which factors?
143
- - Are there any unwanted white space changes?
173
+ - Is my patch too hard to review? Because of what factors?
144
174
145
175
146
- What happens when your patch is applied
147
- ---------------------------------------
148
- Your name will be included in the SVN commit log. If your patch
149
- affects end users, a brief description and your name might be added to
150
- the NEWS file.
176
+ What happens when your PHP or PECL patch is applied
177
+ ---------------------------------------------------
178
+ Your name will likely be included in the SVN commit log. If your
179
+ patch affects end users, a brief description and your name might be
180
+ added to the NEWS file.
151
181
152
182
Thank you for patching PHP!
0 commit comments