mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-01 16:10:05 +00:00
51 lines
1019 B
Plaintext
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);
|
|
|
|
?>
|