I develop git repository, that contains only one useful file data.json
. Another repo which I develop in parallel is php implementation of idea.
And now I need to load list from data.json
, parse it and then use. First and most obvious idea was write some Loader class, which will try to access this file by 2 ways:
__DIR__ . '/../vendor/ely/anti-tempmail-list/data.json
. That case will be worked if we have library itself with its dependencies.__DIR__ . '/../../anti-tempmail-list/data.json
. That case will be worked if library is included as another composer dependency.
But it's a bit horrible, 'cause crawl on file system is "dirty". And in case of package replacement (hello forks) it will stop working.
Another solution is create in reference repository some language-dependent Loader classes, which will be implement loading for data file. But I'm not sure that this is also a good solution...
So I ask you, how should I organize communication with the reference repository (data.json) to implementation by some programming language?
P.S. reference repo contains russian README, but on release it will be translated as it should be ;)