cvs: pear /MDB2 MDB2.php

From: Date: Wed, 21 Jun 2006 12:43:19 +0000
Subject: cvs: pear /MDB2 MDB2.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-40856@lists.php.net to get a copy of this message
lsmith Wed Jun 21 12:43:19 2006 UTC Modified files: /pear/MDB2 MDB2.php Log: - cosmetic changes - return false on rollback() in completeNestedTransaction() http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2.php?r1=1.225&r2=1.226&diff_format=u Index: pear/MDB2/MDB2.php diff -u pear/MDB2/MDB2.php:1.225 pear/MDB2/MDB2.php:1.226 --- pear/MDB2/MDB2.php:1.225 Wed Jun 21 10:19:29 2006 +++ pear/MDB2/MDB2.php Wed Jun 21 12:43:18 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.225 2006/06/21 10:19:29 lsmith Exp $ +// $Id: MDB2.php,v 1.226 2006/06/21 12:43:18 lsmith Exp $ // /** @@ -1962,7 +1962,8 @@ * * @param bool if the transaction should be rolled back regardless * even if no error was set within the nested transaction - * @return mixed MDB2_OK on success, a MDB2 error on failure + * @return mixed MDB_OK on commit/counter decrementing, false on rollback + * and a MDB2 error on failure * * @access public */ @@ -1972,14 +1973,17 @@ --$this->nested_transaction_counter; return MDB2_OK; } - $this->nested_transaction_counter = null; + $this->nested_transaction_counter = null; $result = MDB2_OK; // transaction has not yet been rolled back if ($this->in_transaction) { if ($force_rollback || $this->has_transaction_error) { $result = $this->rollback(); + if (!PEAR::isError($result)) { + $result = false; + } } else { $result = $this->commit(); } @@ -2008,10 +2012,7 @@ $error = true; } $this->has_transaction_error = $error; - $result = MDB2_OK; - if ($immediatly) { - $result = $this->rollback(); - } + $result = $immediatly ? $this->rollback() : MDB2_OK; return $result; } // }}}

« previous php.pear.cvs (#40856) next »