定制 phpfacile/geocoding-db-zend 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phpfacile/geocoding-db-zend

Composer 安装命令:

composer require phpfacile/geocoding-db-zend

包简介

Service mainly aimed at storing in database (using zend-db) a location retrieved thanks to phpfacile/geocoding

README 文档

README

This service store in database (using zend-db) a location retrieved using phpfacile/geocoding (Cf. https://github.com/phpfacile/geocoding).

Installation

At the root of your project type

composer require phpfacile/geocoding-db-zend

Or add "phpfacile/geocoding-db-zend": "^1.0" to the "require" part of your composer.json file

"require": {
    "phpfacile/geocoding-db-zend": "^1.0"
}

Usage

Step 1 : Adapter instanciation

Instanciate a Zend Adapter to allow a connexion to a database.

Example with SQLite (for test purpose only)

$config = [
    'driver' => 'Pdo_Sqlite',
    'database' => 'my_database.sqlite',
];
$adapter = new Zend\Db\Adapter\Adapter($config);

Example with MySQL

$config = [
    'driver' => 'Pdo_Mysql',
    'host' => 'localhost'
    'dbname' => 'my_database',
    'user' => 'my_username',
    'password' => 'my_password',
];
$adapter = new Zend\Db\Adapter\Adapter($config);

Step 2 : LocationService instanciation

use PHPFacile\Geocoding\Db\Service\LocationService;

$locationService = new LocationService($adapter);

Step 3 : Store a location and/or get it's id if already in database

Assuming you've got a $location StdClass retrieved from a previous phpfacile/geocoding query:

$id = $locationService->getIdOfStdClassLocationAfterInsertIfNeeded($location)

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-11-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固