PHPackages                             hrevert/ht-country-module - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hrevert/ht-country-module

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hrevert/ht-country-module
=========================

A Zend Framework 2 module for country and subdivision data.

1.0.1(11y ago)350MITPHPPHP &gt;=5.4

Since Nov 16Pushed 11y ago1 watchersCompare

[ Source](https://github.com/hrevert/HtCountryModule)[ Packagist](https://packagist.org/packages/hrevert/ht-country-module)[ Docs](https://github.com/ojhaujjwal/HtCountryModule)[ RSS](/packages/hrevert-ht-country-module/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

HtCountryModule
===============

[](#htcountrymodule)

[![Master Branch Build Status](https://camo.githubusercontent.com/21b93751e77672b3efd651b733a5a4aca4c669a8b6401c7f760f980cd622841c/68747470733a2f2f7472617669732d63692e6f72672f687265766572742f4874436f756e7472794d6f64756c652e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/hrevert/HtCountryModule)[![Latest Stable Version](https://camo.githubusercontent.com/42df1d5957d5daf72eeb743bac9a1707778d1abf66cce2a50a56242464a82739/68747470733a2f2f706f7365722e707567782e6f72672f687265766572742f68742d636f756e7472792d6d6f64756c652f762f737461626c652e706e67)](https://packagist.org/packages/hrevert/ht-country-module)[![Total Downloads](https://camo.githubusercontent.com/902d6bdd2c38f33a94e82e0d213f414be87b1ff0cee4883d8e9e3b09662000d7/68747470733a2f2f706f7365722e707567782e6f72672f687265766572742f68742d636f756e7472792d6d6f64756c652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/hrevert/ht-country-module)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e7e8129a5ef56eab9036d9ae8f5335b3eb53a6df018e07518d77a924f0709dbe/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f687265766572742f4874436f756e7472794d6f64756c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/hrevert/HtCountryModule/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/4b63df8767af5d79290f10632726a8d5affe3d542379062dd495bdc1e07e712d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f687265766572742f4874436f756e7472794d6f64756c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/hrevert/HtCountryModule/?branch=master)

A Zend Framework 2 module for country and subdivision data. This module integrates [lib-country](https://github.com/phine/lib-country) with [Zend Framework 2](https://github.com/zendframework/zf2).

Requirements
------------

[](#requirements)

- [lib-country](https://github.com/phine/lib-country)
- [Zend Framework 2](https://github.com/zendframework/zf2)

Usage
-----

[](#usage)

Please read the docs of [lib-country](https://github.com/phine/lib-country) first.

### Using Services

[](#using-services)

```
// From ServiceManager
/** @var Phine\Country\Loader\Loader $countryLoader */
$countryLoader = $serviceManager->get('CountryLoader');
```

### Using hydrator strategy

[](#using-hydrator-strategy)

```
$strategy = new HtCountryModule\Hydrator\Strategy\CountryStrategy;
// or $strategy = $serviceManager->get('HtCountryModule\Hydrator\Strategy\CountryStrategy');

/** @var Phine\Country\Country $country */
$country = $strategy->hydrate('US');

echo $strategy->extract($country); // will print US
```

### Using country validator

[](#using-country-validator)

```
$validator = new HtCountryModule\Validator\CountryValidator;
// or $validator = $serviceManager->get('ValidatorManager')->get('CountryValidator');
var_dump($validator->isValid('asdfasfd')); // bool(false)
var_dump($validator->isValid('US')); // bool(true)
```

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

[](#installation)

- Add `"hrevert/ht-country-module": "1.0.*"` to composer.json and run `php composer.phar update`
- Register `HtCountryModule` as module in `config/application.config.php`

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~4 days

Total

2

Last Release

4194d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a78ca1505c93127e0ac82e195481baf87cb6f3fae3bd4dcc18b5cfb85ce425ed?d=identicon)[hrevert](/maintainers/hrevert)

---

Top Contributors

[![ojhaujjwal](https://avatars.githubusercontent.com/u/4995501?v=4)](https://github.com/ojhaujjwal "ojhaujjwal (22 commits)")

---

Tags

ZendFrameworkmodulezf2locationgeographycountry

### Embed Badge

![Health badge](/badges/hrevert-ht-country-module/health.svg)

```
[![Health](https://phpackages.com/badges/hrevert-ht-country-module/health.svg)](https://phpackages.com/packages/hrevert-ht-country-module)
```

###  Alternatives

[kartik-v/yii2-ipinfo

An IP address information display widget for Yii 2.0 with country flag and geo position info.

2832.6k1](/packages/kartik-v-yii2-ipinfo)[akrabat/akrabat-session

A Zend Framework 2 module for configuring sessions

134.5k](/packages/akrabat-akrabat-session)[dkcwd/dkcwd-zf2-munee

Zend Framework 2 module leveraging 'munee' an asset optimisation library developed by Cody Lundquist. You can find munee at http://github.com/meenie/munee

102.1k](/packages/dkcwd-dkcwd-zf2-munee)

PHPackages © 2026

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