1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-03 00:17:35 +02:00

increase the odbc limit (64k is too low, the theme data itself is >64k)

git-svn-id: file:///svn/phpbb/trunk@8038 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2007-08-16 15:38:13 +00:00
parent 0a7abb6b37
commit 521dfdbb05
3 changed files with 27 additions and 3 deletions

View File

@ -43,7 +43,28 @@ class dbal_mssql_odbc extends dbal
$this->server = $sqlserver . (($port) ? ':' . $port : '');
$this->dbname = $database;
@ini_set('odbc.defaultlrl', 65536);
$max_size = @ini_get('odbc.defaultlrl');
if (!empty($max_size))
{
$unit = strtolower(substr($max_size, -1, 1));
$max_size = (int) $max_size;
if ($unit == 'k')
{
$max_size = floor($max_size / 1024);
}
else if ($unit == 'g')
{
$max_size *= 1024;
}
else if (is_numeric($unit))
{
$max_size = floor((int) ($max_size . $unit) / 1048576);
}
$max_size = max(8, $max_size) . 'M';
@ini_set('odbc.defaultlrl', $max_size);
}
$this->db_connect_id = ($this->persistency) ? @odbc_pconnect($this->server, $this->user, $sqlpassword) : @odbc_connect($this->server, $this->user, $sqlpassword);