Skip to content

Commit da76df9

Browse files
committed
Added jackalope-fs transport
1 parent 33dbe4f commit da76df9

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
lines changed

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
"behat/behat": "~3.0.0",
2121
"phpspec/phpspec": "2.0",
2222
"jackalope/jackalope-doctrine-dbal": "~1.1",
23-
"jackalope/jackalope-jackrabbit": "~1.1"
23+
"jackalope/jackalope-jackrabbit": "~1.1",
24+
"jackalope/jackalope-fs": "dev-master"
2425
},
2526
"suggest": {
2627
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal",
27-
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope jackrabbit"
28+
"jackalope/jackalope-jackrabbit": "To connect to jackalope jackrabbit",
29+
"jackalope/jackalope-jackrabbit-fs": "To connect to jackalope jackalope-fs"
2830
},
2931
"license": "MIT",
3032
"authors": [

src/PHPCR/Shell/Console/Command/ShellCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function configure()
6060
new InputOption('--db-path', '-dP', InputOption::VALUE_REQUIRED, 'Database Path.'),
6161
new InputOption('--no-interaction', null, InputOption::VALUE_NONE, 'Turn off interaction (for testing purposes)'),
6262
new InputOption('--repo-url', '-url', InputOption::VALUE_REQUIRED, 'URL of repository (e.g. for jackrabbit).', 'http://localhost:8080/server/'),
63+
new InputOption('--repo-path', '-path', InputOption::VALUE_REQUIRED, 'Path to repository (e.g. for Jackalope FS).', '/home/myuser/www/myproject/app/data'),
6364

6465
new InputOption('--profile', '-p', InputOption::VALUE_OPTIONAL, 'Speicfy a profile name, use wit <info>--transport</info> to update or create'),
6566
new InputOption('--unsupported', null, InputOption::VALUE_NONE, 'Show all commands, including commands not supported by the repository'),

src/PHPCR/Shell/DependencyInjection/Container.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Container extends ContainerBuilder
1919
protected $transports = array(
2020
'transport.transport.doctrinedbal' => 'PHPCR\Shell\Transport\Transport\DoctrineDbal',
2121
'transport.transport.jackrabbit' => 'PHPCR\Shell\Transport\Transport\Jackrabbit',
22+
'transport.transport.fs' => 'PHPCR\Shell\Transport\Transport\JackrabbitFs',
2223
);
2324

2425
public function __construct($mode = self::MODE_STANDALONE)

src/PHPCR/Shell/Subscriber/ProfileFromSessionInputSubscriber.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function handleProfileInit(ProfileInitEvent $e)
2929
'db-path' => 'db_path',
3030
'db-driver' => 'db_driver',
3131
'repo-url' => 'repo_url',
32+
'repo-path' => 'repo_path',
3233
);
3334

3435
$phpcrOptions = array(
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace PHPCR\Shell\Transport\Transport;
4+
5+
use Symfony\Component\Console\Input\InputInterface;
6+
use PHPCR\Shell\Transport\TransportInterface;
7+
use Jackalope\RepositoryFactoryFilesystem;
8+
9+
class JackalopeFs implements TransportInterface
10+
{
11+
public function getName()
12+
{
13+
return 'jackalope-fs';
14+
}
15+
16+
public function getRepository(array $config)
17+
{
18+
$params = array(
19+
'path' => $config['repo_path'],
20+
);
21+
$factory = new RepositoryFactoryFilesystem();
22+
$repository = $factory->getRepository($params);
23+
24+
return $repository;
25+
}
26+
}

0 commit comments

Comments
 (0)