Add check which function to get cacheDir is valid

To avoid getting fatal errors.
Exporter: use is_array before uri check

because Erfurt_Uri::check is not able to ignore given
arrays and it will throw warnings.