General script structure
Zurück | Kapitel 20. moregroupware coding conventions | Weiter

## General script structure

Additions to the PEAR conventions:

      **********
      inclusion:
      **********

      global parameters:

      $myEnv[module] = "contact";
      $myEnv[output] = "html";

      include('MGW_vCard.php');

(export classes and functions that are to be reused in another context to a separate class of file).

      ********
      control:
      ********

      if (isset($dump)){
      dumpVCard($id, $PHPSESSID);
      } else {
      exportVCard($id, $PHPSESSID);
      }

(which will be more complex in other modules, but shows at the beginning of the page what functions to expect)

      ***************
      implementation:
      ***************

      function exportVCard($id, $PHPSESSID){
      ...}
      function dumpVCard($id, $PHPSESSID){
      ...}

Clearly defined interfaces what parameters we need to make the function work and to improve testing of single methods).

Zurück | Nach oben | Weiter
Using CVS | Zum Anfang | Teil V. Anhänge