NeoFW Configuration Directives

From NarcWiki

Jump to: navigation, search

The NeoFW configuration directives are passed to NeoFW via a special global variable named $config. This variable is a two (or more) level deep array mostly using the format $config[$module_name][$module_parameter].

[edit] Recommended Use

Firstly, it is recommended to include the special file neo_fw.h.inc before setting anything in $config, to ensure all NeoFW internal constants are available for setting.

Afterwards, just set all the $config variables you're interested in, and include neo_fw.inc to finish the setup process.

Ideally, you should do most or all of this inside a file included across your application, to ensure the availability of all the functions you're interested in.

[edit] The Configuration Directives

NamePossible ValuesNotes
$config['base']['ob']
  • true
  • false (default)
Whether to use output buffering in outputted pages. Since this is generally a good idea, the default may change to true at a later point.
$config['auth']['in_use']
  • true
  • false (default)
Whether to include the auth module. Ref: NeoFW Modules#The auth Module. Remember auth also includes sess!
$config['auth']['db']
  • a string
  • $config['db']['db'] (default)
If you're using the auth module, you should set this to be the name of the database containing your NeoFW authentication and session tables. Note that the default assumption is that your program database contains the authentication and session tables, as well, which may not be correct (and it is not for the applications on narc.ro).
$config['auth']['pre']
  • a string
  • "" (the empty string) (default)
The prefix (if any) to the auth and session tables. Note that this gets directly composited with the table names, thus must include any "_" or other separator. Mostly for use in the cases where you have a limited number of databases and have to shove all the tables inside them -- the existence of this variable lets you visually distinguish the auth/sess/etc tables.
$config['priv']['in_use']
  • true
  • false (default)
Whether to include the priv module. Ref: NeoFW Modules#The priv Module. Remember priv is a very demanding module!
$config['priv']['list']
  • an array
  • null (default)
An array mapping privilege names to their numeric IDs stored in the privilege database. Further details available here: NeoFW Modules#The priv Module.
$config['db']['type']
  • "mysql"
  • "mysqli"
  • "null" (default)
Which of the available NeoFW database modules to include. This functionality needs more documentation, of course. Note that mysqli is the most complete implementation. Also note that a lot of the important modules (auth, priv, etc) require a database to work with. See also: NeoFW Modules#The db Module.
This article is a stub. It will be expanded upon later.
Personal tools
Stuff