@@ -42,7 +42,7 @@ Exceptions:
4242
43434. When writing functions that deal with strings, be sure to remember
4444 that PHP holds the length property of each string, and that it
45- shouldn't be calculated with strlen(). Write your functions in a such
45+ shouldn't be calculated with strlen(). Write your functions in such
4646 a way so that they'll take advantage of the length property, both
4747 for efficiency and in order for them to be binary-safe.
4848 Functions that change strings and obtain their new lengths while
@@ -59,8 +59,8 @@ Exceptions:
5959 you're calling.
6060
61617. When commenting out code using a #if statement, do NOT use 0 only. Instead
62- use "<svn username here>_0". For example, #if FOO_0, where FOO is your
63- svn user foo. This allows easier tracking of why code was commented out,
62+ use "<git username here>_0". For example, #if FOO_0, where FOO is your
63+ git user foo. This allows easier tracking of why code was commented out,
6464 especially in bundled libraries.
6565
66668. Do not define functions that are not available. For instance, if a
@@ -82,7 +82,7 @@ Exceptions:
8282 library may need to control or free the memory, or when the memory in
8383 question needs to survive between multiple requests.
8484
85- Naming Conventions
85+ User Functions/Methods Naming Conventions
8686------------------
8787
88881. Function names for user-level functions should be enclosed with in
@@ -151,7 +151,7 @@ Naming Conventions
151151
1521527. Classes should be given descriptive names. Avoid using abbreviations where
153153 possible. Each word in the class name should start with a capital letter,
154- without underscore delimiters (CampelCaps starting with a capital letter).
154+ without underscore delimiters (CamelCaps starting with a capital letter).
155155 The class name should be prefixed with the name of the 'parent set' (e.g.
156156 the name of the extension)::
157157
@@ -163,6 +163,26 @@ Naming Conventions
163163 'foobar'
164164 'foo_bar'
165165
166+ Internal Function Naming Convensions
167+ ----------------------
168+
169+ 1. Functions that are part of the external API should be named
170+ 'php_modulename_function()' to avoid symbol collision. They should be in
171+ lowercase, with words underscore delimited. Exposed API must be defined
172+ in 'php_modulename.h'.
173+
174+ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS);
175+
176+ Unexposed module function should be static and should not be defined in
177+ 'php_modulename.h'.
178+
179+ static int php_session_destroy(TSRMLS_D)
180+
181+ 2. Main module source file must be named 'modulename.c'.
182+
183+ 3. Header file that is used by other sources must be named 'php_modulename.h'.
184+
185+
166186Syntax and indentation
167187----------------------
168188
@@ -181,9 +201,9 @@ Syntax and indentation
181201 of PHP or one of its standard modules, please maintain the K&R
182202 style. This applies to just about everything, starting with
183203 indentation and comment styles and up to function declaration
184- syntax. Also see Indentstyle_ .
204+ syntax. Also see Indentstyle .
185205
186- .. _Indentstyle : http://www.catb.org/~esr/jargon/html/I/indent-style.html
206+ Indentstyle : http://www.catb.org/~esr/jargon/html/I/indent-style.html
187207
1882083. Be generous with whitespace and braces. Keep one empty line between the
189209 variable declaration section and the statements in a block, as well as
@@ -259,7 +279,10 @@ The file labelled 'EXPERIMENTAL' should include the following
259279information::
260280
261281 Any authoring information (known bugs, future directions of the module).
262- Ongoing status notes which may not be appropriate for SVN comments.
282+ Ongoing status notes which may not be appropriate for Git comments.
283+
284+ In general new features should go to PECL or experimental branches until
285+ there are specific reasons for directly adding it to the core distribution.
263286
264287Aliases & Legacy Documentation
265288-----------------------------------
0 commit comments