PHPackages                             jackalope/jackalope-jackrabbit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. jackalope/jackalope-jackrabbit

ActiveLibrary

jackalope/jackalope-jackrabbit
==============================

Jackalope Transport library for Jackrabbit

2.0.0(2y ago)66912.1k↑12.3%27[7 issues](https://github.com/jackalope/jackalope-jackrabbit/issues)[1 PRs](https://github.com/jackalope/jackalope-jackrabbit/pulls)20MITPHPPHP ^8.0

Since Mar 10Pushed 2y ago11 watchersCompare

[ Source](https://github.com/jackalope/jackalope-jackrabbit)[ Packagist](https://packagist.org/packages/jackalope/jackalope-jackrabbit)[ Docs](http://jackalope.github.com)[ RSS](/packages/jackalope-jackalope-jackrabbit/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (38)Used By (20)

Jackalope Jackrabbit
====================

[](#jackalope-jackrabbit)

[![Build Status](https://camo.githubusercontent.com/1beb0d220f54ad33631e6f0155c1ea339b1910e424a326b60643f92681d0ec46/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6a61636b616c6f70652f6a61636b616c6f70652d6a61636b7261626269742e706e673f6272616e63683d322e78)](http://travis-ci.org/jackalope/jackalope-jackrabbit)[![Latest Stable Version](https://camo.githubusercontent.com/7632c99e568566953f99727b41925e7a35ceaf8833c7fbddbe5a0aa4424a23a5/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b616c6f70652f6a61636b616c6f70652d6a61636b7261626269742f76657273696f6e2e706e67)](https://packagist.org/packages/jackalope/jackalope-jackrabbit)[![Total Downloads](https://camo.githubusercontent.com/902b38b9375d57d668081de90eea07ee43a845d756ac7090fadc558d6ab5ec86/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b616c6f70652f6a61636b616c6f70652d6a61636b7261626269742f642f746f74616c2e706e67)](https://packagist.org/packages/jackalope/jackalope-jackrabbit)

Jackalope is a powerful implementation of the PHP Content Repository API ([PHPCR](http://phpcr.github.io)).

Jackalope-Jackrabbit is using the jackrabbit JCR server as storage engine.

Discuss on or visit #jackalope on irc.freenode.net

License
-------

[](#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.

Preconditions
=============

[](#preconditions)

- libxml version &gt;= 2.7.0 (due to a bug in libxml )
- libcurl (if you get `Problem (2) in the Chunked-Encoded data` with version 7.35, try updating your curl version)
- [composer](http://getcomposer.org/)

Installation
============

[](#installation)

The recommended way to install jackalope is through [composer](http://getcomposer.org/).

```
$ mkdir my-project
$ cd my-project
$ composer init
$ composer require jackalope/jackalope-jackrabbit
```

Jackrabbit storage server
-------------------------

[](#jackrabbit-storage-server)

Besides the Jackalope repository, you need the Jackrabbit server component. For instructions, see [Jackalope Wiki](https://github.com/jackalope/jackalope/wiki/Running-a-jackrabbit-server)Make sure you have at least the version specified in [the VERSION constant of the protocol implementation](https://github.com/jackalope/jackalope-jackrabbit/blob/master/src/Jackalope/Transport/Jackrabbit/Client.php)

phpunit tests
-------------

[](#phpunit-tests)

If you want to run the tests, please see the [README file in the tests folder](https://github.com/jackalope/jackalope-jackrabbit/blob/master/tests/README.md)and check if you told composer to install the suggested dependencies (see Installation)

Enable the commands
-------------------

[](#enable-the-commands)

There are a couple of useful commands to interact with the repository.

To use the console, copy cli-config.php.dist to cli-config.php and configure the connection parameters. Then you can run the commands from the jackalope directory with `./bin/jackalope`

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.

There is the Jackalope specific command `jackalope:run:jackrabbit` which you can use to start and stop a jackrabbit standalone server.

You have many useful commands available from the phpcr-utils. To get a list of all commands, type:

```
./bin/jackalope

```

To get more information on a specific command, use the `help` command. To learn more about the `phpcr:workspace:export` command for example, you would type:

```
./bin/jackalope help phpcr:workspace:export

```

Bootstrapping
=============

[](#bootstrapping)

Jackalope relies on autoloading. Namespaces and folders are compliant with PSR-0. You should use the autoload file generated by composer: `vendor/autoload.php`

If you want to integrate jackalope into other PSR-0 compliant code and use your own classloader, find the mapping in `vendor/composer/autoload_namespaces.php`

Once you have autoloading, you need to bootstrap the library. A minimalist sample code to get a PHPCR session with the jackrabbit backend:

```
$jackrabbit_url = 'http://127.0.0.1:8080/server/';
$user           = 'admin';
$pass           = 'admin';
$workspace      = 'default';

$factory = new \Jackalope\RepositoryFactoryJackrabbit();
$repository = $factory->getRepository(
    array("jackalope.jackrabbit_uri" => $jackrabbit_url)
);
$credentials = new \PHPCR\SimpleCredentials($user, $pass);
$session = $repository->login($credentials, $workspace);
```

To use a workspace different than `default` you need to create it first. The easiest is to run the command `bin/jackalope phpcr:workspace:create `but you can of course also use the PHPCR API to create workspaces from your code.

Usage
=====

[](#usage)

The entry point is to create the repository factory. The factory specifies the storage backend as well. From this point on, there are no differences in the usage (except for supported features, that is).

```
// see Bootstrapping for how to get the session.

$rootNode = $session->getNode("/");
$whitewashing = $rootNode->addNode("www-whitewashing-de");
$session->save();

$posts = $whitewashing->addNode("posts");
$session->save();

$post = $posts->addNode("welcome-to-blog");
$post->addMixin("mix:title");
$post->setProperty("jcr:title", "Welcome to my Blog!");
$post->setProperty("jcr:description", "This is the first post on my blog! Do you like it?");

$session->save();
```

See [PHPCR Tutorial](http://phpcr.readthedocs.org/en/latest/book/index.html)for a more detailed tutorial on how to use the PHPCR API.

Query Languages
===============

[](#query-languages)

Jackalope supports the PHPCR standard query language SQL2 as well as the Query Object Model (QOM) to build queries programmatically. We recommend using the QOM or the QueryBuilder mentioned in the [PHPCR Tutorial](http://phpcr.readthedocs.org/en/latest/book/index.html). They are built to use the best possible query language depending on the capabilities of the backend. A later switching to another PHPCR implementation shouldn't cause any issues then.

Jackalope-Jackrabbit also supports the deprecated SQL and XPath query languages from JCR 1.0. Those languages will be supported by Jackrabbit for the foreseeable future, but almost certainly won't be supported by other PHPCR implementations. So use them with care and only if you know what you are doing.

One reason for using SQL or XPath is that the newer and more capable SQL2 is not as optimized as the older languages on the Jackrabbit side. Queries with large result sets are much slower with SQL2 than with XPath or SQL.

However, the best is to use the QueryBuilder mentioned above to let the implementation chose the most efficient query language for your implementation.

Performance tweaks
==================

[](#performance-tweaks)

If you know that you will need many child nodes of a node you are about to request, use the depth hint on Session::getNode. This will prefetch the children to reduce the round trips to the database. It is part of the PHPCR standard. You can also globally set a fetch depth, but that is Jackalope specific: Call Session::setSessionOption with Session::OPTION\_FETCH\_DEPTH to something bigger than 1.

Use Node::getNodeNames if you only need to know the names of child nodes, but don't need the actual nodes. Note that you should not use the typeFilter on getNodeNames with jackalope. Using the typeFilter with getNodes to only fetch the nodes of types that interest you can make a lot of sense however.

Logging
=======

[](#logging)

Jackalope supports logging, for example to investigate the number and type of queries used. To enable logging, provide a logger instance to the repository factory:

```
$factory = new \Jackalope\RepositoryFactoryJackrabbit();
$logger = new Jackalope\Transport\Logging\DebugStack();
$options = array(
    'jackalope.jackrabbit_uri' => $jackrabbit_url,
    'jackalope.logger' => $logger,
);
$repository = $factory->getRepository($options);

...

// at the end, output debug information
var_dump($logger->calls);
```

You can also wrap a [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)compatible logger like [monolog](https://github.com/Seldaek/monolog) with the Psr3Logger class.

Note that when using jackalope in Symfony2, the logger is integrated in the debug toolbar.

Implementation notes
====================

[](#implementation-notes)

See [doc/architecture.md](https://github.com/jackalope/jackalope/blob/master/doc/architecture.md)for an introduction how Jackalope is built. Have a look at the source files and generate the phpdoc.

Not implemented features
========================

[](#not-implemented-features)

The best overview of what needs to be done are the skipped API tests. Have a look at [ImplementationLoader](https://github.com/jackalope/jackalope-jackrabbit/blob/master/tests/inc/ImplementationLoader.php) to see what is currently not working and start hacking :-)

Contributors
============

[](#contributors)

- Christian Stocker
- David Buchmann
- Tobias Ebnöther
- Roland Schilter
- Uwe Jäger
- Lukas Kahwe Smith
- Daniel Barsotti
- [and many others](https://github.com/jackalope/jackalope-jackrabbit/contributors)

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity53

Moderate usage in the ecosystem

Community43

Growing community involvement

Maturity80

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~112 days

Recently: every ~35 days

Total

37

Last Release

776d ago

Major Versions

1.4.4 → 2.0.0-beta12023-02-20

1.x-dev → 2.0.0-beta22024-01-08

PHP version history (7 changes)1.0.0-alpha2PHP &gt;=5.3.2

1.0.0-beta3PHP &gt;=5.3.3

1.3.0PHP ^5.6|^7.0

1.4.0PHP ^7.2

1.4.1PHP ^7.2 || ^8.0

2.0.0-beta1PHP ^7.4 || ^8.0

2.0.0-beta2PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/76576?v=4)[David Buchmann](/maintainers/dbu)[@dbu](https://github.com/dbu)

![](https://avatars.githubusercontent.com/u/328359?v=4)[Luis Cordova](/maintainers/cordoval)[@cordoval](https://github.com/cordoval)

![](https://avatars.githubusercontent.com/u/20873?v=4)[Luke Smith](/maintainers/lsmith)[@lsmith](https://github.com/lsmith)

---

Top Contributors

[![dbu](https://avatars.githubusercontent.com/u/76576?v=4)](https://github.com/dbu "dbu (610 commits)")[![lsmith77](https://avatars.githubusercontent.com/u/300279?v=4)](https://github.com/lsmith77 "lsmith77 (324 commits)")[![chregu](https://avatars.githubusercontent.com/u/47106?v=4)](https://github.com/chregu "chregu (125 commits)")[![beberlei](https://avatars.githubusercontent.com/u/26936?v=4)](https://github.com/beberlei "beberlei (97 commits)")[![ebi](https://avatars.githubusercontent.com/u/11541?v=4)](https://github.com/ebi "ebi (93 commits)")[![Seldaek](https://avatars.githubusercontent.com/u/183678?v=4)](https://github.com/Seldaek "Seldaek (73 commits)")[![lapistano](https://avatars.githubusercontent.com/u/95115?v=4)](https://github.com/lapistano "lapistano (63 commits)")[![rndstr](https://avatars.githubusercontent.com/u/32963?v=4)](https://github.com/rndstr "rndstr (46 commits)")[![nicam](https://avatars.githubusercontent.com/u/182071?v=4)](https://github.com/nicam "nicam (39 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (20 commits)")[![uwej711](https://avatars.githubusercontent.com/u/648874?v=4)](https://github.com/uwej711 "uwej711 (16 commits)")[![justinrainbow](https://avatars.githubusercontent.com/u/86520?v=4)](https://github.com/justinrainbow "justinrainbow (13 commits)")[![alexander-schranz](https://avatars.githubusercontent.com/u/1698337?v=4)](https://github.com/alexander-schranz "alexander-schranz (6 commits)")[![eXsio](https://avatars.githubusercontent.com/u/1942129?v=4)](https://github.com/eXsio "eXsio (5 commits)")[![pitpit](https://avatars.githubusercontent.com/u/283481?v=4)](https://github.com/pitpit "pitpit (4 commits)")[![wouterj](https://avatars.githubusercontent.com/u/749025?v=4)](https://github.com/wouterj "wouterj (3 commits)")[![dantleech](https://avatars.githubusercontent.com/u/530801?v=4)](https://github.com/dantleech "dantleech (3 commits)")[![kea](https://avatars.githubusercontent.com/u/208714?v=4)](https://github.com/kea "kea (3 commits)")[![ornicar](https://avatars.githubusercontent.com/u/140370?v=4)](https://github.com/ornicar "ornicar (3 commits)")[![vdrnn](https://avatars.githubusercontent.com/u/58754?v=4)](https://github.com/vdrnn "vdrnn (3 commits)")

---

Tags

phpcrtransport implementationjackrabbit

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jackalope-jackalope-jackrabbit/health.svg)

```
[![Health](https://phpackages.com/badges/jackalope-jackalope-jackrabbit/health.svg)](https://phpackages.com/packages/jackalope-jackalope-jackrabbit)
```

###  Alternatives

[jackalope/jackalope-doctrine-dbal

Jackalope Transport library for Doctrine DBAL

1503.0M214](/packages/jackalope-jackalope-doctrine-dbal)[phpcr/phpcr-shell

Shell for PHPCR

721.3M8](/packages/phpcr-phpcr-shell)[jackalope/jackalope

Jackalope PHPCR library

2663.2M18](/packages/jackalope-jackalope)[doctrine/phpcr-bundle

Symfony DoctrinePHPCRBundle

1602.6M41](/packages/doctrine-phpcr-bundle)[doctrine/phpcr-odm

PHP Doctrine Content Repository Object Document Mapper (ODM) provides transparent persistence for PHP objects.

1811.5M97](/packages/doctrine-phpcr-odm)[phpcr/phpcr

PHP Content Repository interfaces

4413.2M14](/packages/phpcr-phpcr)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
