phpDocumentor: The Frustration
Mar. 17th, 2008 10:04 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
At work, as previously mentioned, I'm a great champion of phpDocumentor, and I take some pride of being the moving (read: nagging) force that resulted in our now having a repository of generated documentation for the core parts of our system. Unfortunately, there's a bug that prevents us from running it on the entire codebase, so we have to run it in pieces on the really interesting bits—run it on our whole codebase and it'll eat up all memory and die horribly. (It even dies on my desktop, which has a respectable 4 GiB of RAM. It really shouldn't. Our codebase isn't huge.)
One solution that has been proposed (as seen on the previously referenced bug page) is to move the data handling part of the documentor to a[n] SQLite database instead of keeping it all in memory. Apparently, PHP's string handling is rather inefficient, and there are a lot of cross references—this is why we use a parsing documentor rather than something that merely reads docblock headers, after all!
So I figure, what the hell, I have some free time to kill, I'm an open source geek, and improving this would make work life easier. At the same time, I can't afford to do this at work—or rather, my company can't afford to spend developer time on external tools rather than our own software—so I figured I might spend some evenings taking a look at this and seeing if I can make any headway.
A quick look at the codebase tells me that…well, the phpDocumentor code references all the memory bits through arrays rather than method calls, and it makes use of a lot of public class members. In fact, if I make all the member variables of one of the classes I suspect would need some surgery protected, the program ceases to work. There are many classes, many with a good ten or twenty public variables, promiscuously referencing the public members of other classes (ohoho), and no data encapsulation API whatsoever to hijack.
I'd like to see this improve. I'm presently a bit uncertain of whether I'd really like to spend my free time on it…