<?php
/**
 * Phoebe pedagogic planner
 *
 * PHP version 5
 *
 * LICENSE: The GNU General Public License (GPL), version 2. See LICENSE.txt
 *
 * Copyright (c) 2006-2008 JISC/HEFCE/University of Oxford
 *
 * @author      David Balch <david.balch@conted.ox.ac.uk>
 * @license     http://opensource.org/licenses/gpl-license.php GPL2
 * @link        http://phoebe-project.conted.ox.ac.uk/
 */

// Configuration for Phoebe
class CONFIG {
    // Config options
    var $root;
    var $appName = 'Phoebe';
    var $appVersion = '20080506';
    var $lang = "en_GB";
    var $defaultTemplate = '321';

    var $dsn;
    var $dbPrefix = 'phbe_';
    var $template;
    var $phoebeEmail = 'phoebe@conted.ox.ac.uk';
    var $confirmationLifespan = 259200; // How long a password reset confirmation link should be valid (in seconds).

    function __construct($doc_root) {
        // Connect to database - configure in the final else section
        if($_SERVER['SERVER_NAME'] == 'phoebe-app.conted.ox.ac.uk') {
            // Phoebe project's live application site
            // Get DSN from file outside the web hierarchy.
            $this->dsn = file_get_contents('file://D:/phoebe.txt');
        } else if ($_SERVER['SERVER_NAME'] == 'phoebe-app2.conted.ox.ac.uk') {
            // Phoebe project's development application site
            // Get DSN from file outside the web hierarchy.
            $this->dsn = file_get_contents('file://D:/phoebe.dev.txt');
            $this->debug = true;
            // Display errors on the dev site
            error_reporting(E_ALL & ~E_NOTICE);
            ini_set('display_errors', 'On');
        } else {
            // Set up with your own db connection details here
            // See http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php for details
            // Basic DSN format is: phptype://username:password@hostspec/database
            $this->dsn = 'phptype://username:password@hostspec/database';
        }

        $this->root = $doc_root.'/';
        $this->template = $this->root."inc/template.php";
    }
}
?>