wesnoth/utils/tests/include/settup.php.template
Pauli Nieminen 1508c8ca48 deleted smarty and adodb from svn (They can be downloaded as needed)
Improved path settings code a bit
2008-08-08 20:17:05 +00:00

51 lines
1019 B
Plaintext

<?php
// debug
error_reporting(E_ALL | E_STRICT);
// production error_loging to system log
//ini_set('syslog');
// settup auto class loader
function __autoload($class)
{
global $root_dir;
require_once($root_dir . '/../include/'.$class .'.php');
}
// initialize database connection
$adodb_dir = $root_dir . '/../adodb_lite/';
include($adodb_dir . "adodb-exceptions.inc.php");
require_once($adodb_dir . 'adodb.inc.php');
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$driver = 'mysqli';
$username = 'username';
$password = 'password';
$hostname = 'localhost';
$database = 'wesnoth_unit_test';
$flags = MYSQL_CLIENT_COMPRESS;
$extra_options = '';
//$debug = 'debug&persit&'
$modules = '#date:transaction';
try {
$db = ADONewConnection("$driver://$username:$password@$hostname/$database?${extra_options}${modules}");
}
catch(exception $e)
{
echo "Connection to database failed!";
exit;
}
// initialize tempalte parser
$smarty_dir = $root_dir . '/../smarty_workdir/';
$smarty = new WesnothSmarty($smarty_dir);
?>