$argv = $_SERVER["argv"];
    //ob_start();
}
define("RAINING_OUTSIDE", true);
# Get the environment on which this script is run (linux/windows)
require "_platform.php";
/* session and initial database */
session_name("CUBIT_SESSION");
session_start();
$ALINK = pg_connect("user="******" password="******" " . DB_HOST . " dbname=cubit");
if (!defined("DB_CUBIT_MAIN")) {
    define("DB_CUBIT_MAIN", $ALINK);
}
/* document root */
// first wait for cubit to be loaded at least once for the docroot to be set
if (($dr = locateRoot()) === false) {
    errDie("Error locating document root.");
}
define("DOCROOT", $dr);
# Get pglib
require_lib("r2s");
require_lib("ext");
require_lib("time");
require_lib("pgsql");
require_lib("error");
require_lib("db");
require_lib("file");
require_lib("query");
if (count($CUBIT_MODULES)) {
    foreach ($CUBIT_MODULES as $modname) {
        require_mlib($modname, true);
예제 #2
0
/**
 * includes a library automatically from within any directory
 *
 * @param string $lib library to include
 * @param bool $safe dont panic if libary not found
 */
function require_lib($lib, $safe = false)
{
    $f = DOCROOT . "/libs/{$lib}.lib.php";
    if (is_file($f)) {
        include_once $f;
        return true;
    } else {
        if ($safe !== true) {
            locateRoot(true);
            errDie("Library \"{$lib}\" not found.");
        }
    }
    return false;
}