phpcr / phpcr-utils
PHP Content Repository implementation independant utilities
Installs: 2 727 513
Dependents: 15
Suggesters: 3
Security: 0
Stars: 72
Watchers: 6
Forks: 30
Open Issues: 14
Requires
- php: ^8.0
- phpcr/phpcr: ~2.1.0
- symfony/console: ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.40
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^7.5 || ^8.0 || ^9.0
- ramsey/uuid: ^3.5
Suggests
- ramsey/uuid: A library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).
Conflicts
- jackalope/jackalope-jackrabbit: <1.2.1
- 2.x-dev
- 2.0.2
- 2.0.1
- 2.0.0
- 1.x-dev
- 1.8.1
- 1.8.0
- 1.7.0
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.x-dev
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.x-dev
- 1.2.11
- 1.2.10
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.2.0-RC2
- 1.2.0-RC1
- 1.1.x-dev
- 1.1.2
- 1.1.1
- 1.1.0
- 1.1.0-RC1
- 1.0.0
- 1.0.0-RC2
- 1.0.0-RC1
- 1.0.0-beta14
- 1.0.0-beta13
- 1.0.0-beta12
- 1.0.0-beta11
- 1.0.0-beta10
- 1.0.0-beta9
- 1.0.0-beta8
- 1.0.0-beta7
- 1.0.0-beta6
- 1.0-beta5
- 1.0-beta4
- 1.0-beta3
- 1.0-beta2
- 1.0-beta1
This package is auto-updated.
Last update: 2024-11-09 16:06:21 UTC
README
Commands and implementations for common tasks for the PHP Content Repository (PHPCR) API.
If you are using or implementing PHPCR you probably want some of the things in here.
PHPCR Users: Note that your PHPCR implementation probably already bundles the utils.
License
This code is dual licensed under the MIT license and the Apache License Version 2.0. Please see the file LICENSE in this folder.
Documentation
The utils bring you a couple of Commands you can use to interact with a PHPCR repository on the command line. Additionally we provide a couple of helper classes for common tasks.
Commands
There are a couple of useful commands to interact with a PHPCR repository.
To use the console, make sure you have initialized the git submodules of
phpcr-utils, then copy cli-config.php.dist to cli-config.php and adjust it
to your implementation of PHPCR. Then you can run the commands from the
phpcr-utils directory with ./bin/phpcr
NOTE: If you are using PHPCR inside of Symfony, the DoctrinePHPCRBundle
provides the commands inside the normal Symfony console and you don't need to
prepare anything special.
To get a list of the available commands, run bin/phpcr
or set the commands up
in your application. Running bin/phpcr help <command-name>
outputs the
documentation of that command.
Helper Classes
The helper classes provide implementations for basic common tasks to help users and implementers of PHPCR. They are all in the namespace PHPCR\Util
PathHelper
Used to manipulate paths. Implementations are recommended to use this, and
applications also profit from it. Using dirname
and similar file system
operations on paths is not compatible with Microsoft Windows systems, thus you
should always use the methods in PathHelper.
NodeHelper
This helper has some generally useful methods like one to generate empty
nt:unstructured
nodes to make sure a parent path exists. It also provides
some useful helper methods for implementations.
UUIDHelper
This little helper is mainly of interest for PHPCR implementers. It generates valid Universally Unique IDs and can determine whether a given string is a valid UUID. We recommend all implementations to use this implementation to guarantee consistent behaviour.
Note
You can use ramsey/uuid library to generate UUIDs. In this case,
install it using Composer and generating UUIDs will be taken over by ramsey/uuid
.
QOM QueryBuilder
The QueryBuilder
is a fluent query builder with method names matching the
Doctrine QueryBuilder
on top of the QOM factory. It is the easiest way to programmatically build a
PHPCR query.
Query Object Model Converter
In the PHPCR\Util\QOM namespace we provide, implementation-independant code to
convert between SQL2 and QOM. Sql2ToQomQueryConverter
parses SQL2 queries
into QOM . QomToSql2QueryConverter
generates SQL2 out of a QOM.
TraversingItemVisitor
This ItemVisitorInterface
implementation is a basic implementation of crawling
a PHPCR tree. You can extend it to define what it should do while crawling the
tree.