dantleech/phpcr-generator

There is no license information available for the latest version (0.1) of this package.

Fixture generastor for PHPCR

Maintainers

👁 dantleech

Package info

github.com/dantleech/phpcr-generator

pkg:composer/dantleech/phpcr-generator

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

0.1 2014-10-16 14:33 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

Unknown License 5f4895af82c841cdd1b49d05cec7353c4d80055f

  • Daniel Leech <daniel.woop@dantleech.com>

This package is auto-updated.

Last update: 2026-06-29 00:58:35 UTC


README

👁 Image

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.