Example #1
0
        }
        $config = preg_replace('~//<' . self::TAG_NAME . '>.*?//</' . self::TAG_NAME . '>~msi', "//<" . self::TAG_NAME . ">\n              " . join(",\n              ", $elements) . "\n//</" . self::TAG_NAME . ">", str_replace(array("\r\n", "\r"), "\n", file_get_contents(BASE_DIR . '/classes/Config.php')));
        file_put_contents(BASE_DIR . '/classes/Config.php', $config);
    }
    public static function Defaults()
    {
        // Set the default timezone
        date_default_timezone_set(self::$settings['timezone']);
        // Define video extensions
        define('VIDEO_EXTENSIONS', str_replace(array('.', ','), array('', '|'), self::$settings['video_extensions']));
        define('TEMPLATES_DIR', BASE_DIR . '/templates/' . self::$settings['template']);
        // Patched TEMPLATES_DIR
    }
}
// Load configuration defaults
Config::Defaults();
function GetDB()
{
    static $instance;
    if (!isset($instance)) {
        $instance = new Database_MySQL(Config::Get('db_username'), Config::Get('db_password'), Config::Get('db_database'), Config::Get('db_hostname'));
    }
    return $instance;
}
function _T()
{
    static $ini = null;
    if (empty($ini)) {
        $language = Config::Get('language');
        if (version_compare(PHP_VERSION, '5.3.0', '>=') && version_compare(PHP_VERSION, '5.3.2', '<')) {
            $ini = array();