rozdol / mt940
Mt940 解析器
v1.0.18
2019-07-28 22:19 UTC
Requires
- php: >=5.6
- rozdol/bi: ^1.0
Requires (Dev)
README
关于
TM940 表述语句解析器
灵感来源于 jejik-mt940 (https://github.com/sandermarechal/jejik-mt940)
安装
切换到 your_project_root_dir
composer require rozdol/mt940:"v1.*"
在表、模型或控制器中
use Rozdol\Mt940\Mt940; $this->mt940 = new Mt940(); $data=[...]; $result = $this->utils->mt940($data);
单元测试
切换到 mt940
composer update rozdol/mt940
进行测试
./vendor/bin/phpunit tests/
Compose 库教程
cd mt940 composer update git init git . git commit -m 'Initial commit'
在 github 上创建仓库
git remote add origin git@github.com:rozdol/mt940.git git push origin master
- 在 github 上添加新版本(v1.0.0)
- 在 Packagist 上更新包
- 登录到 packagist.org
- 提交
https://github.com/rozdol/mt940
准备在项目中使用
切换到 your_project_root_dir
composer require rozdol/mt940
在表、模型或控制器中
use Rozdol\Mt940\Mt940; $this->mt940 = new Mt940(); $date_normalized = $this->mt940->F_date('01/01/20', 1); // 01.01.2020
连接 Github 到 Packagist
在 Github->设置->集成..->添加->Packagist 用户: packagist user api_key: packagist->用户->个人资料->显示 API KEY 域名: https://packagist.org.cn
测试:在 Github 上发布新版本并检查 Packagist 中的版本
单元测试
安装本地 phpunit
composer require --dev phpunit/phpunit ^6
mkdir tests cd tests mkdir TestCase cd TestCase mkdir Funcs
编辑 mt940Test.php
切换到 mt940
composer update rozdol/mt940
进行测试
./vendor/bin/phpunit tests/
在 GitHub 项目 / 设置 / 服务 / 添加 Packagist
User: rozdol Token: https://packagist.org.cn/profile/ -> Your API Token Domain: https://packagist.org.cn Active: true Add Service: click
Travis CI
git checkout -b travis git add .travis.yml git push origin travis
在 GitHub 项目 / 设置 / 服务 / 添加 Packagist
User: rozdol Token: https://travis-ci.org/profile/rozdol -> Copy API Token Domain: notify.travis-ci.org Active: true Add Service: click
进入 Travis 按 + , 滑动激活
从原始源代码分离
git remote -v git remote remove origin git remote add origin git@github.com:rozdol/mt940.git git push origin random_changes