Hello,
Long time lurker, first time poster here.
Lately I've been dealing with the hassle of inheriting a MONSTROUS codebase/database legacy system at my company. It's so big, and so wierdly dynamic, that there's really no way to look through the code and figure out what's going on.
I've been trying to figure out how to make sense of this system, so the first thing I did was come up with an RDB schema that describes all the information that matters to me in regards to this system.
I first made a list of all the ENTITIES:
1. machines
2. databases
3. database tables
4. php files
5. static files
6. cron files
I then made a list of all the relationships that matter:
1. databases, php/static files live on machines
2. tables are in databases
3. php files include other php files
4. php files access static files
5. cron jobs execute php files, access static files
6. php files connect to database
7. php files access database tables
My goal is to fill out these relational schema with actual data, which I can then view as a topic map, RDF, or in a web-app.
What I need to do is somehow configure my system to track these actions (the relations) in real-time.
My tools, from what I can see, are:
1. auto_prepend
2. register_shutdown_function, coupled with get_included_files
3. override_function, from the APD library
Has anyone else done this kind of task before? I would imagine the information gleaned from such data would be extremely useful; I sure wish I had it at my last 3 legacy coding jobs.
unfortunately, I can't find any examples of override_function in actual use, other than the doc example, which doesn't even use a real function as an example.
for example, can you override a function, then have the overriding function call the original function? If it replaces the function in the funtion table, I would think not, but then how else can I wrap run-time logging of function calls around functions like fopen, mysql_connect, include, mysql_query, etc?
This is a linux/apache system, so if anyone knows of a solution that works at the server level, then that would be great.
If I get this tool finished, I'll happily release it (logging tools, RDB schema, viewer app) to the community.
Anyone care to advise?
2.