dantleech/phpcr-generator
Composer 安装命令:
composer require dantleech/phpcr-generator
包简介
Fixture generastor for PHPCR
README 文档
README
Small library for generating node data for benchmarking, testing, etc.
Example
Basic
$converter = new NodeConverter($phpcrSession); $builder = new NodeBuilder('node', 'nt:unstructured'); $builder->node('content', 'nt:unstructured') ->node('article1') ->property('title', 'My first article') ->property('body', 'My first article body') ->end() ->node('article2') ->property('title', 'My first article') ->property('body', 'My first article body') ->end() ->end(); $this->converter->convert($this->builder); $phpcrSession->save();
Will result in:
node/
article1/
- title: My First Article
- body: My First Article body
article2/
- title: My First Article
- body: My First Article body
Ranges
You can also specify ranges in the node name:
$builder->node('content-[1-5]', 'nt:unstructured') ->node('article[1-10]') ->property('title', 'My first article') ->property('body', 'My first article body') ->end() ->end();
Will result in 50 nodes being created.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2014-10-16