avtonom / geocoder-bundle
Sypex-geo 地理编码器包,用于 PHP 的 Symfony2 扩展包
v1.1.1
2017-01-16 09:46 UTC
Requires
- php: >=5.3.2
- symfony/dependency-injection: ~2.3|3.*
- willdurand/geocoder-bundle: @stable
- yamilovs/sypex-geo-bundle: ~1.2
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