Run Magento through PHPXref – Find those Pesky Methods
I was getting frustrated from guessing at Magento’s methods & where they were inherited from, when I remembered poking around another proprietary set of functions. Just what was that wonderful profiling software? Turns out it’s called PHPXref (The PHP Cross Referencing Documentation Utility). And it’s really helpful!
It takes a code base with properly-formatted comments (I didn’t know that there was such a thing–apparently the software that creates it is called phpdoc), and returns an hypertext document that maps all the classes and methods! Super handy, so long as the comments are formatted correctly.
It’s easy to download PHPXref install and run. This is what you’ll see at the command line as this thing working:
bens:htdocs ben$ perl phpxref.plPHPXref 0.7 (c) Gareth Watts 2000-2007 Processing Unnamed Project... Source.............: /Users/ben/Sites/phpxref/htdocs/source Target.............: /Users/ben/Sites/phpxref/htdocs/output Scanning Tree......: OK - 6408 files to process Pass One...........: 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% Generating Output..: 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% Variable references: 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% Function references: 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% Class references...: 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% Constant references: 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% Table references...: Some values were referenced in require and include statements for which no value could be found in the configuration file so cross-referencing may be incomplete: Unknown constant names (ref count): S (17), T (15), P (6), _ (44), M (4), C (38), D (1), I (9) Unknown variable names (ref count): $store (2), $classFile (1), $fileName (2), $version (3), $data (1), $className (1), $compilerConfig (1), $sqlFile (1) Summary statistics: Files Scanned: 6408 containing 1121497 lines 12609 variable names in 53952 definitions and 360667 references. 12534 function/method names in 26631 definitions and 164348 references. 333 constant names in 410 definitions and 1638 references. 4207 class names in 4217 definitions and 11080 references. 0 table names in 0 references. Local front page URL: file:///Users/ben/Sites/phpxref/htdocs/output/index.html
So now, I can look into all these Models and see what the heck I need to get at.
Yeah, so it’s apparent that I need an IDE.
2010.01.02:7:09 pm