marmelab / phpcr-api
PHPCR API provides an API to explore PHPCR repositories.
Installs: 2 036
Dependents: 2
Suggesters: 0
Security: 0
Stars: 11
Watchers: 13
Forks: 2
Open Issues: 0
Requires
- php: >=5.3.3
- phpcr/phpcr-implementation: 2.1.*
- symfony/yaml: ~2.4
Requires (Dev)
- jackalope/jackalope-doctrine-dbal: 1.1.*
- jackalope/jackalope-jackrabbit: 1.1.*
- ptrofimov/xpmock: 1.1.5
Suggests
- jackalope/jackalope-doctrine-dbal: To connect to a Doctrine DBAL content repository, 1.1.*
- jackalope/jackalope-jackrabbit: To connect to a Jackrabbit content repository, 1.1.*
This package is auto-updated.
Last update: 2020-04-04 09:42:41 UTC
README
Archived Repository This code is no longer maintained. Feel free to fork it, but use it at your own risks. |
PHPCR API
PHPCR API provides an API to explore PHPCR repositories. The current implementation supports Jackalope Jackrabbit and Doctrine DBAL.
Installation
The recommended way to install phpcr-api
is through Composer. Just create a
composer.json
file, and run the composer install
command to
install it:
{ "require": { "marmelab/phpcr-api": "dev-master" } }
Usage
$repositoriesConfig = array( 'Repository Test' => array( 'factory' => 'jackalope.jackrabbit', 'parameters' => array( 'jackalope.jackrabbit_uri' => 'http://localhost:8080/server', 'credentials.username' => 'admin', 'credentials.password' => 'admin' ) ), 'Repository Test2' => array( 'factory' => 'jackalope.doctrine-dbal', 'parameters' => array( 'jackalope.doctrine_dbal_connection' => $dbalConnectionInstance, 'credentials.username' => 'admin', 'credentials.password' => 'admin' ) ) ); $loader = new \PHPCRAPI\API\RepositoryLoader($repositoriesConfig); $repositoryTest = new \PHPCRAPI\API\Manager\RepositoryManager( $loader->getRepositories()->get('Repository Test') ); $session = $repositoryTest->getSessionManager('MyWorkspace'); $rootNode = $session->getNode('/');
The factory
setting is the type of PHPCR repository you want to browse. See available factories in config/factories.yml.
See src/PHPCRAPI/API/Manager to discover all available methods.
License
This application is available under the MIT License, courtesy of marmelab.