transformcore / hay-local-health-authority-bundle
通过API公开本地卫生当局数据
v1.0.3
2015-12-14 19:58 UTC
Requires
- php: >=5.5.0
- doctrine/doctrine-bundle: ~1.4
- doctrine/orm: ^2.4.8
- friendsofsymfony/rest-bundle: ^1.7
- friendsofsymfony/user-bundle: ^1.3
- jms/serializer-bundle: ^1.0
- nelmio/api-doc-bundle: ^2.9
- symfony/framework-bundle: ~2.3
- symfony/http-kernel: ~2.3,>=2.3.24
Requires (Dev)
- mockery/mockery: ^0.9.4
- phpunit/phpunit: 4.8.*
- psr/log: 1.0.0
- satooshi/php-coveralls: ^0.6.0@dev
- sensio/framework-extra-bundle: ~3.0
This package is not auto-updated.
Last update: 2019-10-22 18:51:52 UTC
README
##需求
- php 5.5 或更高版本
- 如果需要使用脚手架,则需要 mysql
- 一个正常工作的 symfony2 安装
##安装
$ composer require transformcore/hay-local-health-authority-bundle
在 app/AppKernel.php 中启用它
$bundles = array( // ... other bundles new TransformCore\PHE\LocalHealthAuthorityBundle\TransformCorePHELocalHealthAuthorityBundle(), );
编辑 app/config/routing.yml 文件并添加以下内容
transform_core_phe_local_health_authority: resource: "@TransformCorePHELocalHealthAuthorityBundle/Resources/config/routing.yml" prefix: /lha/
创建/更新架构
$ app/console doctrine:schema:update --force
##从原始数据集导入
将数据集提取到您将记住的目录,然后按顺序运行以下命令,记得用您要导入的文件的日期信息替换 *
###对于县
$ php app/console haytool:lha-counties <path/to/>Documents/County names and codes EN as at *.txt`
###对于地区议会
$ php app/console haytool:lha-district-councils <path/to/>Documents/LA_UA names and code UK as at *.txt`
###对于本地卫生当局
$ php app/console haytool:lha-lha <path/to/>Documents/CCG names and code *.txt // UK $ php app/console haytool:lha-lha <path/to/>Documents/LHB names and code *.txt // Wales $ php app/console haytool:lha-lha <path/to/>Documents/CHP names and code *.txt // Scotland $ php app/console haytool:ha-lha <path/to/>Documents/LCG names and code *.txt // Northern Ireland
###对于选举区
$ php app/console haytool:lha-electoral-wards <path/to/>Documents/Ward names and codes UK as at *.txt
###对于教区议会
$ php app/console haytool:lha-parish-councils <path/to/>Documents/Parish LAD names and codes EW as at *.txt $ php app/console haytool:lha-parish-councils<path/to/>Documents/Unparished areas names and codes EN as at *.txt
###对于当局数据
将 ONSPD_*.csv
从 <extractionPath>/Data
目录复制到包的 Data
目录。然后运行以下命令
sh Scripts/import_authorities.sh
泡些茶,这可能需要一段时间。
要更新任何文件,请运行上述相同的命令
##从固定数据导入
固定数据包含存在于 ONSPD_AUG_2015_UK 版本的邮政编码数据集中的数据集,这可能是过时的,但可以作为测试的良好基线
#Extract the contents of the fixtures archive
$ cd Data/Fixtures
$ tar -xf hay_api.sql.tar.gz
$ mysql -u <yourusername> -p<yourpassword> <your_database_name> < hay_api.sql
#Extract the contents of the postcode to district update set
$ tar -xf lha_websites.sql.tar.gz
$ mysql -u <yourusername> -p<yourpassword> <your_database_name> < lha_websites.sql