The Exchange Project Preview Release 2.1 Coding Standards Practice ** THIS DOCUMENT IS A DRAFT ** In order to keep the source code sane, a standard has to be followed in the practice. Everyone has their own coding style, which has advantages and disadvantages to somebody elses style. This document will force a unified way to write code, while at the same time allow for modifications to be made, to provide an optimial standard. A general note regarding PHP3 and PHP4 compatibilty, developers are requried to test their changes under both environments. Code may work in PHP4, but may not in PHP3, and vica-versa. Read the PHP installation guide, on how to install both PHP3 and PHP4 together on the same server. PHP3 Compatibility Issues ------------------------- * Something that will be done once the template structure has been implemented, is to change all instead of General ------- * TABs should not be used as a indentations. To indent, use 2 whitespaces Function Structure ------------------ * All custom functions should start with tep_ function tep_my_function($parameter, $optional = '') { global $HTTP_GET_VARS, $another_variable; return true; } Class Structure --------------- * Class names should be in this format -> myWorkingClass class myWorkingClass { var $variable; // class constuctor function myWorkingClass() { return true; } // class methods function do_something() { $this->variable = 'set'; return tue; } } $class = new myWorkingClass; $class->do_something();