Skip to content

Added jackalope-fs transport #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
dev-master
----------

- [transport] Added transport layer for experimental Jackalope FS implementation
- [global] Refactored to use DI container and various general improvements
- [node:references] Shows the referencing node paths instead of the referrered-to node path(s)

Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
"behat/behat": "~3.0.0",
"phpspec/phpspec": "2.0",
"jackalope/jackalope-doctrine-dbal": "~1.1",
"jackalope/jackalope-jackrabbit": "~1.1"
"jackalope/jackalope-jackrabbit": "~1.1",
"jackalope/jackalope-fs": "dev-master"
},
"suggest": {
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal",
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope jackrabbit"
"jackalope/jackalope-jackrabbit": "To connect to jackalope jackrabbit",
"jackalope/jackalope-jackrabbit-fs": "To connect to jackalope jackalope-fs"
},
"license": "MIT",
"authors": [
Expand Down
2 changes: 2 additions & 0 deletions src/PHPCR/Shell/Console/Application/EmbeddedApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public function __construct($mode)
$container = new Container($this->mode);
parent::__construct($container, SessionApplication::APP_NAME, SessionApplication::APP_VERSION);
$this->setAutoExit(false);

// @deprecated This will be removed in 1.0
$this->getHelperSet()->set(new PhpcrHelper($container->get('phpcr.session_manager')));
}

Expand Down
1 change: 1 addition & 0 deletions src/PHPCR/Shell/Console/Command/ShellCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function configure()
new InputOption('--db-path', '-dP', InputOption::VALUE_REQUIRED, 'Database Path.'),
new InputOption('--no-interaction', null, InputOption::VALUE_NONE, 'Turn off interaction (for testing purposes)'),
new InputOption('--repo-url', '-url', InputOption::VALUE_REQUIRED, 'URL of repository (e.g. for jackrabbit).', 'http://localhost:8080/server/'),
new InputOption('--repo-path', '-path', InputOption::VALUE_REQUIRED, 'Path to repository (e.g. for Jackalope FS).', '/home/myuser/www/myproject/app/data'),

new InputOption('--profile', '-p', InputOption::VALUE_OPTIONAL, 'Speicfy a profile name, use wit <info>--transport</info> to update or create'),
new InputOption('--unsupported', null, InputOption::VALUE_NONE, 'Show all commands, including commands not supported by the repository'),
Expand Down
1 change: 1 addition & 0 deletions src/PHPCR/Shell/DependencyInjection/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Container extends ContainerBuilder
protected $transports = array(
'transport.transport.doctrinedbal' => 'PHPCR\Shell\Transport\Transport\DoctrineDbal',
'transport.transport.jackrabbit' => 'PHPCR\Shell\Transport\Transport\Jackrabbit',
'transport.transport.fs' => 'PHPCR\Shell\Transport\Transport\JackalopeFs',
);

public function __construct($mode = self::MODE_STANDALONE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function handleProfileInit(ProfileInitEvent $e)
'db-path' => 'db_path',
'db-driver' => 'db_driver',
'repo-url' => 'repo_url',
'repo-path' => 'repo_path',
);

$phpcrOptions = array(
Expand Down
26 changes: 26 additions & 0 deletions src/PHPCR/Shell/Transport/Transport/JackalopeFs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace PHPCR\Shell\Transport\Transport;

use Symfony\Component\Console\Input\InputInterface;
use PHPCR\Shell\Transport\TransportInterface;
use Jackalope\RepositoryFactoryFilesystem;

class JackalopeFs implements TransportInterface
{
public function getName()
{
return 'jackalope-fs';
}

public function getRepository(array $config)
{
$params = array(
'path' => $config['repo_path'],
);
$factory = new RepositoryFactoryFilesystem();
$repository = $factory->getRepository($params);

return $repository;
}
}