traverse folders in php to search in shared files

makeshift fix for https://github.com/owncloud/core/issues/10009 

@karlitschek @DeepDiver1975 @craigpg needed for 7.0.1

Why makeshift, you ask? The solution uses the same directory traversing as searchByMime ... which is a performance nightmare and ugly. But it works.

@icewind1991 @PVince81 @schiesbn We definitely need to come up with a better solution... I still vote for a n:m relation table between share and files. Yes it takes longer to share hundreds of files ... but it is a much cleaner solution and allows us to use joins and let the db do it's magic.