A PHP 7.1 application uses composer's autoloader to find class definitions. The namespace mappings are defined in a composer.json
file.
The application also uses ICU module's ResourceBundle
classes to load localisable texts from *.res
files. Each class with localisable texts has its own set of *.res
files (one file per language). The code providing the localisation supports gets a fully qualified name of the class whose texts it should load.
I would like to have the *.res
files located next to their respective class files (or in a subfolder, for example /locale/
). For this I would welcome if I can somehow get the class file path without reimplementing the existing code in the composer's autoloader.
Ideally, I should be able to get the path without the need to instantiate the class and get its file location somehow.
Is this approach possible? What do you propose?