phpBB

Code Changes

File: phpbb/db/driver/sqlite3.php

  Unmodified   Added   Modified   Removed
Line 48Line 48
		try
{
$this->dbo = new \SQLite3($this->server, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);

		try
{
$this->dbo = new \SQLite3($this->server, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);

 
			$this->dbo->busyTimeout(60000);

			$this->db_connect_id = true;
}
catch (\Exception $e)

			$this->db_connect_id = true;
}
catch (\Exception $e)

Line 101Line 102
			break;

case 'rollback':

			break;

case 'rollback':

				return $this->dbo->exec('ROLLBACK');

				return @$this->dbo->exec('ROLLBACK');

			break;
}


			break;
}


Line 133Line 134

if ($this->query_result === false)
{


if ($this->query_result === false)
{

 
				if ($this->transaction === true && strpos($query, 'INSERT') === 0)
{
$query = preg_replace('/^INSERT INTO/', 'INSERT OR ROLLBACK INTO', $query);
}


				if (($this->query_result = @$this->dbo->query($query)) === false)

				if (($this->query_result = @$this->dbo->query($query)) === false)

 
				{
// Try to recover a lost database connection
if ($this->dbo && !@$this->dbo->lastErrorMsg())
{
if ($this->sql_connect($this->server, $this->user, '', $this->dbname))
{
$this->query_result = @$this->dbo->query($query);
}
}

if ($this->query_result === false)

				{
$this->sql_error($query);

				{
$this->sql_error($query);

 
					}

				}

if (defined('DEBUG'))

				}

if (defined('DEBUG'))

Line 145Line 163
				else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
{
$this->sql_time += microtime(true) - $this->curtime;

				else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
{
$this->sql_time += microtime(true) - $this->curtime;

 
				}

if (!$this->query_result)
{
return false;

				}

if ($cache && $cache_ttl)

				}

if ($cache && $cache_ttl)

Line 207Line 230

if ($query_id === false)
{


if ($query_id === false)
{

 
			/** @var \SQLite3Result $query_id */

			$query_id = $this->query_result;
}


			$query_id = $this->query_result;
}


Line 215Line 239
			return $cache->sql_fetchrow($query_id);
}


			return $cache->sql_fetchrow($query_id);
}


		return is_object($query_id) ? $query_id->fetchArray(SQLITE3_ASSOC) : false;

		return is_object($query_id) ? @$query_id->fetchArray(SQLITE3_ASSOC) : false;

	}

/**

	}

/**

Line 388Line 412
				$endtime = $endtime[0] + $endtime[1];

$result = $this->dbo->query($query);

				$endtime = $endtime[0] + $endtime[1];

$result = $this->dbo->query($query);

 
				if ($result)
{

				while ($void = $result->fetchArray(SQLITE3_ASSOC))
{
// Take the time spent on parsing rows into account

				while ($void = $result->fetchArray(SQLITE3_ASSOC))
{
// Take the time spent on parsing rows into account

 
						}

				}

$splittime = explode(' ', microtime());

				}

$splittime = explode(' ', microtime());