The NConf modules provides some optional functionality.
With a collection of shared functions user could also make their own modules, or expand some existing functionalities.
Here is a list of modules for NConf
This module provides you with some deployment possibilities.
All modules are located in this directory:
Each module must have a init.php file, which will be loaded by NConf automatically. This file will be loaded on every page, so normaly there are just some configurations inside.
Provides the module some configuration possibilities for users, this should be placed in the
by the user itself
Its name should be the module name and the ending ”.ini” (#modulname#.ini)
for example for the module “deployment”:
It should be in the INI format, which is documented on php.net (http://php.net/manual/en/function.parse-ini-file.php) So you can import the config into an array.
There are different types of how the module is integrated into NConf. This depends on the provided functionality of the module.
The main file of a module should contain at least the following lines, to fit correct into NConf:
<?php require_once('config/main.php'); require_once(NCONFDIR.'/include/head.php'); // put your code here.... require_once 'include/foot.php'; ?>
This will give you the layout and the functionality to easily interact with NConf.
There are some Interfaces which could help you in creating or printing content. You can create your own output with html content, or you can use the NConf::HTML class.
This class will give you the possibility to print things out.
The class gives you some “standardized” outputs. for example:
Here are some examples.
// some text echo NConf_HTML::text('text...', TRUE, 'div', 'class="attention"'); // print a title echo NConf_HTML::title("this is a title"); // print a horizontal line NConf_HTML::table_row_text(NConf_HTML::line());
The DEBUG class helps you put some information into the “debug console”.
In NConf we recommend you to only do this when developing a module or analyzing a problem/bug
function set($MESSAGE, $LEVEL = "DEBUG", $TITLE = '')
// set a text into degug: NConf_DEBUG::set('some '.$simple.' text'); // set also a title and debug level NConf_DEBUG::set("message... perhaps with $some_var ", 'DEBUG', "a title"); // example from the loading module : NConf_DEBUG::set("$module_name loaded", 'DEBUG', 'Module');
To print an array, you can just set the array into it. The debugger will display a “print_r” of the array (swap)
NConf_DEBUG::set($array, 'DEBUG', "title for printing the array");
Written by Fabian Gander