Skip to content
This repository has been archived by the owner on Nov 7, 2020. It is now read-only.

Rebuild how classes are indexed #12

Open
ghost opened this issue Oct 11, 2013 · 0 comments
Open

Rebuild how classes are indexed #12

ghost opened this issue Oct 11, 2013 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 11, 2013

Created by Mark Story, 11th Dec 2010. (originally Lighthouse ticket #34):


Right now classes are indexed using some mildly hacky regular expressions. It would be a big improvement to use token_get_all() and parse the token stream for class, interface, global function definitions and build the index that way. This would also allow for dependencies to be mapped as well. By looking for extends or implements a full dependency graph could be constructed.

This would have two main benefits. It would allow for ApiGenerator to work on non-cake apps more effectively. Currently its kind of a kludge to get it to work on non-cake apps. It would also allow for neat things like visual graphs to be created with tools like graphviz or canvas.

The indexing process could look something like.

  • Get a list of files to scan.
  • Iterate the list of files and do the following.
    • Scan for class, interface and global functions. Store these in a list of files -> objects
    • Get the extends and implements for any classes. Store these in parent -> children arrays.
    • Create a tree of class dependencies.
    • Traverse the tree and persist values to the database.
  • Having a more complete index, would also make doing things like creating a word index of the doc blocks / methods easier.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

0 participants