Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class "Sokil\IsoCodes\IsoCodesFactory" not found #77

Open
hashimaziz1 opened this issue Jan 8, 2024 · 3 comments
Open

Class "Sokil\IsoCodes\IsoCodesFactory" not found #77

hashimaziz1 opened this issue Jan 8, 2024 · 3 comments

Comments

@hashimaziz1
Copy link

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?

@sokil
Copy link
Owner

sokil commented Jan 10, 2024

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

@hashimaziz1
Copy link
Author

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".

@sokil
Copy link
Owner

sokil commented Jan 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants