The logic to read all files
within a module directory may cause a PHP warning, if PHP is configured with a restrictive open_basedir setting.
The related entry in the errolog.txt is like:
We should not do a check like
since this concatenates a wrong path string in case of an file...
It is better to use DirectoryIterator with DirectoryIterator.isFile() or DirectoryIterator.isDir()