Version 2 (modified by benoitg, 15 years ago) |
---|
Author: Max Horváth, Benoit Grégoire, last revision:
PHP Coding standards
- The coding style for the Auth server is the Zend Framework coding standard: http://framework.zend.com/manual/en/coding-standard.html
- Note that the Zend Framework coding standard is mostly a more readable superset of the PEAR coding standard: http://pear.php.net/manual/en/standards.php
Exceptions
- Source files in wifidog use UTF-8 character encoding - not ISO-8859-1 character encoding.
Summary
- use an indent of 4 spaces, with no tabs
- Naming of variables and functions is camelBack
- Naming of classes is CamelBack? with starting capital, and underscore separated path separator:
- Content_TrivialLangstring
- Private and protected members start with an underscore (but private and protected methods do NOT):
- private *_privateMember
- private privateMethod()
- control statements should have one space between the control keyword and opening parenthesis, to distinguish them from function calls
- you are strongly encouraged to always use curly braces even in situations where they are technically optional
- functions should be called with no spaces between the function name, the opening parenthesis, and the first parameter; spaces between commas and each parameter, and no space between the last parameter, the closing parenthesis, and the semicolon
- complete inline documentation comment blocks (docblocks) must be provided
- include the $Id$ CVS keyword in each file. As each file is edited, add this tag if it's not yet present (or replace existing forms such as "Last Modified:", etc.)
C Coding standards
To be written...