add abort option to debug mode of PG driver
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Wed, 16 Jun 2010 06:15:37 +0000 (06:15 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Wed, 16 Jun 2010 06:15:37 +0000 (06:15 +0000)
git-svn-id: https://silmor.de/svn/softmagic/pack/trunk@503 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

phpbase/db_pgsql.php

index def1723..7c0e636 100644 (file)
@@ -348,9 +348,10 @@ class PGsqlEngine extends DbEngine
        }
        
        /**development helper: activate debug mode*/
-       public function setDebugMode($b=true)
+       public function setDebugMode($b=true,$a=false)
        {
                $this->do_debug=$b;
+               $this->do_abort=$b && $a;
        }
        
        /**internal helper: print debug message as XML comment, if activated*/
@@ -360,7 +361,8 @@ class PGsqlEngine extends DbEngine
                        print("<!-- Error while doing '".$what."' on DB: ".xq($this->lastError())." -->\n");
                        if($detail!==false)
                                print("<!-- details: ".xq($detail)." -->\n");
-//                     die("giving up");
+                       if($this->do_abort)
+                               die("giving up");
                }
        }
 };