PHP code example of marmelab / phpcr-api-silex-provider

1. Go to this page and download the library: Download marmelab/phpcr-api-silex-provider 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-silex-provider 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(
            'doctrine_dbal.config' => array(
                'driver' => 'pdo_sqlite',
                'path' => '../src/app.db',
            ),
            'credentials.username' => 'admin',
            'credentials.password' => 'admin'
        )
    )
);

$app->register(new \PHPCRAPI\Silex\ApiServiceProvider(),array(
    'phpcr_api.repositories_config' =>  $repositoriesConfig,
    'phpcr_api.mount_prefix'    =>  '/api'
));