The WACT project uses the PEAR Coding standards with a few exceptions and additions.
WACT makes the following exceptions to the PEAR coding standards.
WACT uses the one true brace style for function definitions.
function HelloWorld() { echo "Hello World!"; }
This overrides the Function Defintions section of the PEAR coding standard.
Many Exceptions here.
This overrides the Header Comment Blocks section of the PEAR coding standard.
All classes and functions in WACT should be prefixed by ‘Wact’.
class WactExample { } function WactExample() { }
WACT code should not use constants defined with define. Class constants should be all upper case.
WACT code should not use global variables. Does it do that anyway now? If it does, we need to talk prefixes.
This overrides the Naming Conventions section of the PEAR coding standard.
All includes in WACT must be relative to the include_path.
A file should require_once its dependencies at the top of the file.
All exception classes should be lazy loaded.
require_once 'wact/sample/example.xcpt.php'; throw new ExampleException();
See WACT File Organization for more information on the .xcpt.php filename extension.