RandomLib icon indicating copy to clipboard operation
RandomLib copied to clipboard

MacOS metadata files break the library

Open jay-knight opened this issue 2 years ago • 0 comments

We ran into a problem where some MacOS metadata files (see https://apple.stackexchange.com/questions/14980/why-are-dot-underscore-files-created-and-how-can-i-avoid-them) got included in the deployment to production. This broke the library because files like vendor/ircmaxell/random-lib/lib/RandomLib/Mixer/._McryptRijndael128.php existed, and AbstractFactory::loadFiles() tried to load them, resulting in

PHP Fatal error: Uncaught ReflectionException: Class RandomLib\\Mixer\\._McryptRijndael128 does not exist in
[snip]/vendor/ircmaxell/security-lib/lib/SecurityLib/AbstractFactory.php:50 

Redeploying without those files fixed the problem.

However, consider adding a check that the file is a "real" php file. Or perhaps catch that exception, error_log() a message and skip that file.

jay-knight avatar Dec 12 '23 17:12 jay-knight