Example #1
0
// Pull in the required database class.
switch ($CONF['driver']) {
    case "postgresql":
    case "pgsql":
    case "postgres":
        \Pste\Database::getInstance()->createConnection('pgsql', $CONF["dbhost"], $CONF['dbname'], $CONF["dbuser"], $CONF["dbpass"]);
        require_once 'classes/db.php';
        break;
    case "mysql":
        \Pste\Database::getInstance()->createConnection('mysql', $CONF["dbhost"], $CONF['dbname'], $CONF["dbuser"], $CONF["dbpass"]);
        require_once 'classes/db.php';
        break;
}
\Pste\Database::getInstance()->getConnection()->exec("SET NAMES 'utf8'");
$ht = new Pste_View_Helper_HeadTitle();
$ht->setTitle('Pste', 'replace');
/**
 * wrapper for config instance creation so the instance does not live in global
 * scope 
 */
function bootstrap($configuration_array)
{
    $config = new \Pste\Config($configuration_array);
    \Pste\Registry::getInstance()->config = $config;
    $route = new \Pste\Route();
    $route->setTemplatePath($config->template);
    \Pste\Registry::getInstance()->route = $route;
}
function __autoload($class)
{
    $nsSplit = explode('\\', $class);