From 901616b650fc6ed3da29cad82f1baa48c2264195 Mon Sep 17 00:00:00 2001 From: alvaro <alvaro@graves.cl> Date: Sun, 12 May 2013 02:23:23 -0700 Subject: [PATCH] more debug checking --- classes/Importer.php | 4 +++- classes/MetaDb.php | 4 +++- classes/Utils.php | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/classes/Importer.php b/classes/Importer.php index 1ee4212a..5915363d 100644 --- a/classes/Importer.php +++ b/classes/Importer.php @@ -127,7 +127,9 @@ class Importer{ }elseif($compType == LS."LodspeakrVisualComponent"){ $this->createViews($inputs); }else{ - Logging::log("Component '$component' (of type $compType) not supported", E_USER_WARNING); + if($conf['debug']){ + Logging::log("Component '$component' (of type $compType) not supported", E_USER_WARNING); + } } } $content .= "?>\n"; diff --git a/classes/MetaDb.php b/classes/MetaDb.php index 404a3793..428352e0 100644 --- a/classes/MetaDb.php +++ b/classes/MetaDb.php @@ -35,7 +35,9 @@ class MetaDb{ $db = NULL; }catch(Exception $e){ echo "Can't write in SQLite database. Please check you have granted write permissions to <tt>meta/</tt> and <tt>meta/db.sqlite</tt>.<br/>Also you can check a list of <a href='https://github.com/alangrafu/lodspeakr/wiki/CommonErrors'>common errors</a> and how to <a href='https://github.com/alangrafu/lodspeakr/wiki/Wipe-out-the-database'>wipe out the database</a>'"; - Logging::log('Exception exec: '.$e->getMessage(), E_USER_ERROR); + if($conf['debug']){ + Logging::log('Exception exec: '.$e->getMessage(), E_USER_ERROR); + } exit(1); } return $results; diff --git a/classes/Utils.php b/classes/Utils.php index 57461792..517d2503 100644 --- a/classes/Utils.php +++ b/classes/Utils.php @@ -280,8 +280,10 @@ class Utils{ if($modelFile != "." && $modelFile != ".." && strpos($modelFile, ".") !== 0){ if(is_dir($modelFile)){ if(strpos('endpoint.', $modelFile) == 0){ - Logging::log("Save $modelFile for later, after all the queries in the current directory has been resolved", E_USER_NOTICE); - $subDirs[]=$modelFile; + if($conf['debug']){ + Logging::log("Save $modelFile for later, after all the queries in the current directory has been resolved", E_USER_NOTICE); + } + $subDirs[]=$modelFile; } }else{ if(preg_match('/\.query$/', $modelFile)){ -- GitLab