wiki:en/codingstyle is not used any more and exists only for history. Post new tickets on the Github account. n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Version 1 (modified by doubleface, 14 years ago) (diff)


Coding style

Editor's setting

Here are the rules you must respect while editing sources of jelix :

  • encoding used in the sources is UTF-8 (since svn 386)
  • for indent, 4 space characters are used (no tab character)

Creating a new file

You must add a header in the PHP source :

* @package     package
* @subpackage  sub-package
* @author      your name
* @contributor
* @copyright   2007 your name
* @link
* @licence     GNU Lesser General Public Licence see LICENCE file or

Package in general is jelix. Sub-package, for jelix, it is the name of the directory in lib/jelix.

You have to specify your name on the @author line and the copyright on the @copyright line.

The license for the jelix files must be LGPL. For jelix-scripts, it's GPL. For the modules, this is your choice.

Modifying the existing sources

For the files you modify but you didn't creqte, you can specify your name in the header :

  • in the @contributor line
  • add a @copyright line with your copyright.

Of course, modifying an existing file implies that you accept that your modifications will be published under the specified license in the header.

The code

The code must be the most powerfull and light that is possible for you. It must be usable as easy as possible.

Back to summary