PHPackages                             omnilight/yii2-sypexgeo - 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. omnilight/yii2-sypexgeo

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

omnilight/yii2-sypexgeo
=======================

Yii2 extension for Sypex Geo API (http://sypexgeo.net)

1.0.0(11y ago)17102.0k↓36.7%10[2 PRs](https://github.com/omnilight/yii2-sypexgeo/pulls)PHPPHP &gt;=5.4.0

Since Dec 2Pushed 4y ago3 watchersCompare

[ Source](https://github.com/omnilight/yii2-sypexgeo)[ Packagist](https://packagist.org/packages/omnilight/yii2-sypexgeo)[ RSS](/packages/omnilight-yii2-sypexgeo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Yii2 extension for Sypex Geo API ()
========================================================

[](#yii2-extension-for-sypex-geo-api-httpsypexgeonet)

This extension adds support for Sypex Geo to the Yii2 framework

**Note:** This is *not* the fork of the [JiSoft/yii2-sypexgeo](https://github.com/JiSoft/yii2-sypexgeo)!

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist omnilight/yii2-sypexgeo "*"

```

or add

```
"omnilight/yii2-sypexgeo": "*"
```

to the `require` section of your composer.json.

What it is all about?
---------------------

[](#what-it-is-all-about)

Sypex Geo - product for location by IP address. Obtaining the IP address, Sypex Geo outputs information about the location of the visitor - country, region, city, geographical coordinates and other in Russian and in English. Sypex Geo use local compact binary database file and works very quickly. For more information visit:

This is extension for Yii2 framework that makes it easy to deal with Sypex Geo.

Usage
-----

[](#usage)

Unfortunately original version of Sypex Geo does not support Composer installation, so we have to include it into this extension.

First of all, you have to download desired database from the  website and place it somewhere on your server.

There are two classes in this extension.

**Sypexgeo** - this is the component that can be used to retrive Geo information based on IP address. This component incapsulates calls to the SxGeo methods.

You can use it as an application component:

```
// config.php
[
    'components' => [
        'sypexGeo' => [
            'class' => 'omnilight\sypexgeo\SypexGeo',
            'database' => '@app/data/SxGeoCity.dat',
        ]
    ]
]

// somewhere in your code
$city = Yii::$app->sypexGeo->getCity($ip);
```

Also you can create instance by yourself:

```
$sypexGeo = new omnilight\sypexgeo\Sypexgeo([
    'database' => '@app/data/SxGeoCity.dat',
]);
$city = $sypexGeo->getCity($ip);
```

**GeoBehavior** - behavior that can be attached to the `yii\web\Request` or it's children and this class adds methods to simplify getting Geo information for current request.

Example:

```
// config.php
[
    'components' => [
        'request' => [
            'as sypexGeo' => [
                'class' => 'omnilight\sypexgeo\GeoBehavior',
                // It is not required to define property sypexGeo if you have sypexGeo component defined
                // in your application
                'sypexGeo' => [
                    'database' => '@app/data/SxGeoCity.dat',
                ]
            ]
        ]
    ],
]

// In your code
$city = Yii::$app->request->getCity();
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

4185d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3dd587176cd9b14be73e1ccba507b3fc44f5cc8008ffd073d32bbb8c3a7fda04?d=identicon)[omnilight](/maintainers/omnilight)

---

Top Contributors

[![omnilight](https://avatars.githubusercontent.com/u/3306537?v=4)](https://github.com/omnilight "omnilight (6 commits)")

---

Tags

yii2geosypexgeo

### Embed Badge

![Health badge](/badges/omnilight-yii2-sypexgeo/health.svg)

```
[![Health](https://phpackages.com/badges/omnilight-yii2-sypexgeo/health.svg)](https://phpackages.com/packages/omnilight-yii2-sypexgeo)
```

###  Alternatives

[eseath/sypexgeo

A PHP package for working with the SypexGeo database file.

13176.3k](/packages/eseath-sypexgeo)[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)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)

PHPackages © 2026

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