joonty/vdebug — pull request #153 by ragol (2014-04-16 13:40:31+00:00)
Title: Sort path maps by remote path length

When there are path maps defined for a directory and a subdirectory it
is necessary to use the best match. For example, if there is a mapping
like

path_maps = {
"/var/www/foo" : "/home/user/projects/foo",
"/var/www/foo/include/libbar" : "/home/user/projects/bar"
}

a request for `/var/www/foo/include/libbar/file.php` matches both maps
defined above. Since `path_maps` is an unordered dictionary there is no
way to know what the result of the translation will be. Therefore it is
better to iterate over the dictionary in a well defined order starting
with the most specific, i.e. longest path.