avtonom / geocoder-bundle

Sypex-geo 地理编码器包,用于 PHP 的 Symfony2 扩展包

安装: 7

依赖者: 0

建议者: 0

安全性: 0

星标: 1

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

v1.1.1 2017-01-16 09:46 UTC

This package is not auto-updated.

Last update: 2024-09-23 14:04:17 UTC


README

页面包: https://github.com/Avtonom/geocoder-bundle

安装步骤

在你的项目根目录下运行以下命令,假设你的项目已配置好 composer

composer.phar require avtonom/geocoder-bundle ~1.1

切换到最新标签 ~1.1

将包添加到 app/AppKernel.php

$bundles(
    ...
            new Bazinga\Bundle\GeocoderBundle\BazingaGeocoderBundle(),
            new YamilovS\SypexGeoBundle\YamilovsSypexGeoBundle(),
            new Avtonom\GeocoderBundle\AvtonomGeocoderBundle(),
    ...
);

配置选项 (config.yaml)

yamilovs_sypex_geo:
    database_path: "%kernel.root_dir%/../var/SypexGeoDatabase/SxGeoCity.dat"

bazinga_geocoder:
    providers:
        chain:
            providers: [avtonom_geocoder.geocoder.sypex_geo]

更新地理数据库

php ./app/console yamilovs:sypex-geo:update-database-file
or
cd ./var/SypexGeoDatabase/
wget https://sypexgeo.net/files/SxGeoCity_utf8.zip -o  ./SxGeoCity.dat
unzip SxGeoCity_utf8.zip