PHP code example of marmelab / phpcr-api

1. Go to this page and download the library: Download marmelab/phpcr-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

marmelab / phpcr-api example snippets


$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('/');