I'm trying to write a custom vhost hook for Aegir3 and I need to get the site's docroot path. I can see that the info I want is being passed in the second variable ($data) but I can't figure out how to access it. It seems like there is an object $data['server'] that is of a custom Provision_Context_server class.
Can anyone provide an example or point me at some documentation on how to interact with that? I was hoping to be able to just use $data['server']['services']['http']['context']['site']['root'] but that doesn't seem to work.
EDIT: I managed to get to the data as follows, but it's an ugly hack:
preg_match('/"root";s:\d*:"(.*?)"/', serialize($data), $aryMatches);
$docRoot = $aryMatches[1];
d()->root
would probably be what you need. The drush_log command on the page mentioned above is the best way to see what data you've actually got.