contributing.patches.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <HTML
  2. ><HEAD
  3. ><TITLE
  4. >Submitting Patches</TITLE
  5. ><META
  6. NAME="GENERATOR"
  7. CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
  8. "><LINK
  9. REL="HOME"
  10. TITLE="PEAR Manual"
  11. HREF="index.html"><LINK
  12. REL="UP"
  13. TITLE="Contributing"
  14. HREF="contributing.html"><LINK
  15. REL="PREVIOUS"
  16. TITLE="Writing New Packages"
  17. HREF="contributing.newpackage.html"><LINK
  18. REL="NEXT"
  19. TITLE="Reporting Bugs"
  20. HREF="contributing.bugs.html"><META
  21. HTTP-EQUIV="Content-type"
  22. CONTENT="text/html; charset=ISO-8859-1"></HEAD
  23. ><BODY
  24. CLASS="sect1"
  25. BGCOLOR="#FFFFFF"
  26. TEXT="#000000"
  27. LINK="#0000FF"
  28. VLINK="#840084"
  29. ALINK="#0000FF"
  30. ><DIV
  31. CLASS="NAVHEADER"
  32. ><TABLE
  33. SUMMARY="Header navigation table"
  34. WIDTH="100%"
  35. BORDER="0"
  36. CELLPADDING="0"
  37. CELLSPACING="0"
  38. ><TR
  39. ><TH
  40. COLSPAN="3"
  41. ALIGN="center"
  42. >PEAR Manual</TH
  43. ></TR
  44. ><TR
  45. ><TD
  46. WIDTH="10%"
  47. ALIGN="left"
  48. VALIGN="bottom"
  49. ><A
  50. HREF="contributing.newpackage.html"
  51. ACCESSKEY="P"
  52. >Prev</A
  53. ></TD
  54. ><TD
  55. WIDTH="80%"
  56. ALIGN="center"
  57. VALIGN="bottom"
  58. >Chapter 5. Contributing</TD
  59. ><TD
  60. WIDTH="10%"
  61. ALIGN="right"
  62. VALIGN="bottom"
  63. ><A
  64. HREF="contributing.bugs.html"
  65. ACCESSKEY="N"
  66. >Next</A
  67. ></TD
  68. ></TR
  69. ></TABLE
  70. ><HR
  71. ALIGN="LEFT"
  72. WIDTH="100%"></DIV
  73. ><DIV
  74. CLASS="sect1"
  75. ><H1
  76. CLASS="sect1"
  77. ><A
  78. NAME="contributing.patches">Submitting Patches</H1
  79. ><P
  80. >&#13; If you have modified a package to expand its functionality or to fix a
  81. bug, you should contribute your changes back to the community (some
  82. licenses force you to do so, and it is generally considered immoral not to).
  83. </P
  84. ><P
  85. >&#13; Before creating the patch, you must first obtain the latest sources of the
  86. package you wish to patch from CVS by running the commands (the package
  87. in this example is Foo_Bar):
  88. <TABLE
  89. WIDTH="100%"
  90. CELLSPACING="0"
  91. CELLPADDING="0"
  92. BORDER="0"
  93. BGCOLOR="#EEEEEE"
  94. ><TR
  95. ><TD
  96. ><PRE
  97. CLASS="screen"
  98. ><TT
  99. CLASS="userinput"
  100. ><B
  101. >&#13;cvs -d:pserver:cvsread@cvs.php.net:/repository login
  102. </B
  103. ></TT
  104. >
  105. password is <TT
  106. CLASS="userinput"
  107. ><B
  108. >phpfi</B
  109. ></TT
  110. >
  111. <TT
  112. CLASS="userinput"
  113. ><B
  114. >&#13;cvs -d:pserver:cvsread@cvs.php.net:/repository co pear/Foo_Bar
  115. </B
  116. ></TT
  117. ></PRE
  118. ></TD
  119. ></TR
  120. ></TABLE
  121. >
  122. Now that you have the latest sources, you can edit the relevant file(s).
  123. Make sure that your patch is fully compatible with the PEAR <A
  124. HREF="standards.html"
  125. >coding
  126. standards.</A
  127. >.
  128. </P
  129. ><P
  130. >&#13; After you have finished adding/changing the code, TEST it: We will not
  131. accept code that hasn't been carefully tested.
  132. When you are absolutely sure the new code doesn't introduce bugs, create a
  133. unified diff by running:
  134. <TABLE
  135. WIDTH="100%"
  136. CELLSPACING="0"
  137. CELLPADDING="0"
  138. BORDER="0"
  139. BGCOLOR="#EEEEEE"
  140. ><TR
  141. ><TD
  142. ><PRE
  143. CLASS="screen"
  144. ><TT
  145. CLASS="userinput"
  146. ><B
  147. >cd pear/Foo_Bar</B
  148. ></TT
  149. >
  150. <TT
  151. CLASS="userinput"
  152. ><B
  153. >cvs diff -u &#62;Foo_Bar.diff</B
  154. ></TT
  155. ></PRE
  156. ></TD
  157. ></TR
  158. ></TABLE
  159. >
  160. The resulting .diff file contains your patch. This diff makes it easy
  161. for us to see what has been changed.
  162. </P
  163. ><P
  164. >&#13; Next step is to submit the patch. Send a mail to pear-dev@lists.php.net and
  165. Cc the maintainer(s) of the package. The subject of the mail should be
  166. prefixed with '[Patch]' to make it clear you are submitting a patch. Also
  167. include a verbose explanation of what the patch does.
  168. Don't forget to attach the .diff file to the mail. The maintainers of
  169. the package are usually listed in the header of each source file. Apart
  170. from that their email adresses are available on the package information
  171. page on http://pear.php.net/.
  172. </P
  173. ><DIV
  174. CLASS="note"
  175. ><BLOCKQUOTE
  176. CLASS="note"
  177. ><P
  178. ><B
  179. >Note: </B
  180. >
  181. If you are using Outlook or Outlook Express, please change the file
  182. extension of the diff file to .txt, because Outlook's MIME-Type
  183. detection depends on the file extension and attachments with a
  184. MIME-Type not equal to <TT
  185. CLASS="literal"
  186. >text/plain</TT
  187. > will be rejected
  188. by our mailinglist software.
  189. </P
  190. ></BLOCKQUOTE
  191. ></DIV
  192. ><DIV
  193. CLASS="note"
  194. ><BLOCKQUOTE
  195. CLASS="note"
  196. ><P
  197. ><B
  198. >Note: </B
  199. >
  200. If your patch does break backwards compatibility, the chances are fairly
  201. good that the maintainers won't be happy about it. Thus you should always
  202. try to fix a bug in a way that does not seriously change the public API.
  203. But if there is absolutely no way to keep backwards compatibility and/or
  204. if your patch contains a groundbraking improvement, even API changes are
  205. fine.
  206. </P
  207. ></BLOCKQUOTE
  208. ></DIV
  209. ></DIV
  210. ><DIV
  211. CLASS="NAVFOOTER"
  212. ><HR
  213. ALIGN="LEFT"
  214. WIDTH="100%"><TABLE
  215. SUMMARY="Footer navigation table"
  216. WIDTH="100%"
  217. BORDER="0"
  218. CELLPADDING="0"
  219. CELLSPACING="0"
  220. ><TR
  221. ><TD
  222. WIDTH="33%"
  223. ALIGN="left"
  224. VALIGN="top"
  225. ><A
  226. HREF="contributing.newpackage.html"
  227. ACCESSKEY="P"
  228. >Prev</A
  229. ></TD
  230. ><TD
  231. WIDTH="34%"
  232. ALIGN="center"
  233. VALIGN="top"
  234. ><A
  235. HREF="index.html"
  236. ACCESSKEY="H"
  237. >Home</A
  238. ></TD
  239. ><TD
  240. WIDTH="33%"
  241. ALIGN="right"
  242. VALIGN="top"
  243. ><A
  244. HREF="contributing.bugs.html"
  245. ACCESSKEY="N"
  246. >Next</A
  247. ></TD
  248. ></TR
  249. ><TR
  250. ><TD
  251. WIDTH="33%"
  252. ALIGN="left"
  253. VALIGN="top"
  254. >Writing New Packages</TD
  255. ><TD
  256. WIDTH="34%"
  257. ALIGN="center"
  258. VALIGN="top"
  259. ><A
  260. HREF="contributing.html"
  261. ACCESSKEY="U"
  262. >Up</A
  263. ></TD
  264. ><TD
  265. WIDTH="33%"
  266. ALIGN="right"
  267. VALIGN="top"
  268. >Reporting Bugs</TD
  269. ></TR
  270. ></TABLE
  271. ></DIV
  272. ></BODY
  273. ></HTML
  274. >