Fix purging whole cache after importing an .ax file

rework of the change made in 5535 it now catches a few corner cases

git-svn-id: https://svn.muze.nl/svn/ariadne-php5/branches/2.7-fixes@5604 7882d7ee-46e0-0310-a255-a28a61b628e4