From d9aec325dbf1f34856f7c4968c22573892a1ea4b Mon Sep 17 00:00:00 2001 From: Slim Amamou Date: Sat, 9 Feb 2008 18:16:40 +0100 Subject: [PATCH] message d'erreur quand pas de PHP5 ou pas de driver de DB --- bazdig/codepress/languages/sql.css | 16 ++++++++-------- bazdig/console/index.php | 31 +++++++++++++++++++------------ 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/bazdig/codepress/languages/sql.css b/bazdig/codepress/languages/sql.css index d146f8f..55e939c 100755 --- a/bazdig/codepress/languages/sql.css +++ b/bazdig/codepress/languages/sql.css @@ -1,9 +1,9 @@ -/* - * CodePress color styles for SQL syntax highlighting - * By Merlin Moncure +/* + * CodePress color styles for SQL syntax highlighting + * By Merlin Moncure */ - b {color:blue;font-style:normal;font-weight:bold;} /* reserved words */ -u {color:blue;font-style:normal;} /* types */ -a {color:fuchsia;font-style:normal;font-weight:bold;} /* commands */ -i, i b, i u, i a, i s {color:silver;font-weight:normal;font-style:italic;} /* comments */ -s, s b, s u, s a, s i {color:#2A00FF;font-weight:normal;} /* strings */ +b {color:blue;font-style:normal;} /* reserved words */ +u {color:blue;font-style:normal;} /* types */ +a {color:fuchsia;font-style:normal;} /* commands */ +i, i b, i u, i a, i s {color:silver;font-weight:normal;font-style:italic;} /* comments */ +s, s b, s u, s a, s i {color:#2A00FF;font-weight:normal;} /* strings */ diff --git a/bazdig/console/index.php b/bazdig/console/index.php index 7364af6..7f86847 100644 --- a/bazdig/console/index.php +++ b/bazdig/console/index.php @@ -1,4 +1,8 @@ phpversion()) { + $error = "ERROR Bazdig works only with PHP5. sorry."; + die("
$error
"); + } session_start(); define('WARAQ_ROOT', '../..'); @@ -10,6 +14,19 @@ header('Location: '. $bazdig->get('/db')->url ); } + $bazdig_db = $bazdig->getparam('db')->file; + if (!is_writable($bazdig_db)) { + $error = "WARNING your history database is not writeable. chmod 777 ". $bazdig->file ." && chmod 666 $bazdig_db"; + echo "
$error
"; + } + + try { + $work_db = new BDB(array('type' => $_SESSION['db_type'], 'name' => $_SESSION['db_name'], 'host' => $_SESSION['db_host']), $_SESSION['db_user'], $_SESSION['db_password']); + } catch (Exception $e) { + $error = "ERROR check that the PDO_SQLITE and PDO_MYSQL modules are installed"; + die("
$error
"); + } + ?> @@ -18,12 +35,6 @@ -getparam('db')->file; - if (!is_writable($bazdig_db)) { - echo '
WARNING your history database is not writeable. chmod 777 '. $bazdig->file .' && chmod 666 '. $bazdig_db .'
'; - } -?> @@ -37,10 +48,8 @@ -
$_SESSION['db_type'], 'name' => $_SESSION['db_name'], 'host' => $_SESSION['db_host']), $_SESSION['db_user'], $_SESSION['db_password']); +
+name; $dbLocation = $work_db->host; if ($work_db->type == 'sqlite' || $work_db->type == 'sqlite2') { @@ -50,8 +59,6 @@ if ($_SESSION['db_type']) { echo "

".$dbName."

"; echo " @". $dbLocation; echo $work_db->httpGet($bazdig->get('/db/schema/')); -} - ?>
-- 2.11.4.GIT