-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathcli-config.php.dist
40 lines (33 loc) · 1.47 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* This is a sample bootstrap file for the console. All jackalope variants
* provide their own bootstrap file. This file is only relevant for people
* implementing PHPCR and using the phpcr-utils.
*/
$path_to_jackalope = __DIR__.'/../jackalope';
// $autoload was created in the autoload that is included before this.
$autoload->add('Jackalope', "$path_to_jackalope/src");
/* credentials you plan to use */
$jackrabbit_url = 'http://127.0.0.1:8080/server/';
$workspace = 'default';
$user = 'admin';
$pass = 'admin';
if (isset($argv[1])
&& $argv[1] != 'list'
&& $argv[1] != 'help'
) {
/* bootstrapping the repository implementation. for jackalope with jackrabbit, do this: */
$factory = new \Jackalope\RepositoryFactoryJackrabbit;
$repository = $factory->getRepository(array("jackalope.jackrabbit_uri" => $jackrabbit_url));
$credentials = new \PHPCR\SimpleCredentials($user, $pass);
$session = $repository->login($credentials, $workspace);
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'phpcr' => new \PHPCR\Util\Console\Helper\PhpcrHelper($session),
'phpcr_console_dumper' => new \PHPCR\Util\Console\Helper\PhpcrConsoleDumperHelper(),
));
if (class_exists('Symfony\Component\Console\Helper\QuestionHelper')) {
$helperSet->set(new \Symfony\Component\Console\Helper\QuestionHelper(), 'question');
} else {
$helperSet->set(new \Symfony\Component\Console\Helper\DialogHelper(), 'dialog');
}
}