cvs: php4 / CODING_STANDARDS
| From: | Sterling Hughes | Date: | Sun, 10 Sep 2000 21:07:18 +0000 |
| Subject: | cvs: php4 / CODING_STANDARDS | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1686@lists.php.net to get a copy of this message | ||
sterling Sun Sep 10 14:07:18 2000 EDT
Modified files:
/php4 CODING_STANDARDS
Log:
php4ize a bit.
fix a little bit of grammar.
Index: php4/CODING_STANDARDS
diff -u php4/CODING_STANDARDS:1.1.1.1 php4/CODING_STANDARDS:1.2
--- php4/CODING_STANDARDS:1.1.1.1 Wed Apr 7 14:00:23 1999
+++ php4/CODING_STANDARDS Sun Sep 10 14:07:18 2000
@@ -43,9 +43,9 @@
for efficiency and in order for them to be binary-safe.
Functions that change strings and obtain their new lengths while
doing so, should return that new length, so it doesn't have to be
- recalculated with strlen() (e.g. _php3_addslashes())
+ recalculated with strlen() (e.g. php_addslashes())
-[5] Use php3_error() to report any errors/warnings during code execution.
+[5] Use php_error() to report any errors/warnings during code execution.
Use descriptive error messages, and try to avoid using identical
error strings for different stages of an error. For example,
if in order to obtain a URL you have to parse the URL, connect,
@@ -63,12 +63,11 @@
Naming Conventions
------------------
-[1] Function names for user functions implementation should be prefixed with
- "php3_", and followed by a word or an underscore-delimited list of words,
- in lowercase letters, that describes the function.
+[1] Function names for user functions should be enclosed with in
+ the PHP_FUNCTION() macro.
-[2] Function names used by user functions implementations should be prefixed
- with "_php3_", and followed by a word or an underscore-delimited list of
+[2] Function names used by user functions should be prefixed
+ with "_php_", and followed by a word or an underscore-delimited list of
words, in lowercase letters, that describes the function. If applicable,
they should be declared 'static'.
@@ -80,7 +79,6 @@
between words.
-
Syntax and indentation
----------------------
@@ -123,7 +121,8 @@
/* {{{ proto int abs(int number)
Return the absolute value of the number */
-void php3_abs(INTERNAL_FUNCTION_PARAMETERS) {
+PHP_FUNCTION(abs)
+{
...
}
/* }}} */