rozdol/dates

针对塞浦路斯东正教日历的日期处理

v1.0.2 2018-06-14 20:20 UTC

This package is auto-updated.

Last update: 2024-09-25 22:44:12 UTC


README

关于

专门针对塞浦路斯东正教日历,用于本地项目和库。

安装

切换到your_project_root_dir

composer require rozdol/dates:"v1.*"

在表或模型或控制器中

use Rozdol\Dates\Dates;
$this->dates = new Dates();
$date_normalized = $this->dates->F_date('01/01/20', 1); // 01.01.2020

单元测试

切换到dates

composer update rozdol/dates

进行测试

./vendor/bin/phpunit tests/

创建库教程

cd dates
composer update
git init
git .
git commit -m 'Initial commit'

在github上创建仓库

git remote add origin git@github.com:rozdol/dates.git
git push origin master
  • 在github上添加新版本(v1.0.0)
  • 在packagist上更新包
  • 登录packagist.org
  • 提交https://github.com/rozdol/dates

准备在项目中使用

切换到your_project_root_dir

composer require rozdol/dates:"v1.*"

在表或模型或控制器中

use Rozdol\Dates\Dates;
$this->dates = new Dates();
$date_normalized = $this->dates->F_date('01/01/20', 1); // 01.01.2020

连接Github到Packagist

在Github->设置->集成..->添加->Packagist用户:packagist用户api_key:packagist->用户->个人资料->显示API密钥域:https://packagist.org.cn

测试:在Github上新版本发布并检查Packagist中的版本

单元测试

安装本地phpunit

composer require --dev phpunit/phpunit ^6
mkdir tests
cd tests
mkdir TestCase
cd TestCase
mkdir Funcs

编辑DatesTest.php

切换到dates

composer update rozdol/dates

进行测试

./vendor/bin/phpunit tests/

Travis CI

git checkout -b travis
git add .travis.yml
git push origin travis
从原始源分离
git remote -v
git remote remove origin
git remote add origin git@github.com:rozdol/dates.git
git push origin random_changes