https://github.com/doctrine/phpcr-odm
Doctrine PHPCR ODM
https://github.com/doctrine/phpcr-odm
Last synced: about 1 year ago
JSON representation
Doctrine PHPCR ODM
- Host: GitHub
- URL: https://github.com/doctrine/phpcr-odm
- Owner: doctrine
- License: mit
- Created: 2011-02-10T21:22:18.000Z (over 15 years ago)
- Default Branch: 2.0.x
- Last Pushed: 2025-03-24T05:40:23.000Z (over 1 year ago)
- Last Synced: 2025-04-28T02:27:40.149Z (over 1 year ago)
- Language: PHP
- Homepage: http://www.doctrine-project.org/projects/phpcr-odm.html
- Size: 6.48 MB
- Stars: 182
- Watchers: 12
- Forks: 99
- Open Issues: 64
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# PHPCR ODM for Doctrine
[](https://github.com/doctrine/phpcr-odm/actions/workflows/test-application.yaml)
[](https://packagist.org/packages/doctrine/phpcr-odm)
[](https://packagist.org/packages/doctrine/phpcr-odm)
## Requirements
* libxml version >= 2.7.0 (due to a bug in libxml [http://bugs.php.net/bug.php?id=36501](http://bugs.php.net/bug.php?id=36501))
* [composer](http://getcomposer.org/)
* See also the `require` section of [composer.json](composer.json)
## Documentation
Please refer to [doctrine-project.org](http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/) for the documentation.
## Contributing
Pull requests are welcome. Please include tests to prevent regressions whenever
possible.
Thanks to
[everyone who has contributed](https://github.com/doctrine/phpcr-odm/contributors) already.
## Running the tests
There are separate test setups for the `doctrine-dbal` and the `jackrabbit` PHPCR implementations.
Before installing the composer dependencies, you will need to prepare the database for storage and
choose a `phpcr/phpcr-implementation`.
Doing so will change the `composer.json` file - please make sure you do not check in this change
into version control.
### Setting up to test with Jackrabbit
1. Make sure you have `java` and `wget` installed, then run this script to install and start jackrabbit:
```
tests/script_jackrabbit.sh
```
2. Require the PHPCR implementation:
```
composer require jackalope/jackalope-jackrabbit --no-update
```
3. Now you can install all dependencies with:
```
composer install
```
4. Now you can run the tests:
```
vendor/bin/phpunit -c tests/phpunit_jackrabbit.xml.dist
```
You can also copy the phpunit dist file to `./phpunit.xml` to have it selected by default, or
if you need to customize any configuration options.
### Setting up to test with Doctrine-DBAL
1. For `doctrine-dbal`, make sure that MySQL is installed. If the connection parameters in
`cli-config.doctrine_dbal.php.dist` are not correct, manually create `cli-config.php` and adjust
the options as needed. Then run the script to initialize the repository in the database:
```
tests/script_doctrine_dbal.sh
```
2. Require the PHPCR implementation
```
composer require jackalope/jackalope-doctrine-dbal --no-update
```
3. Now you can install all dependencies with:
```
composer install
```
4. Now you can run the tests:
```
vendor/bin/phpunit -c tests/phpunit_doctrine_dbal.xml.dist
```
You can also copy the phpunit dist file to `./phpunit.xml` to have it selected by default, or
if you need to customize any configuration options.