PHPackages                             dimanzver/sxgeo - 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. dimanzver/sxgeo

ActiveLibrary

dimanzver/sxgeo
===============

1.0.3(1y ago)03.9kPHPPHP &gt;5.3

Since Dec 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dimanzver/sxgeo)[ Packagist](https://packagist.org/packages/dimanzver/sxgeo)[ RSS](/packages/dimanzver-sxgeo/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

Sypex Geo service provider for Silex
====================================

[](#sypex-geo-service-provider-for-silex)

Usage
-----

[](#usage)

### 1. Set path to database in your app

[](#1-set-path-to-database-in-your-app)

```
$app['sypex_geo'] = [];
$app['sypex_geo']['database'] = 'SxGeoCity.dat';
```

### 2. Register «SypexGeoServiceProvider» in your app

[](#2-register-sypexgeoserviceprovider-in-your-app)

```
$app->register(new \Astartsky\SypexGeo\Silex\SypexGeoServiceProvider());
```

### 3. Extend your application class with «SypexGeoTrait»

[](#3-extend-your-application-class-with-sypexgeotrait)

```
class AwesomeApplication extends \Silex\Application
{
    ...
    use SypexGeoTrait;
    ...
}
```

### 4. Enjoy your new integration! :)

[](#4-enjoy-your-new-integration-)

```
$city = $app->getSypexGeoAdapter()->getCity(**IP**)
var_dump($city);
```

Output will be like this:

```
object(Astartsky\SypexGeo\Bean\City)[613]
  protected 'id' => int 524901
  protected 'latitude' => float 55.75222
  protected 'longitude' => float 37.61556
  protected 'nameRu' => string 'Москва' (length=12)
  protected 'nameEn' => string 'Moscow' (length=6)
  protected 'region' =>
    object(Astartsky\SypexGeo\Bean\Region)[612]
      protected 'id' => int 524894
      protected 'iso' => string 'RU-MOW' (length=6)
      protected 'nameRu' => string 'Москва' (length=12)
      protected 'nameEn' => string 'Moskva' (length=6)
      protected 'country' =>
        object(Astartsky\SypexGeo\Bean\Country)[611]
          protected 'id' => int 185
          protected 'iso' => string 'RU' (length=2)
          protected 'latitude' => int 60
          protected 'longitude' => int 100
          protected 'nameRu' => string 'Россия' (length=12)
          protected 'nameEn' => string 'Russia' (length=6)
```

Update on «composer install» command
------------------------------------

[](#update-on-composer-install-command)

### 1. Put «post-install-cmd» event to composer.json

[](#1-put-post-install-cmd-event-to-composerjson)

```
"scripts": {
        "post-install-cmd": [
            "Astartsky\\SypexGeo\\Composer::installDatabases"
        ]
    }
```

### 2. Put «extra» settings to composer.json

[](#2-put-extra-settings-to-composerjson)

```
"extra": {
        "sypex_geo_update": "https://sypexgeo.net/files/SxGeoCity_utf8.zip",
        "sypex_geo_database": "SxGeoCity.dat"
    }
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~1147 days

Total

4

Last Release

714d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/006e8107d5fbf667c096b1166b783731b29c76de4763430d12579595010cb539?d=identicon)[dimanzver](/maintainers/dimanzver)

---

Top Contributors

[![astartsky](https://avatars.githubusercontent.com/u/1963041?v=4)](https://github.com/astartsky "astartsky (3 commits)")[![dimansuvorlinda](https://avatars.githubusercontent.com/u/34809155?v=4)](https://github.com/dimansuvorlinda "dimansuvorlinda (1 commits)")[![dimanzver](https://avatars.githubusercontent.com/u/50018287?v=4)](https://github.com/dimanzver "dimanzver (1 commits)")[![Fewald](https://avatars.githubusercontent.com/u/5081488?v=4)](https://github.com/Fewald "Fewald (1 commits)")

### Embed Badge

![Health badge](/badges/dimanzver-sxgeo/health.svg)

```
[![Health](https://phpackages.com/badges/dimanzver-sxgeo/health.svg)](https://phpackages.com/packages/dimanzver-sxgeo)
```

PHPackages © 2026

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