From 8acb48e91f543bcf573e5a3bd170bcda386fb781 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Sun, 26 Aug 2012 10:01:39 +0000 Subject: [PATCH] removing french readme (...) too old, updating the english one a little, starting a small code convention doc --- .gitattributes | 1 + CODING_CONVENTION.php | 83 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 CODING_CONVENTION.php diff --git a/.gitattributes b/.gitattributes index 4f9a20c3..d050d06f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,7 @@ * text=auto !eol /.svnignore -text .tx/config -text +/CODING_CONVENTION.php -text /COPYING -text /README -text aide/bin/build.sh -text diff --git a/CODING_CONVENTION.php b/CODING_CONVENTION.php new file mode 100644 index 00000000..506c4fb6 --- /dev/null +++ b/CODING_CONVENTION.php @@ -0,0 +1,83 @@ + +Coding Convention +---------------- + +We are using the following coding convention + +Graphically +---------------- + +The classes are structured like that. +texts prefixed by "##" are comments to explain the convention with an example. Do not use them in your code. + +log("mailman","enum_ml"); +## when calling an important function, log it that way ## +## when raising an error, use the following syntax ## + $err->raise("classname",_("text in english")); + } + +## at the end of a php-only file, we don't put a ?> ## + +?> + +Syntax in code : +---------------- + + function names starting by "hook_" are hooks called that way: + +global $hooks; +$res=$hooks->invoke("hook_class_method_name",array($param1,$param2)); + +$params1 & 2 are sent as parameters to the hooked functions of each files. + +the hook function name must have the CALLING class name after hook_ +like hook_admin_del_member for a hook in "admin" class. + +$res is an array with the returned data as values, for each function called in a class. +The key in that array is the classname called. +