Put phi-search and this script into load-path and (require 'phi-search-dired). Then you can invoke the command with "M-x phi-search-dired" in a dired buffer.