NeoFW Modules

This page contains a list of all NeoFW modules, along with their configuration directives.

The base Module
The base module is the first of two absolutely required modules. base provides some glue functions to the rest of the framework, and also contains some miscellaneous functions which haven't found their place yet.

Configuration variables

 * $config['prog']['sender'] -- (string) The default From: address of emails sent by the send_html_mail function. It is only required if you're not going to pass a sender argument to the function.
 * $config['base']['ob'] -- (boolean) Whether to use output buffering in the application automatically or not. If true, will automatically call ob_start during initialization.

The err Module
The err module provides error-reporting and handling functions, and a few logging functions that can be useful for debugging. Because it is used internally for these functions, it is the second of the two absolutely required modules.

Configuration variables

 * $config['err']['log'] -- (int, bitwise) One or more of the NEOFW_LOG_ family of constants, added together (or bitwise and-ed). Defines how logging is handled -- to console, to file, etc.. By default, it is NEOFW_LOG_CONSOLE_HTML (HTML-format logging lines are included in the output).
 * $config['err']['logfile'] -- (string) Path to the file used for logging, if logging to file is enabled. If a relative path, it will be relative to the script called via HTTP or command line. By default, uses "[NEOFW_PATH]/log/error.log". It is highly recommended to set this if you set $config['err']['log'] above.
 * $config['err']['debug'] -- (int, bitwise) One or more of the NEOFW_DEBUG_ family of constants, added together (or bitwise and-ed). Specifies the type of debug lines that will be logged automatically. Defaults to NEOFW_DEBUG_NONE, or no debug logging.
 * $config['err']['on_fatal_error'] -- (string, function($msg, $sys, $file, $line)) Specifies an (optional) function to be called in case of fatal error. The function must take four parameters, in order: error message, subsystem, file of error, and line of error. The latter two may be null in some cases.
 * $config['err']['with_error_location'] -- (boolean) Whether or not to include the error location (i.e. file and line) in the logging output when they are available.
 * $config['err']['css'] -- (string, hyperlink) Link to a CSS to be used for the default fatal error page (if you didn't set $config['err']['on_fatal_error'] above).

The db Module
db provides a single linking point to the db.* submodules.

Configuration variables

 * $config['db']['type']</tt> -- (string) Name of the db.* submodule to include, without the db. prefix; if empty, db.inc is never included. Default: null (unset).

The db.null Module
db.null is a special debug/fallback database handler. It provides the known NeoFW db Functions, but their return value is unspecified. There is no database connection because there is no database.

Configuration variables
There is no configuration for the db.null module.

The priv Module
The priv module provides a reasonably complete set of functions that can be used to provide fine-grained access control to your application.

Configuration variables
$config['priv']['list']['Write'] = 1; $config['priv']['list']['Administer'] = 2;</tt> An example of privileges
 * $config['priv']['in_use']</tt> -- (boolean) Whether to include the priv module or not. Defaults to null (unset), equivalent to false.
 * $config['priv']['list']</tt> -- (array) An array mapping the privilege names used internally in the application to privilege IDs. An example is shown to the right, consisting of two privilege levels, "Write" and "Administer", given the IDs 1 and 2, respectively.

The auth Module
The auth module provides some authentication functions, allowing you to quickly provide user login, logout, and registration.

Configuration variables

 * $config['auth']['in_use']</tt> -- (boolean) The master switch; controls whether the auth module should be included or not. Defaults to null (unset), equivalent to false, but may be overridden by other included modules.
 * $config['auth']['db']</tt> -- (string) Name of the database containing the auth tables. Defaults to $config['db']['db'], but can and should be overridden in the case of multiple websites with a single user database.
 * $config['auth']['prefix']</tt> -- (string) Prefix added to all authentication table names, in case of database sharing (some web hosts allow a single database per user; this allows the auth tables to stand out in the inevitable crowd).