Beispiel #1
0
<?php

// Database initialization
$oDB = new DBmysql($fusebox['dbLogin'], $fusebox['dbPassword'], $fusebox['dbName'], $fusebox['dbHost'], $fusebox['dbPort']);
if (!$oDB) {
    _throw("FCannotInstantiateDB", "Cannot instantiate DB class");
}
if (!$oDB->connect()) {
    _throw("FCannotConnectToDB", "Cannot connect to database server you specified (" . $oDB->getError() . ")");
}
// making fake fuseaction for global things
$ogFuseaction = new Fuseaction(0, $fusebox['globalFuseaction'], "Entire site", "", $fusebox['globalStickyAttributes']);
// FuseManager initialization
$oFuseManager = new FuseManager($oDB, $fusebox['tableFuseactions'], false);
if (!$oFuseManager->initialize()) {
    _throw("FNoFuseactionsTable", "There is no fuseactions table called \"{$fusebox['tableFuseactions']}\" present in DB");
}
// sync'ing fuseactions
if ($fusebox['mode'] == "development") {
    if (!$oFuseManager->synchronizeFuseactions($fusebox)) {
        _throw("FCannotSynchronizeFuseactions", "Error occured while synchronizing fuseactions, check your database");
    }
}
// getting current fuseaction
$oFuseaction = $oFuseManager->getFuseaction($attributes['fuseaction']);
if (!$oFuseaction) {
    _throw("FNoSuchFuseaction", "There is no fuseaction called \"{$attributes['fuseaction']}\" found");
}
// loading 'sticky' attributes values from session for entire site
getStickyAttributes($ogFuseaction->getName(), $ogFuseaction->getStickyAttributes());
// loading 'sticky' attributes values from session for this fuseaction