PHPackages                             zend-modules/isocodes-country - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. zend-modules/isocodes-country

ActiveLibrary

zend-modules/isocodes-country
=============================

19PHP

Since Oct 28Pushed 10y ago1 watchersCompare

[ Source](https://github.com/zend-modules/isocodes-country)[ Packagist](https://packagist.org/packages/zend-modules/isocodes-country)[ RSS](/packages/zend-modules-isocodes-country/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

isocodes-country
================

[](#isocodes-country)

[![Build Status](https://camo.githubusercontent.com/fb5e1d7d0e8dfeb1452b442d44e018a1d32fc89bd8118b26cd2da7ca4cbeaf4b/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7a656e642d6d6f64756c65732f69736f636f6465732d636f756e7472792e7376673f6272616e63683d6d6173746572)](https://secure.travis-ci.org/zend-modules/isocodes-country)

Installation
------------

[](#installation)

1. Add this project in your composer.json:

    ```
    "require": {
        "zend-modules/isocodes-country": "dev-master"
    }
    ```
2. Now tell composer to download `isocodes-country` by running the command:

    ```
    $ php composer.phar update
    ```

Adapters
--------

[](#adapters)

### StaticAdapter

[](#staticadapter)

The static adapter uses an internal array of country names. This is the default adapter as no extra configuration in needed.

```
$countryManager = new \IsoCodes\Country\Country();

```

### Pdo

[](#pdo)

This adapter uses a PDO connection to fetch the data from a database. You have a MySQL dump of the database table in `data\iso_3166.sql`

```
$dbh = new \Pdo('mysql:host:localhost;dbname=isodata;', 'root', '');
$adapter = new \IsoCodes\Country\Adapter\Pdo($dbh);
$countryManager = new \IsoCodes\Country\Country($adapter);

```

You may also pass the `PDO::__construct` parameters.

```
$adapter = new \IsoCodes\Country\Adapter\Pdo(array(
    'dsn'      => 'mysql:host:localhost;dbname=isodata;',
    'username' => 'root',
    'password' => ''
));
$countryManager = new \IsoCodes\Country\Country($adapter);

```

### ZendDB

[](#zenddb)

This adapter uses a `Zend\Db\Adapter\Adapterinterface` object to retrieve country information from a database.

As an example:

```
$dbAdapter      = $serviceManager->get('Zend\Db\Adapter\Adapter');
$adapter        = new \IsoCodes\Country\Adapter\ZendDB($dbAdapter);
$countryManager = new \IsoCodes\Country\Country($adapter);

```

Translating
-----------

[](#translating)

The default output is english.

To change the output locale set the translator's locale to the one that fits your needs. For example, if you wish to output the country names in spanish:

```
$countryManager->getTranslator()->setLocale('es');

```

Data Source
-----------

[](#data-source)

The data provided by this module comes from iso-codes package from Debian.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/88eadf341a8c89449a4172b467aa59dccc90167cfa8ae9badab0434232e2c50d?d=identicon)[JPG-Consulting](/maintainers/JPG-Consulting)

### Embed Badge

![Health badge](/badges/zend-modules-isocodes-country/health.svg)

```
[![Health](https://phpackages.com/badges/zend-modules-isocodes-country/health.svg)](https://phpackages.com/packages/zend-modules-isocodes-country)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
