Conventions

From Lanius CMS Wiki

Contents

Coding approach

  • Object oriented with some simple shared functions
  • DRY (Don't Repeat Yourself) principle

Coding standards

Source code documentation

Source code should be documented using doxygen format; example follows:

 ## Documentation for this module.
 #
 #  More details.
 
 ## Documentation for a function.
 #
 #  @param $n The number passed as parameter
 #  More details.
 function example($n) {
   echo "I have $n years";
 }
 
 ## Documentation for a class.
 #
 #  More details.
 class MyClass {
 
     ## @var _memVar
     #  a member variable
     var $_memVar;
    
     ## The constructor.
     function MyClass() {
         $this->_memVar = 0;
     }
    
     ## Documentation for a method.
     #  @param $s The string to display
     function MyMethod($s) {
        echo $s;
     }
 
 }

Inline comments to explain complex code blocks are also wanted.

See also:

Security

All Lanius CMS software add-ons will automatically be certified through a webservice hosted at the Lanius CMS server; the main purpose is to not let insecure software spread, see also Certification.

These are the security parameters evaluated when establishing the security of a component, module or any other add-on, ordered from highest to lowest risk level:

  0. no risk
  1. server-to-server URL access (see classes/sst.php)
  2. SQL read access (see also Database)
  3. SQL read/write access (see also Database)
  4. emailing capabilities (see classes/gelomail.php)
  5. file upload
  6. software installation (only allowed on GID 5)
  7. custom file read (no applications for this use, kept as reference)
  8. raw sockets access (possibly used by the embedded FTP client)
  9. custom file move/write in the allowed website root
 10. custom file move/write without allowed website root check
 11. variadic code execution (eval() or other code executed from external source, not allowed)

Level 9 (custom file move/write) granted to users whose GID is equal to 5 (admin) Level 5 (file upload) granted to configured GID level and above

NOTE: Certification is not currently enforced

See also User groups.

Output standard

Our output will be (milestone for version 1.0) conforming to the following standards:

   * WAI
   * XHTML 1.0 Strict
   * CSS 2
   * Wireless Markup Language

Internationalization and localization

All language resources are located in the lang directory; Lanius CMS supports only the UTF-8 charset.

The date/time functions are overridden as follows:

   * lc_strftime() overrides strftime()
   * lc_date() overrides date()
   * lc_mktime() overrides mktime()

Incomplete list

When using the appropriate lc_* function the output will be UTF-8 and relative to the user's language and timezone.

For other conventions, please see CSS and Database

Personal tools
Create a book
  • Add wiki page
  • Collections help