trainjunkies/hsp 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

trainjunkies/hsp

Composer 安装命令:

composer require trainjunkies/hsp

包简介

National Rail HSP API

README 文档

README

Build Status

PHP API to consume National Rail Historical Services Performance API.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. Also instructions on consuming the API in your project.

Installation

To consume the NRE Data Feeds in your project, require the package via composer.

composer.phar require trainjunkies/hsp

To query the API configure the Client with your own API credentials from National Rail Datafeeds

<?php

include __DIR__ . '/vendor/autoload.php';

$client = \Trainjunkies\Hsp\ClientFactory::create(
    'USERNAME',
    'PASSWORD'
);

try {
    $result = $client->getServiceDetails('SOME-RID-VALUE');
} catch (Exception $e) {
    die($e->getMessage());
}

Development / Testing installation

For development you will require your flavour of Docker and Git installed.

git clone git@github.com:trainjunkies/hsp.git

And in the directory where you'e cloned the project...

docker-compose up -d --build

This will provision the hsp container, installing required PHP libraries & Xdebug.

Running the tests

Explain how to run the automated tests for this system

Unit/Spec tests

docker-compose run --rm hsp bin/phpspec r

Integration suite

To query a valid Service Details request against the HSP API

docker-compose run --rm hsp bin/phpunit

Code style checker

For consistency...

docker-compose run --rm hsp bin/phpcs --standard=PSR2 src/

Debugging with Xdebug

Xdebug is enabled within the container by default with the settings specified in docker-compose.yml

By default Xdebug will attempt to connect to 10.254.254.254 on port 9000. To facilitate this you can alias 127.0.0.1 to this address using the below instructions.

DockerForMac

sudo ifconfig lo0 alias 10.254.254.254

Ubuntu

sudo ifconfig lo:1 10.254.254.254 up

You should now be able to use Xdebug by setting PHPStorm to listen for connections.

NOTE: The path mapping should be /var/www to your project directory. NOTE: Further configuration to your IDE might be required to listen to incomming Xdebug connections. With the below example in PHPStorm a "server" needs to be defined for trainjunkies_hsp_dev_container

docker-compose run --rm -e PHP_IDE_CONFIG="serverName=trainjunkies_hsp_dev_container" hsp bin/phpspec r spec/Trainjunkies/Hsp/ClientSpec.php 

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固