Differences

This shows you the differences between two versions of the page.

dev:php_coding_convention [2010/01/06 19:37]
greg
dev:php_coding_convention [2010/01/06 21:05] (current)
greg
Line 22: Line 22:
Names are the heart of programming, so select meaningful names. Furthermore Names are the heart of programming, so select meaningful names. Furthermore
specially for library functions we need to enforce a standard to prevent collisions as PHP does not support name spaces (it does though if Object Oriented Programming is done). specially for library functions we need to enforce a standard to prevent collisions as PHP does not support name spaces (it does though if Object Oriented Programming is done).
-===== Choosing a name for a module in Sahana <module> =====+===== Choosing a module "short name" for your module in Sahana ~ <module> =====
A Sahana module has a "short name" that is used across the modules code and in the mdoule's folder structure. This "short name" is referred to as <module> and is limited to a string length of 6 alphanumeric characters. Therefore, each of the 6 string characters can be a letter a-z or a number 0-9. Using only lowercase characters simplifies problems with case sensitivity in different filesystems and in function names. For those familiar with regular expressions, the "short name" must adhere to this regular expression: /\A[0-9a-z]{2,6}\Z/ A Sahana module has a "short name" that is used across the modules code and in the mdoule's folder structure. This "short name" is referred to as <module> and is limited to a string length of 6 alphanumeric characters. Therefore, each of the 6 string characters can be a letter a-z or a number 0-9. Using only lowercase characters simplifies problems with case sensitivity in different filesystems and in function names. For those familiar with regular expressions, the "short name" must adhere to this regular expression: /\A[0-9a-z]{2,6}\Z/

Navigation
  • Navigate