Skip to content

Commit 5c57236

Browse files
committed
Added jackalope-fs transport
1 parent d273468 commit 5c57236

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
@@ -18,11 +18,13 @@
1818
"behat/behat": "~2.5",
1919
"phpspec/phpspec": "2.0",
2020
"jackalope/jackalope-doctrine-dbal": "~1.1",
21-
"jackalope/jackalope-jackrabbit": "~1.1"
21+
"jackalope/jackalope-jackrabbit": "~1.1",
22+
"jackalope/jackalope-fs": "dev-master"
2223
},
2324
"suggest": {
2425
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal",
25-
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope jackrabbit"
26+
"jackalope/jackalope-jackrabbit": "To connect to jackalope jackrabbit",
27+
"jackalope/jackalope-jackrabbit-fs": "To connect to jackalope jackalope-fs"
2628
},
2729
"license": "MIT",
2830
"authors": [

src/PHPCR/Shell/Console/Application/ShellApplication.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ protected function registerTransports()
7777
$transports = array(
7878
new \PHPCR\Shell\Transport\Transport\DoctrineDbal($this->profile),
7979
new \PHPCR\Shell\Transport\Transport\Jackrabbit($this->profile),
80+
new \PHPCR\Shell\Transport\Transport\JackalopeFs($this->profile),
8081
);
8182

8283
foreach ($transports as $transport) {

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/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)