From 47073967c8fe2a42385e91b0b1d3fd7837570f1b Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 29 Nov 2016 10:41:35 +0000 Subject: [PATCH] profile fix debug message --- etc/profile | 1 - lib/php/db/types/sqlite.php | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/etc/profile b/etc/profile index 42e94142..0f66d78d 100755 --- a/etc/profile +++ b/etc/profile @@ -62,7 +62,6 @@ else #echo $NB_CURRENT_DIR; return [ -e "$NB_CURRENT_DIR/profile.d/functions" ] && . "$NB_CURRENT_DIR/profile.d/functions" - echo $(realpath $NB_CURRENT_DIR/..) export NB_ROOT=$(realpath $NB_CURRENT_DIR/.. 2>/dev/null) [ -n "$NB_DEBUG" ] && $NB_DEBUG "NB_ROOT=$NB_ROOT" diff --git a/lib/php/db/types/sqlite.php b/lib/php/db/types/sqlite.php index 65c7b6ef..24bbc081 100644 --- a/lib/php/db/types/sqlite.php +++ b/lib/php/db/types/sqlite.php @@ -125,6 +125,10 @@ $DB_TYPES['sqlite'] = array ( return $sql; }, 'disconnect' => function($Db) { - foreach ($Db->sql_pre() as $s) { if ($s = preg_replace('/^ATTACH DATABASE.*? as (.*?)$/','DETACH DATABASE $1',$s)) $Db->conn->exec($s); } + foreach ($Db->sql_pre() as $s) { + if (strpos($s,'ATTACH')!==false and + ($s = preg_replace('/^ATTACH DATABASE.*? as (.*?)$/','DETACH DATABASE $1',$s)) + ) $Db->conn->exec($s); + } }, );?> -- 2.47.3