Skip to content

Commit a1e677b

Browse files
committed
Merge pull request #98 from phpcr/jackalope-fs
Added jackalope-fs transport
2 parents 33dbe4f + 48ff4ac commit a1e677b

29 files changed

+365
-154
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ php:
99
- 5.4
1010

1111
before_script:
12-
- composer install --dev
12+
- composer require "symfony/symfony" "2.6.*" --no-update
13+
- composer install
1314
- bash tests/bin/travis_jackrabbit.sh
1415

1516
script:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Changelog
44
dev-master
55
----------
66

7+
- [transport] Added transport layer for experimental Jackalope FS implementation
8+
- [node] Added wilcard support to applicable node commands, including "node:list", "node:remove" and "node:property:show"
79
- [global] Refactored to use DI container and various general improvements
810
- [node:references] Shows the referencing node paths instead of the referrered-to node path(s)
911

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"symfony/finder": "~2.3",
1010
"symfony/serializer": "~2.3",
1111
"symfony/yaml": "~2.3",
12-
"symfony/dependency-injection": "~2.3"
12+
"symfony/dependency-injection": "~2.3",
13+
"dantleech/glob": "~0.1"
1314
},
1415
"minimum-stability": "dev",
1516
"require-dev": {
@@ -20,11 +21,13 @@
2021
"behat/behat": "~3.0.0",
2122
"phpspec/phpspec": "2.0",
2223
"jackalope/jackalope-doctrine-dbal": "~1.1",
23-
"jackalope/jackalope-jackrabbit": "~1.1"
24+
"jackalope/jackalope-jackrabbit": "~1.1",
25+
"jackalope/jackalope-fs": "dev-master"
2426
},
2527
"suggest": {
2628
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal",
27-
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope jackrabbit"
29+
"jackalope/jackalope-jackrabbit": "To connect to jackalope jackrabbit",
30+
"jackalope/jackalope-jackrabbit-fs": "To connect to jackalope jackalope-fs"
2831
},
2932
"license": "MIT",
3033
"authors": [

features/all/phpcr_node_info.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Feature: Show information about node
1414
And I should see the following:
1515
"""
1616
+-------------------+--------------------------------------+
17-
| Path | /tests_general_base/daniel |
1817
| UUID | N/A |
1918
| Index | 1 |
2019
| Primary node type | nt:unstructured |

features/all/phpcr_node_list.feature

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,62 @@ Feature: List properites and chidren of current nodeA
7676
"""
7777
One or more weak reference targets have not been found
7878
"""
79+
80+
Scenario: Wildcard on name
81+
Given I execute the "node:list /tests_general_base/numberPropertyNode/jcr:con*" command
82+
Then the command should not fail
83+
And I should see the following:
84+
"""
85+
+-------------+-----------------+--+
86+
| jcr:content | nt:unstructured | |
87+
+-------------+-----------------+--+
88+
"""
89+
90+
Scenario: Wildcard on directory
91+
Given I execute the "node:list /tests_general_base/*/jcr:content" command
92+
Then the command should not fail
93+
And I should see the following:
94+
"""
95+
/tests_general_base/index.txt
96+
+-------------+-----------------+--+
97+
| jcr:content | nt:unstructured | |
98+
+-------------+-----------------+--+
99+
/tests_general_base/idExample
100+
+--------------+-----------------+--+
101+
| jcr:content/ | nt:unstructured | |
102+
+--------------+-----------------+--+
103+
/tests_general_base/numberPropertyNode
104+
+-------------+-----------------+--+
105+
| jcr:content | nt:unstructured | |
106+
+-------------+-----------------+--+
107+
/tests_general_base/NumberPropertyNodeToCompare1
108+
+-------------+-----------------+--+
109+
| jcr:content | nt:unstructured | |
110+
+-------------+-----------------+--+
111+
/tests_general_base/NumberPropertyNodeToCompare2
112+
+-------------+-----------------+--+
113+
| jcr:content | nt:unstructured | |
114+
+-------------+-----------------+--+
115+
"""
116+
117+
Scenario: Wildcard from relative path
118+
Given the current node is "/tests_general_base"
119+
And I execute the "node:list numberPropertyNode/jcr:con*" command
120+
Then the command should not fail
121+
And I should see the following:
122+
"""
123+
+-------------+-----------------+--+
124+
| jcr:content | nt:unstructured | |
125+
+-------------+-----------------+--+
126+
"""
127+
128+
Scenario: Wildcard from relative path 2
129+
Given the current node is "/tests_general_base"
130+
And I execute the "node:list num*" command
131+
Then the command should not fail
132+
And I should see the following:
133+
"""
134+
+---------------------+---------+--------------+
135+
| numberPropertyNode/ | nt:file | +jcr:content |
136+
+---------------------+---------+--------------+
137+
"""

features/all/phpcr_node_property_show.feature

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,21 @@ hello world
4141
Then the command should fail
4242
And I should see the following:
4343
"""
44-
Item at "/tests_general_base" is not a property
44+
Could not find property(s) at path
4545
"""
4646

4747
Scenario: Try to show non-existing property
4848
Given I execute the "node:property:show /this/path/does/not/exist" command
4949
Then the command should fail
5050
And I should see the following:
5151
"""
52-
There is no property at the path "/this/path/does/not/exist"
52+
Could not find property(s) at path
53+
"""
54+
55+
Scenario: Show properties using wildcard
56+
Given I execute the "node:property:show /tests_general_base/idExample/jcr:*" command
57+
Then the command should not fail
58+
And I should see the following:
59+
"""
60+
/tests_general_base/idExample/jcr:primaryType: nt:file
5361
"""

features/all/phpcr_node_remove.feature

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ Feature: Remove a node
3232
You cannot delete the root node
3333
"""
3434

35+
Scenario: Delete root node by wildcard
36+
Given I execute the "node:remove /tests_general_base/*" command
37+
Then the command should not fail
38+
And I save the session
39+
And there should not exist a node at "/tests_general_base/daniel"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public function __construct($mode)
3939
$container = new Container($this->mode);
4040
parent::__construct($container, SessionApplication::APP_NAME, SessionApplication::APP_VERSION);
4141
$this->setAutoExit(false);
42+
43+
// @deprecated This will be removed in 1.0
4244
$this->getHelperSet()->set(new PhpcrHelper($container->get('phpcr.session_manager')));
4345
}
4446

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ protected function registerShellCommands()
200200
*/
201201
private function configureFormatter(OutputFormatter $formatter)
202202
{
203+
$style = new OutputFormatterStyle('yellow', null, array('bold'));
204+
$formatter->setStyle('path', $style);
205+
206+
$style = new OutputFormatterStyle('green');
207+
$formatter->setStyle('localname', $style);
208+
203209
$style = new OutputFormatterStyle(null, null, array('bold'));
204210
$formatter->setStyle('node', $style);
205211

src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ public function execute(InputInterface $input, OutputInterface $output)
3333
$workspace = $session->getWorkspace();
3434
$lockManager = $workspace->getLockManager();
3535

36-
$path = $session->getAbsPath($input->getArgument('path'));
36+
$path = $input->getArgument('path');
37+
$nodes = $session->findNodes($path);
3738

38-
$lock = $lockManager->getLock($path);
39-
$lock->refresh();
39+
foreach ($nodes as $node) {
40+
41+
$lock = $lockManager->getLock($node->getPath());
42+
$lock->refresh();
43+
}
4044
}
4145
}

0 commit comments

Comments
 (0)