5 We are
using the following coding convention
10 The classes are structured like that.
11 texts prefixed by
"##" are comments to explain the convention with an example. Do not use them in your code.
14 ## The header below is on every head of php file use current year instead of 2012. ##
38 ## Enter the purpose of this file up there ^^ ##
40 ## the name of the class is the same as the file (m_dom, m_mailman...) ##
44 ## 2 blank lines here and between each functions, give it some space ;) ##
45 ## the following line of -- allow you to visually quickly find a function ##
46 ## then the comment after it is using
54 ## function which consist of more than one word are separated by _ ##
55 ## private functions are prefixed by "private" and their name starts by "_" ##
57 ## use the globals for $db (database mapper), $cuid (uid of current alternc's user) $err (error/log mapper)
58 $err->log(
"mailman",
"enum_ml");
59 ## when calling an important function, log it that way ##
60 ## when raising an error, use the following syntax ##
61 $err->raise(
"classname",_(
"text in english"));
71 function names starting by
"hook_" are hooks called that way:
74 $res=$hooks->invoke(
"hook_class_method_name",array($param1,$param2));
76 $params1 & 2 are sent as parameters to the hooked functions of each files.
78 the hook
function name must have the CALLING
class name after hook_
79 like hook_admin_del_member
for a hook in "admin" class.
81 $res is an array with the returned data as values,
for each
function called in a class.
82 The key in that array is the classname called.