forked from phpcr/phpcr-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli-config.php.dist
26 lines (20 loc) · 949 Bytes
/
cli-config.php.dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
/* add your namespaces to class loader. for jackalope, do something like this */
$path_to_jackalope = __DIR__.'/../jackalope';
// classLoader was created in the autoload that is included before this.
$classLoader->registerNamespaces(array(
'Jackalope' => "$path_to_jackalope/src",
'PHPCR' => "$path_to_jackalope/lib/phpcr/src",
));
/* credentials you plan to use */
$url = 'http://127.0.0.1:8080/server/';
$workspace = 'default';
$user = 'admin';
$pass = 'admin';
/* bootstrapping the repository implementation. for jackalope with jackrabbit, do this: */
$repository = \Jackalope\RepositoryFactoryJackrabbit::getRepository(array("jackalope.jackrabbit_uri" => $url));
$credentials = new \PHPCR\SimpleCredentials($user, $pass);
$session = $repository->login($credentials, $workspace);
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'session' => new \PHPCR\Util\Console\Helper\PhpcrHelper($session)
));