From bf03b51bca9bc98d47ecbe829452a8b66acd291d Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Mon, 24 Nov 2008 05:55:39 +0000 Subject: [PATCH] Split configuration file in to default and user configuration Made LimeSurvey configuration rely on queXS configuration so it does not need to be configured twice --- config.default.php | 142 ++++++++++++++++++++++++++++++++++ config.inc.php | 75 ++++-------------- include/limesurvey/config.php | 19 +++-- 3 files changed, 168 insertions(+), 68 deletions(-) create mode 100644 config.default.php diff --git a/config.default.php b/config.default.php new file mode 100644 index 00000000..ea6aaa8f --- /dev/null +++ b/config.default.php @@ -0,0 +1,142 @@ + + * @copyright Deakin University 2007,2008 + * @package queXS + * @subpackage configuration + * @link http://www.deakin.edu.au/dcarf/ queXS was writen for DCARF - Deakin Computer Assisted Research Facility + * @license http://opensource.org/licenses/gpl-2.0.php The GNU General Public License (GPL) Version 2 + * + */ + + +/** + * + * DO NOT MODIFY THIS FILE! + * + * Make your configuration changes in config.inc.php + * + * + */ + + +/** + * The default time zone + */ +if (!defined('DEFAULT_TIME_ZONE')) define('DEFAULT_TIME_ZONE', 'Australia/Victoria'); + + +/** + * Date time format for displaying + * + * see http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format + * for configuration details for DATE_TIME_FORMAT and TIME_FORMAT + */ +if (!defined('DATE_TIME_FORMAT')) define('DATE_TIME_FORMAT','%a %d %b %I:%i%p'); + +/** + * Time format for displaying: see above for mySQL details + */ +if (!defined('TIME_FORMAT')) define('TIME_FORMAT','%I:%i%p'); + +/** + * Flag for VoIP with Asterisk to be enabled or not + */ +if (!defined('VOIP_ENABLED')) define('VOIP_ENABLED',false); + +/** + * The Asterisk server address + */ +if (!defined('VOIP_SERVER')) define('VOIP_SERVER','asterisk.dcarf'); + +/** + * The meet me room id for the VOIP Server + */ +if (!defined('MEET_ME_ROOM')) define('MEET_ME_ROOM','5000'); + +/** + * Whether to automatically pop up a coding window when the respondent hangs up + */ +if (!defined('AUTO_POPUP')) define('AUTO_POPUP',false); + +/** + * The extension of the supervisor for dialing the supervisor + */ +if (!defined('SUPERVISOR_EXTENSION')) define('SUPERVISOR_EXTENSION',"0392517290"); + +/** + * The path to limesurvey + */ +if (!defined('LIME_PATH')) define('LIME_PATH', 'include/limesurvey/'); + +/** + * The path to queXS from the server root + */ +if (!defined('QUEXS_PATH')) define('QUEXS_PATH', '/quexs/'); + +/** + * The complete URL to limesurvey + */ +if (!defined('LIME_URL')) define('LIME_URL','http://' . $_SERVER['SERVER_NAME'] . QUEXS_PATH . LIME_PATH); + +/** + * The complete URL to this copy of queXS + */ +if (!defined('QUEXS_URL')) define('QUEXS_URL','http://' . $_SERVER['SERVER_NAME'] . QUEXS_PATH); + +/** + * The default locale (language) + */ +if (!defined('DEFAULT_LOCALE')) define('DEFAULT_LOCALE','en'); + + +/** + * Path to ADODB + */ +if (!defined('ADODB_PATH')) define('ADODB_PATH',dirname(__FILE__).'/../adodb/'); + +/** + * Database configuration for queXS + */ +if (!defined('DB_USER')) define('DB_USER', 'quexs'); +if (!defined('DB_PASS')) define('DB_PASS', 'quexs'); +if (!defined('DB_HOST')) define('DB_HOST', 'databasedev.dcarf'); +if (!defined('DB_NAME')) define('DB_NAME', 'quexs'); +if (!defined('DB_TYPE')) define('DB_TYPE', 'mysqlt'); + +/** + * The prefix for the limesurvey database + */ +if (!defined('LIME_PREFIX')) define('LIME_PREFIX','lime_'); + +/** + * Limesurvey database information (default is same as queXS database) + */ +if (!defined('LDB_USER')) define('LDB_USER', DB_USER); +if (!defined('LDB_PASS')) define('LDB_PASS', DB_PASS); +if (!defined('LDB_HOST')) define('LDB_HOST', DB_HOST); +if (!defined('LDB_NAME')) define('LDB_NAME', DB_NAME); +if (!defined('LDB_TYPE')) define('LDB_TYPE', DB_TYPE); + + +?> diff --git a/config.inc.php b/config.inc.php index d925dd69..7a16a3ab 100644 --- a/config.inc.php +++ b/config.inc.php @@ -29,76 +29,40 @@ * */ + +/** + * + * Only some of the configuration directives are here. See the file: config.default.php for them all + * + * Make your configuration changes in this file only - they will "overwrite" the default configuration + * + */ + /** * The default time zone */ define('DEFAULT_TIME_ZONE', 'Australia/Victoria'); - -/** - * Date time format for displaying - * - * see http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format - * for configuration details for DATE_TIME_FORMAT and TIME_FORMAT - */ -define('DATE_TIME_FORMAT','%a %d %b %I:%i%p'); - -/** - * Time format for displaying: see above for mySQL details - */ -define('TIME_FORMAT','%I:%i%p'); - /** * Flag for VoIP with Asterisk to be enabled or not */ -define('VOIP_ENABLED',true); +define('VOIP_ENABLED',false); /** * The Asterisk server address */ define('VOIP_SERVER','asterisk.dcarf'); -/** - * The meet me room id for the VOIP Server - */ -define('MEET_ME_ROOM','5000'); - /** * Whether to automatically pop up a coding window when the respondent hangs up */ define('AUTO_POPUP',false); -/** - * The extension of the supervisor for dialing the supervisor - */ -define('SUPERVISOR_EXTENSION',"0392517290"); - -/** - * The path to limesurvey - */ -define('LIME_PATH', 'include/limesurvey/'); - /** * The path to queXS from the server root */ define('QUEXS_PATH', '/quexs/'); -/** - * The complete URL to limesurvey - */ -define('LIME_URL','http://' . $_SERVER['SERVER_NAME'] . QUEXS_PATH . LIME_PATH); - -/** - * The complete URL to this copy of queXS - */ -define('QUEXS_URL','http://' . $_SERVER['SERVER_NAME'] . QUEXS_PATH); - -/** - * The default locale (language) - */ -define('DEFAULT_LOCALE','en'); - - /** * Path to ADODB */ @@ -109,23 +73,10 @@ define('ADODB_PATH',dirname(__FILE__).'/../adodb/'); */ define('DB_USER', 'quexs'); define('DB_PASS', 'quexs'); -define('DB_HOST', 'database.dcarf'); +define('DB_HOST', 'databasedev.dcarf'); define('DB_NAME', 'quexs'); -define('DB_TYPE', 'mysqlt'); - -/** - * The prefix for the limesurvey database - */ -define('LIME_PREFIX','lime_'); - -/** - * Limesurvey database information - */ -define('LDB_USER', 'quexs'); -define('LDB_PASS', 'quexs'); -define('LDB_HOST', 'database.dcarf'); -define('LDB_NAME', 'quexs'); -define('LDB_TYPE', 'mysqlt'); +//Do not modify the following line: +include(dirname(__FILE__).'/config.default.php'); ?> diff --git a/include/limesurvey/config.php b/include/limesurvey/config.php index e82e5cb8..c9cdf568 100644 --- a/include/limesurvey/config.php +++ b/include/limesurvey/config.php @@ -23,18 +23,25 @@ */ + +/** + * queXS Configuration file - so you do not have to configure this file manually + */ +require_once(dirname(__FILE__).'/../../config.inc.php'); + + // Basic Setup $databasetype = "mysql"; // ADOdb database driver - valid values are mysql, odbc_mssql or postgres -$databaselocation = "database.dcarf"; // Network location of your Database - for odbc_mssql use the mssql servername, not localhost or IP -$databasename = "quexs"; // The name of the database that we will create -$databaseuser = "quexs"; // The name of a user with rights to create db (or if db already exists, then rights within that db) -$databasepass = "quexs"; // Password of db user -$dbprefix = "lime_"; // A global prefix that can be added to all LimeSurvey tables. Use this if you are sharing +$databaselocation = LDB_HOST; // Network location of your Database - for odbc_mssql use the mssql servername, not localhost or IP +$databasename = LDB_NAME; // The name of the database that we will create +$databaseuser = LDB_USER; // The name of a user with rights to create db (or if db already exists, then rights within that db) +$databasepass = LDB_PASS; // Password of db user +$dbprefix = LIME_PREFIX; // A global prefix that can be added to all LimeSurvey tables. Use this if you are sharing // a database with other applications. Suggested prefix is "lime_" // File Locations -$rooturl = "http://{$_SERVER['HTTP_HOST']}/quexs/include/limesurvey"; //The root web url for your limesurvey installation (without a trailing slash). +$rooturl = substr(LIME_URL,0,-1); //The root web url for your limesurvey installation (without a trailing slash). $rootdir = dirname(__FILE__); // This is the physical disk location for your limesurvey installation. Normally you don't have to touch this setting. // If you use IIS then you MUST enter the complete rootdir e.g. : $rootDir="C:\Inetpub\wwwroot\limesurvey"!