diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-06 20:53:46 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-06 20:53:46 +0000 |
| commit | dd9ad539fdab80badedf801a816b8a0beafbbf5c (patch) | |
| tree | db8ae8a184b060d5576604cc0dfa723773daedb8 /phpBB/includes/db/dbal.php | |
| parent | 2c8afb820e3842bed2ab6cec4053e71b5c566985 (diff) | |
| download | forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.gz forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.bz2 forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.xz forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.zip | |
ok, this one is rather large... the most important change:
re-introduce append_sid: old style continues to work, not a performance hog as it was in 2.0.x -> structure is different
apart from this, code cleanage, bug fixing, etc.
git-svn-id: file:///svn/phpbb/trunk@6015 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db/dbal.php')
| -rw-r--r-- | phpBB/includes/db/dbal.php | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 4900486a9e..3ad4bf86ba 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -121,6 +121,48 @@ class dbal } /** + * SQL Transaction + * @private + */ + function sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + // Commit previously opened transaction before opening another transaction + if ($this->transaction) + { + $this->_sql_transaction('commit'); + } + + $result = $this->_sql_transaction('begin'); + $this->transaction = true; + break; + + case 'commit': + $result = $this->_sql_transaction('commit'); + $this->transaction = false; + + if (!$result) + { + $this->_sql_transaction('rollback'); + } + break; + + case 'rollback': + $result = $this->_sql_transaction('rollback'); + $this->transaction = false; + break; + + default: + $result = $this->_sql_transaction($status); + break; + } + + return $result; + } + + /** * Build sql statement from array for insert/update/select statements * * Idea for this from Ikonboard @@ -328,7 +370,7 @@ class dbal */ function sql_report($mode, $query = '') { - global $cache, $starttime, $phpbb_root_path, $user, $SID; + global $cache, $starttime, $phpbb_root_path, $user; if (empty($_GET['explain'])) { |
