- Fixed usage of DbSimple.

- Fixed map view template.

Signed-off-by: TheLuda <theluda@getmangos.com>
This commit is contained in:
TheLuda 2012-09-19 17:07:02 +02:00
parent 947f95fb20
commit 4639f81ae4
4 changed files with 133 additions and 130 deletions

View File

@ -86,7 +86,7 @@ class DbSimple_Generic
function& connect($dsn)
{
// Load database driver and create its instance.
$parsed = DbSimple_Generic::parseDSN($dsn);
$parsed = $this->parseDSN($dsn);
if (!$parsed) {
$dummy = null;
return $dummy;
@ -110,7 +110,7 @@ class DbSimple_Generic
}
}
}
$object =& new $class($parsed);
$object =new $class($parsed);
if (isset($parsed['ident_prefix'])) {
$object->setIdentPrefix($parsed['ident_prefix']);
}
@ -130,7 +130,7 @@ class DbSimple_Generic
fclose($fp);
unlink($testFile);
require_once 'Cache' . '/Lite.php'; // "." -> no phpEclipse notice
$t =& new Cache_Lite(array('cacheDir' => $dir.'/', 'lifeTime' => null, 'automaticSerialization' => true));
$t =new Cache_Lite(array('cacheDir' => $dir.'/', 'lifeTime' => null, 'automaticSerialization' => true));
$object->_cacher =& $t;
break;
}

View File

@ -32,7 +32,8 @@ class DbSimple_Mysql extends DbSimple_Generic_Database
*/
function DbSimple_Mysql($dsn)
{
$p = DbSimple_Generic::parseDSN($dsn);
$DbSimple = new DbSimple_Generic();
$p = $DbSimple->parseDSN($dsn);
if (!is_callable('mysql_connect')) {
return $this->_setLastError("-1", "MySQL extension is not loaded", "mysql_connect");
}
@ -70,7 +71,7 @@ class DbSimple_Mysql extends DbSimple_Generic_Database
function& _performNewBlob($blobid=null)
{
$obj =& new DbSimple_Mysql_Blob($this, $blobid);
$obj =new DbSimple_Mysql_Blob($this, $blobid);
return $obj;
}

View File

@ -19,14 +19,15 @@ require_once 'includes/DbSimple/Generic.php';
global $UDWBaseconf;
// Connect to world DB
$DB = DbSimple_Generic::connect("mysql://" . $UDWBaseconf['world']['user'] . ":" . $UDWBaseconf['world']['pass'] . "@" . $UDWBaseconf['world']['host'] . "/" . $UDWBaseconf['world']['db']);
$DBSimple = new DbSimple_Generic();
$DB = $DBSimple->connect("mysql://" . $UDWBaseconf['world']['user'] . ":" . $UDWBaseconf['world']['pass'] . "@" . $UDWBaseconf['world']['host'] . "/" . $UDWBaseconf['world']['db']);
$DB->setErrorHandler('databaseErrorHandler');
$DB->setIdentPrefix($UDWBaseconf['world']['table_prefix']);
$DB->query('SET NAMES ?', 'utf8');
// Connect to the realm DB
if ($UDWBaseconf['realmd']) {
$rDB = DbSimple_Generic::connect("mysql://" . $UDWBaseconf['realmd']['user'] . ":" . $UDWBaseconf['realmd']['pass'] . "@" . $UDWBaseconf['realmd']['host'] . "/" . $UDWBaseconf['realmd']['db']);
$rDB = $DBSimple->connect("mysql://" . $UDWBaseconf['realmd']['user'] . ":" . $UDWBaseconf['realmd']['pass'] . "@" . $UDWBaseconf['realmd']['host'] . "/" . $UDWBaseconf['realmd']['db']);
$rDB->setErrorHandler('databaseErrorHandler');
$rDB->setIdentPrefix($UDWBaseconf['realmd']['table_prefix']);
$rDB->query('SET NAMES ?', 'utf8');

View File

@ -60,13 +60,13 @@
<option value="440">Tanaris</option>
<option value="141">Teldrassil</option>
<option value="17">The Barrens</option>
<option value="3557">The Exodar</option>
<option value="400">Thousand Needles</option>
<option value="1638">Thunder Bluff</option>
<option value="490">Un'Goro Crater</option>
<option value="618">Winterspring</option>
</select>
<div style="padding-bottom: 4px"></div>
<select onchange="mapperChooseZone(this)" class="zone-picker">
<option value="0">Instances</option>
<optgroup label="Dungeons">
@ -108,7 +108,8 @@
<option value="19">Zul'Gurub</option>
</optgroup>
</select><select onchange="mapperChooseZone(this)" class="zone-picker">
</select>
<select onchange="mapperChooseZone(this)" class="zone-picker">
<option value="0">More</option>
<optgroup label="Battlegrounds">
<option value="2597">Alterac Valley</option>