Commit 472c6189 authored by Penny Leach's avatar Penny Leach

more stuff related to moving lib around

parent 51f38aab
<?php
/**
* This file is part of maraha.
*
* maraha is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* maraha is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with maraha; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
$cfg = new StdClass;
// database connection details
$cfg->dbtype = 'postgres8';
$cfg->dbhost = 'localhost';
$cfg->dbport = 5432;
$cfg->dbname = 'mahara';
$cfg->dbuser = 'mahara';
$cfg->dbpass = 'mahara';
$cfg->dbprefix = '';
// wwwroot - include trailing slash
// @todo <nigel>: Generate programatically
$cfg->wwwroot = 'http://myhost.com/mahara/';
// dirroot - uploaded files - include trailing slash.
// must be writable by the webserver and outside document root.
$cfg->dataroot = '/path/to/uploaddir';
?>
......@@ -33,32 +33,32 @@ function exception($e) {
echo $e;
}
$CFG = new StdClass;
$CFG->docroot = dirname(__FILE__);
$CFG->docroot = dirname(__FILE__).'/';
// Figure out our include path
if (!empty($_SERVER['MAHARA_LIBDIR'])) {
$CFG->libroot = $_SERVER['MAHARA_LIBDIR'];
}
else {
$CFG->libroot = dirname(dirname(__FILE__)) . '/lib/';
$CFG->libroot = dirname(__FILE__) . '/lib/';
}
set_include_path('.' . PATH_SEPARATOR . $CFG->libroot);
if (!is_readable($CFG->libroot . 'config.php')) {
if (!is_readable($CFG->docroot . 'config.php')) {
trigger_error('Not installed! Please create config.php from config-dist.php');
}
require 'config.php';
require('config.php');
$CFG = (object)array_merge((array)$cfg, (array)$CFG);
require 'mahara.php';
require('mahara.php');
require('dml.php');
ensure_sanity();
// Database access functions
require 'adodb/adodb-exceptions.inc.php';
require 'adodb/adodb.inc.php';
require('adodb/adodb-exceptions.inc.php');
require('adodb/adodb.inc.php');
try {
// ADODB does not provide the raw driver error message if the connection
......@@ -72,10 +72,14 @@ try {
}
if (!empty($CFG->dbpersist)) { // Use persistent connection (default)
$dbconnected = $db->PConnect($CFG->dbhost,$CFG->dbuser,$CFG->dbpass,$CFG->dbname);
} else { // Use single connection
}
else { // Use single connection
$dbconnected = $db->Connect($CFG->dbhost,$CFG->dbuser,$CFG->dbpass,$CFG->dbname);
}
$db->SetFetchMode(ADODB_FETCH_ASSOC);
configure_dbconnection();
ob_end_clean();
}
catch (Exception $e) {
......
<?php
$string['dbconnfailed'] = 'Failed to connect to database, error message was %s';
?>
\ No newline at end of file
<?php
?>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment