]> dev.renevier.net Git - syp.git/blobdiff - api.php
improve wizard (hand editing of settings.php is no more needed)
[syp.git] / api.php
diff --git a/api.php b/api.php
index a9df091477a85e509b4b71e9ed1c7ba3001d15dc..0d6e7273349f9bcfd98307c817a97072dab9906b 100644 (file)
--- a/api.php
+++ b/api.php
@@ -2,10 +2,6 @@
 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
    license. */
 
-require_once ("./inc/settings.php");
-require_once ("./inc/db/mysql.php");
-require_once ("./inc/utils.php");
-
 function exit_document ($body) {
     exit ("<html><head></head><body>$body</body></html>");
 }
@@ -314,6 +310,12 @@ function main ($con) {
     server_error ();
 }
 
+if (!@include_once ("./inc/settings.php")) {
+    server_error ();
+}
+require_once ("./inc/db/mysql.php");
+require_once ("./inc/utils.php");
+
 try {
     $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
 } catch (Exception $e) {