By using this software, you agree to the terms of the GPL licence.

LEMP is a mini-framework that can help developers focus on their concept. It is extended by modules to form the base and provide functions like database interaction, which could also be extended by other modules like user management.


  1. Intro
  2. Setup
  3. Modules
  4. Developers Guide *
  5. LEMP Homepage *

* - Denotes an external link

Section 1 - Intro

You must include lemp.php and create the object with create_obj:

include ('LEMP/lemp.php');  // Point this to lemp.php
$lemp = &create_obj ();     // Create a reference to the object

Restrict access to members only:

include ('LEMP/lemp.php'); // Point this to lemp.php
$lemp = &create_obj ();    // Create a reference to the object
if ($lemp->access <= 0) { // Check the user's access (currently only 1 and 0)
error_add(AUTH_NOT_LOGED_IN);    // Add error to log
echo error_get_all (LEMP_HTML);      // Display all errors
exit ();                                             // Terminate script

Section 2 - Setup

* You should replace index.php with a custom page.
* You should remove setup.php after you have installed LEMP, and then replace it when you want to remove it.

Edit config.php
You must edit the vales shown below.


// ...
// Edit the database config

$db['host'] = "localhost"; // example - or localhost
$db['username'] = "LEMP"// Database user name
$db['password'] = "LEMP"; // Database password
$db['database'] = "LEMP"// Name of the database database to use
$db['prefix'] = "user"// Table names will start with [prefix]_tablename. This cannot contain any underscores.
// ...



Section 3 - Modules

All modules should be contained in a sub folder within "LEMP".

To make sure that LEMP is aware of the module, enter the module schematics in config.php.

// Schema goes like $objects['module_name']['data_name'] = 'data';
$objects['access']['file'] = 'access/access.php';
$objects['access']['class'] = 'access'; // Optional
$objects['access']['parent'] = 'dbdat'; // Optional
$objects['access']['mode'] = 'single'; // Optional
$objects['access']['args'] = array('table' => 'dbdat'); // Optional

Module_Name - This is the name you will use when you call create_obj.

    include ('LEMP/lemp.php'); // Point this to lemp.php
$lemp = &create_obj ('module_name'); // Create a reference to the object

if you set

$objects['default'] = 'module_name';

create_obj will create module_name on default, and you won't need to pass any arguments.

File - Point to the module class file from the directory that lemp.php resides in. You can use '..' to travel up the folder hierarchy.

Class - Optional, when class is not the same as the filename (without the extensions).

Parent - Only needed when module requires other classes to be loaded first.

Mode - Can either be 'single' or 'multi'. In single mode, only one instance of the module will be used. In multi mode, a new instance is used when create_obj (UMClass_Name) is called.

Args - This is module specific and should be documented by the module.