philwinkle already posted a link to my old list, but I'm going to go ahead and post what I use to generate event lists. It's longer than it seems like it should be, but that is because of a general lack of coding standards in the framework. Basically, this code will go out and find all events, and attempt to format them for you. If you want, I can run it on 1.5.0.1 and update the blog (would probably be nice to do after so many months, but time is a fickle mistress).
The code:
$results = `ack Mage::dispatchEvent $magento 2>/dev/null | grep -v "app/code/local" | grep -v "downloader/pearlib"`;
$results = explode("\n", $results);
print_error(sprintf("%-100s\t%-4s\t%s\n", "FILE", "LINE", "EVENT"));
foreach($results as $result) {
if(!strlen(trim($result))) { continue; }
$matches = array();
preg_match("/([^:]+):(\d+):\W+(.*)/", $result, $matches);
$file = str_replace($magento, "", $matches[1]);
$line = $matches[2];
$event = $matches[3];
$eventMatches = array();
if(preg_match("/Mage::dispatchEvent\('(\w+)'\);/", $event, $eventMatches)) {
$event = $eventMatches[1];
$matchType = 1;
} else if(preg_match("/Mage::dispatchEvent\('(\w+)',.*/", $event, $eventMatches)) {
$event = $eventMatches[1];
$matchType = 2;
} else if(preg_match("/Mage::dispatchEvent\($/", $event)) {
$event = get_next_line_event($file, $line+1, $magento);
$matchType = 3;
} else if(preg_match("/Mage::dispatchEvent\(\"?(['\$a-zA-Z._{}\-> ]+).*/", $event, $eventMatches)) {
$event = $eventMatches[1];
$matchType = 4;
} else {
print "Found unmatcheable event:\n";
var_dump($event);exit;
}
printf("%-100s\t%-4s\t%s\n", $file, $line, $event);
}
function get_next_line_event($file, $line, $magento) {
$cnt = `cat -n $magento/$file | grep -e "^ *$line"`;
$cnt = preg_replace("/^\s*\d*\s*/", "", $cnt);
$matches = array();
if(preg_match("/^'?([\$a-z_>. -]*)'?,$/i", $cnt, $matches)) {
return $matches[1];
} else if(preg_match("/^([\$a-z_>. '\-\(\)]*),$/i", $cnt, $matches)) {
return $matches[1];
}
print "Found unmatcheable event:\n";
var_dump($cnt);exit;
}
This is part of my homebrew Magento command line toolchain. It will probably only run on Linux, and there may be internal lib functions in there that I can't find. Anyway, hope that gives you an idea about my process!
Thanks,
Joseph Mastey