Back
Registry API
Registry API 2
Registry API 3
Forward


The function definition needs to include all necessary configuration files, etc.

<?php
/*
* Whups external API interface.
*
* This file defines Whups's external API interface. Other
* applications can interact with Whups through this API.
*/

// Find the base file paths for Whups
@define('WHUPS_BASE'dirname(__FILE__) . '/..');

// Include the necessary libraries.
require_once WHUPS_BASE '/lib/base.php';

function 
whupsAddModule($name)
{
    return 
$GLOBALS['backend']->addModule($name);
}

?>

Because Whups' base.php includes all necesary libraries and intitializes the $backend object, the implementation of projects/add is very simple.