[wp-hackers] WordPress versions <-> functions map
leonid at mamchenkov.net
Sat Sep 29 16:03:08 GMT 2007
On 9/29/07, Viper007Bond <viper at viper007bond.com> wrote:
> I've been thinking about this for the past half hour or so and I actually
> think it'd be a lot, lot easier than I had previously thought. Infact, I
> think I might actually be able to pull it off!
Here is a little help to get you started.
Generating a list of functions per WP version is a once off operation
(only needs to be repeated for each new version coming out). I guess
doing it in command line is simpler and shorter than in PHP. Here is
a working example, which I ran in a tags/ directory checked out from
for DIR in * ; do cd $DIR && echo "Working on $DIR" && grep '^function
' `find | grep '.php' | grep -v '.svn'` | sed -e 's/^.*:function //'
-e 's/(.*$//' | sort | uniq > "../$DIR.txt" && cd .. ; done
It works for about half a minute on my ancient laptop and produces a
list of text files like:
In each of those files there is an alphabetically sorted list of
functions for that version. One function per line with no parameters
or anything. The list of functions looks something like:
With something as trivial as grep and diff you can find the
differences between version and all version where the function exists,
and from there - when it was first defined.
Overall it works pretty good for something I spent 10 minutes on. The
things that you should keep in mind are:
- the above looks for function definitions which only happen in .php
files and start from the beginning of line.
- the above doesn't care if the php file was actually included or not,
or if the function is commented out via multiline comment
And just to give a digital candy to anyone who finished reading this
long email, here are some simple stats from the resulting files.
Number of functions per WordPress version:
More information about the wp-hackers