Fix PHP warning: invalid argument for foreach, when cache dir is empty and argument is bool:false