Ejemplo n.º 1
0
function on_session_start($save_path, $session_name)
{
    global $sessionDB;
    // echo 'Called session_start()<br/>';
    $sessionDB = new Database_Site();
    $sessionDB->connectToDB(SITE_DB_NAME, SITE_DB_PATH, SITE_DB_USER, SITE_DB_PWORD);
    $sessionDB->doSuppressErrors();
}
Ejemplo n.º 2
0
/*
 * Site Database
 *
 * Create the Site Database.
 */
$pathFile = 'General/gen_Includes.php';
$extension = '';
// Attempt to find proper directory from current page to Root ...
$numAttempts = 0;
while (!file_exists($extension . $pathFile) && $numAttempts < 5) {
    $extension = '../' . $extension;
    $numAttempts++;
}
require_once $extension . $pathFile;
$db = new Database_Site();
$db->doSuppressErrors();
$db->connectToDB(SITE_DB_NAME, SITE_DB_PATH, SITE_DB_USER, SITE_DB_PWORD);
$sql = "CREATE DATABASE /*!32312 IF NOT EXISTS*/ " . SITE_DB_NAME;
$db->runSQL($sql);
$sql = "USE " . SITE_DB_NAME;
$db->runSQL($sql);
/*
 * Modules Table
 *
 * Setup the Page Modules Table.
 */
$module = new RowManager_siteModuleManager();
$module->dropTable();
$module->createTable();
// Initialize Login Page Module
$module->setKey(PAGE_MODULE_LOGIN);