Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
pad committed Nov 11, 2010
1 parent a5b6c20 commit 4bdc054
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -547,7 +547,7 @@ website:
.PHONY:: tags visual db

tags:
./pfff_tags -verbose -lang ml .
./stags -verbose -lang ml .
db:
./pfff_db_light -verbose -lang ml -o DB_LIGHT .

Expand Down
15 changes: 14 additions & 1 deletion lang_php/analyze/database_php_build.ml
Expand Up @@ -623,6 +623,12 @@ let index_db1_2 db files =
* do not add it otherwise id will not be a primary key.
*)
| Ast.FinalDef _ -> ()
(* do we want to add the NotParsedCorrectly in the db ? It
* can be useful in the code visualizer to have all
* the elements in a file, including the one that do not
* parse.
* Note that this id does not have a id_kind for now.
*)
| _ ->
let id = db +> add_toplevel2 file (topelem, info_item) in
Common.push2 id all_ids;
Expand Down Expand Up @@ -1393,9 +1399,16 @@ let create_db


(*****************************************************************************)
(* Misc operations *)
(* Fast db construction *)
(*****************************************************************************)

(* The goal here is to build a database containing enough context, enough
* relevant files, to be able to do interesting global analysis on a file
* passed as a parameter to one of our command line program.
*)
let fast_create_db_mem ?phase files_or_dirs =
raise Todo

(*****************************************************************************)
(* Main entry for Arg *)
(*****************************************************************************)
Expand Down
6 changes: 6 additions & 0 deletions lang_php/analyze/database_php_build.mli
Expand Up @@ -12,6 +12,12 @@ val create_db :
Database_php.project ->
Database_php.database

(* use Include_require_php.recursive_included_files_of_file *)
val fast_create_db_mem:
?phase:int ->
Common.path list ->
Database_php.database

(* wrapper that makes it easier for some code to not depend on database_php *)
val build_entity_finder:
Database_php.database -> Ast_entity_php.entity_finder
Expand Down
6 changes: 5 additions & 1 deletion lang_php/analyze/foundation/database_php.ml
Expand Up @@ -1016,7 +1016,11 @@ let col_of_id id db =
fullid.EC.column

let kind_of_id id db =
db.defs.id_kind#assoc id
try
db.defs.id_kind#assoc id
(* probably because of NotParsedCorrectly entities *)
with Not_found ->
EC.IdMisc

let readable_filename_of_id id db =
let file = filename_of_id id db in
Expand Down

0 comments on commit 4bdc054

Please sign in to comment.