]> matita.cs.unibo.it Git - helm.git/blobdiff - daemons/whelp/searchEngine.ml
...
[helm.git] / daemons / whelp / searchEngine.ml
index 8524588ca76ea9b4c557ca266242c2ed98f6a390..533e9df120a5261252d0503c3bb18fec3a8fdb34 100644 (file)
@@ -37,7 +37,7 @@ exception Invalid_action of string  (* invalid action for "/search" method *)
 exception Not_a_MutInd
 
 let daemon_name = "Whelp"
-let configuration_file = "/projects/helm/etc/whelp.conf.xml"
+let configuration_file = "searchEngine.conf.xml"
 
 let placeholders = [
   "ACTION"; "ADVANCED"; "ADVANCED_CHECKED"; "CHOICES"; "CURRENT_CHOICES";
@@ -260,6 +260,7 @@ let send_results results
     moogle_TPL
 
 let exec_action dbd (req: Http_types.request) outchan =
+  let dbd = dbd () in
   let term_str = req#param "expression" in
   try
     if req#path = "/elim" &&
@@ -372,7 +373,7 @@ let exec_action dbd (req: Http_types.request) outchan =
       | "/match" -> Whelp.match_term ~dbd term
       | "/instance" -> Whelp.instance ~dbd term
       | "/hint" ->
-          let status = ProofEngineTypes.initial_status term metasenv in
+          let status = ProofEngineTypes.initial_status term metasenv [] in
           let intros = PrimitiveTactics.intros_tac () in
           let subgoals = ProofEngineTypes.apply_tactic intros status in
           (match subgoals with
@@ -449,7 +450,7 @@ let callback dbd (req: Http_types.request) outchan =
         if expression = "" then
           send_results (`Results []) req outchan
         else begin
-          let results = Whelp.locate ~dbd expression in
+          let results = Whelp.locate ~dbd:(dbd ()) expression in
           let results = List.map UriManager.string_of_uri results in
           send_results (`Results results) req outchan
         end
@@ -505,12 +506,11 @@ let _ =
   printf "HTML directory is %s\n" pages_dir;
   flush stdout;
   Unix.putenv "http_proxy" "";
-  let dbd =
-    HMysql.quick_connect
-      ~host:(Helm_registry.get "db.host")
-      ~database:(Helm_registry.get "db.database")
-      ~user:(Helm_registry.get "db.user")
-      ()
+  let dbd () =
+    let dbd = LibraryDb.instance () in
+    MetadataTypes.ownerize_tables "searchEngine";
+    LibraryDb.create_owner_environment ();
+    dbd
   in
   restore_environment ();
   read_notation ();