1 Here are the coding guidelines for PhpWiki.
3 ! Follow the style of the PEAR Coding Standards:
4 * http://www.php.net/manual/en/pear.standards.php
5 There's code snippets for configuring Emacs and Vim as well as several
8 ! I18N: Using gettext()
10 String literals which end up making it into the HTML output should be wrapped
11 with a call to ''gettext()''. This allows translations to be substituted when
12 PhpWiki is run in non-english environments.
14 It is important that the argument of ''gettext()'' be a constant string
15 literal, in double quotes (").
17 OKAY: gettext("This is a message.");
18 OKAY: gettext ("Fazool.");
19 OKAY: sprintf(gettext("Hello %s"), $name);
21 BAD: gettext('This will be ignored by xgettext.');
22 BAD: gettext("Howdy" . ", wazoo");
23 BAD: gettext("Hello $name");
24 BAD: define("MES", "howdy"); gettext(MES);
26 For editing files in Emacs, set indent-tabs-mode to nil. Some people
27 argue that it's better to use tabs and let people set their tab width,
28 but I think we're better off using just spaces because aligned
29 comments in the right region will not align correctly. For a detailed
30 argument see http://www.jwz.org/doc/tabs-vs-spaces.html.
32 Use php-mode as well. This is freely available on the net
33 (http://www.ontosys.com/src/php-mode.el). Put something like this
36 (load "your-path-to-lisp-files/php-mode")
39 ("\\.php\\d?\\'" . php-mode)) auto-mode-alist))
41 so when you open .php files in Emacs it will start PHP mode
44 There is another php-mode.el I have not tried:
45 http://sourceforge.net/projects/php-mode/
47 I'm sure Vim has a similar mode, if someone would let us know I'll add