doc/developer/CodingStandard

Author: Max Horváth, Benoit Grégoire, last revision:

Error: Failed to load processor Timestamp
No macro or processor named 'Timestamp' found

PHP Coding standards

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...