3mg/russian-post-bundle 问题修复 & 功能扩展

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

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

3mg/russian-post-bundle

最新稳定版本:v0.1

Composer 安装命令:

composer require 3mg/russian-post-bundle

包简介

Бандл для работы с сервисом отслеживания Почты России

关键字:

README 文档

README

Библиотека для работы с сервисом отслеживания Почты России. Можно использовать standalone и как symfony bundle.

Installation

There are two recommended ways to install the bundle via Composer:

  • using the composer require command:
composer require '3mg/russian-post-bundle:dev-master'
  • adding the dependency to your composer.json file:
"require": {
    ..
    "3mg/russian-post-bundle" : "dev-master",
    ..
}

if it fails try add

"minimum-stability": "dev",

Using with symfony

add to AppKernel.php

...
new a3mg\RussianPostBundle\a3mgRussianPostBundle(),
...

add to config.yml

...
# a3mgRussianPostBundle
a3mg_russian_post:
    login: 'your_login'
    password: 'your_password'
...

get service

$api = $this->container->get('russian_post_api');

try {
    /** @var \a3mg\RussianPostBundle\Model\OperationHistoryData $object */
    $object = $api->getTrackOperationHistory("EE123456785KR");
    ...
} catch (\a3mg\RussianPostBundle\Exception\InvalidTrackException $e) {
    ...
} catch (\a3mg\RussianPostBundle\Exception\RussianPostApiException $e) {
    ...
}

Using stand alone

use a3mg\RussianPostBundle\Service\RussianPostApiFactory;
...
$api = RussianPostApiFactory::createApi("your_login", "your_password");
try {
    /** @var \a3mg\RussianPostBundle\Model\OperationHistoryData $object */
    $object = $api->getTrackOperationHistory("EE123456785KR");
    ...
} catch (\a3mg\RussianPostBundle\Exception\InvalidTrackException $e) {
    ...
} catch (\a3mg\RussianPostBundle\Exception\RussianPostApiException $e) {
    ...
}

Development

Updating api model

  • composer install
  • composer run-script build_rus_post
  • composer run-script build_rus_post_metadata

Run tests

./vendor/bin/phpunit --config phpunit.xml.dist

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-04