Closed MidnightDesign closed 8 years ago
@MidnightDesign Thanks for the issue.
Actually there is. Similar package umpirsky/currency-list is used in moneyphp/money.
See https://github.com/moneyphp/money/blob/master/src%2FISOCurrencies.php#L31-L46.
Do you really think this is the way to go? It seems pretty fragile to me.
@Seldaek Can you give us your Composer-opinion on this?
This is safe as long as there are no batshit crazy custom installers in the game that relocate packages randomly. It's a similar pattern to what we do for binaries to find the autoloader really https://github.com/Seldaek/jsonlint/blob/master/bin/jsonlint#L20 and has the same constraint (no crazy custom installers).
Thanks for your opinion!
But isn't that a little different? In the case you mentioned, you're trying to initialize the autoloader itself. When autoloading is already wired up, I don't think that's the way to do it.
Well.. yeah you can for sure use a class to do the resolution, I am not saying your method is wrong, but IMO both are valid workable solutions. One uses a class as indirection which adds overhead while the other potentially does useless io/filesystem stats, but it's marginal either way I think.
Just wanted to add that it is not a primary use case to use this package with composer. Mainly because it is not limited to PHP at all.
Yeah, I got that. That's why I chose this title for the issue. :)
:)
I'm not sure how this is supposed to be used with Composer. I don't think there is a reliable way to get the location (directory) of the data.
The simplest way around this is with an auto-loaded class that can return the directory the data is located. Would you accept a PR with this addition?
Edit: See my fork.