php-isocodes
php-isocodes copied to clipboard
Class "Sokil\IsoCodes\IsoCodesFactory" not found
Got this error in my XAMPP dev environment after running:
composer require --dev sokil/php-isocodes-db-only
And calling the library with the following code from the docs:
$isoCodes = new \Sokil\IsoCodes\IsoCodesFactory();
$country = $isoCodes->getCountries()->getByAlpha2('UA');
Any idea why this is?
Library sokil/php-isocodes-db-only does not require sokil/php-isocodes where class \Sokil\IsoCodes\IsoCodesFactory stored.
Install both library and required files explicitely as described in documentation:
Installation
To install "sokil/php-isocodes" library with full database and i18n files:
composer require sokil/php-isocodes sokil/php-isocodes-db-i18n
You may also install "sokil/php-isocodes" with only database (no i18n will be available):
composer require sokil/php-isocodes sokil/php-isocodes-db-only
I see, so you need both php-isocodes
and php-isocodes-db-only
to use the library without localisation? This should probably be made clearer in the documentation, as currently it looks like you only need sokil/php-isocodes
for "manual database installation and updates".
yes, i can't remember now why i made this? but you need to install both lib and db )
php-isocodes - contains php code php-isocodes-db-only - contains only json files, and does not require php-isocodes
so i think i need to remember why i do this and update docs :) or i will add library as dependency.