aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2006-04-20 19:31:12 +0000
committerplegall <plg@piwigo.org>2006-04-20 19:31:12 +0000
commitc64da384ea354a194cfdcbd552340261b5d547d9 (patch)
treecb0f49c53ec9c918e453b7f0dbfed757121a6743 /include
parentc4b59049c205677432e69c585e003c5bea1c85e6 (diff)
partial merge -r1173:1174 from branch-1_6 to trunk: new configuration
parameter die_on_sql_error (upgrade.php and install/upgrade_*.php not concerned on BSF) partial merge -r1208:1209 from branch-1_6 to trunk (only bug fix on incorrect insertion of complex upgrade identifiers) deletions: upgrade.php and all install/upgrade_*.php because these script are never up to date on BSF. Anyway, they are only required on a stable branch. git-svn-id: http://piwigo.org/svn/trunk@1221 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/config_default.inc.php3
-rw-r--r--include/functions.inc.php12
2 files changed, 14 insertions, 1 deletions
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index e441de35a..0a5a8e551 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -333,6 +333,9 @@ $conf['show_gt'] = true;
// accessed
$conf['debug_l10n'] = false;
+// die_on_sql_error: if an SQL query fails, should everything stop?
+$conf['die_on_sql_error'] = true;
+
// +-----------------------------------------------------------------------+
// | authentication |
// +-----------------------------------------------------------------------+
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 5e5b1ab9c..35b1e7935 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -651,12 +651,22 @@ function get_thumbnail_src($path, $tn_ext = '', $with_rewrite = true)
// error occured for the last mysql query.
function my_error($header)
{
+ global $conf;
+
$error = '<pre>';
$error.= $header;
$error.= '[mysql error '.mysql_errno().'] ';
$error.= mysql_error();
$error.= '</pre>';
- die ($error);
+
+ if ($conf['die_on_sql_error'])
+ {
+ die($error);
+ }
+ else
+ {
+ echo $error;
+ }
}
/**