eleme / fix-zeus
只是想修改zeus数据
0.1.2
2014-11-07 09:08 UTC
Requires
- php: >=5.3.3
- eleme/thrift-php: 0.9.1
- fzaninotto/faker: 1.4.0
Requires (Dev)
- phpunit/phpunit: 4.3.3
- raveren/kint: 1.0.*@dev
This package is not auto-updated.
Last update: 2024-09-24 02:52:36 UTC
README
- 感谢 fzaninotto/Faker;
- fix-zeus使用Faker创建随机数据
- 只是想修改zeus数据,为什么?我不想太依赖于zeus!
#使用方法
##使用Composer安装
- 在项目中require fix-zeus
"require": {
"eleme/fix-zeus": "~0.1"
}
##使用fix-zeus修改日期
- 基本用法
use Fixzeus\Factory;
$nSpace = array(
"namespace" => "thrift service name" . "_",
"gfix" => "GfixService_" //example
)
$path //the special file's absolute path, the json file format see below
$fixZeusFactory = new Factory($nSpace, $path);
$fixResutl = $fixZeusFactory->fix($service, $method);
- $service:你在thrift文件中定义的命名空间
- $method:你在thrift服务中定义的方法
###自定义或指定一个值 要定义一个你想要的值,你只需编写一个如下的json文件,并将文件的绝对路径传递给入口函数:Factory::fix($service, $method, $path)
- define_value:为变量自定义值
- range_value:为变量指定范围(目前仅支持这些类型:integer/date/time/datetime/unixtime/user_agent)
{
"define_value": {
"name": "cjp",
"age": "22"
},
"range_value": {
"integer": {
"type": "integer",
"min": "1",
"max": "10"
},
"date": {
"type": "date",
"format": "Y-m-d",
"max": "2014-11-11"
},
"time": {
"type": "time",
"format": "H:i:s",
"max": "22:22:22"
},
"datetime": {
"type": "datetime",
"format": "Y-m-d H:i:s",
"min": "2013-11-11 22:22:22",
"max": "2014-11-11 22:22:22"
},
"unixtime": {
"type": "unixtime",
"max": "now"
},
"user_agent": {
"type": "userAgent",
"value": "chrome/firefox/safari/opera/internetExplorer"
}
}
}