Skip to content

Commit 004082f

Browse files
committed
Minor changes
1 parent 4631a0b commit 004082f

File tree

6 files changed

+62
-22
lines changed

6 files changed

+62
-22
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
vendor
22
composer.lock
3-
phpcrsh.phar
3+
phpcr.phar

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: php
2+
3+
php:
4+
- 5.3
5+
- 5.4
6+
7+
script: phpunit

README.md

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,34 @@ Shell for PHPCR
33

44
Shell for PHPCR
55

6-
## Conncting
6+
## Building
7+
8+
The recommended way to use the PHPCR shell is as a phar archive.
9+
10+
Currently there is no stable release and so it is necessary to build it manually.
11+
12+
Install box: http://box-project.org
13+
14+
Build the PHAR:
15+
16+
````bash
17+
$ cd phpcr-shell
18+
$ box build
19+
````
20+
21+
This will produce the file `phpcr.phar`.
22+
23+
Copy this file to your bin directory:
24+
25+
````bash
26+
$ sudo cp phpcr.sh /usr/bin
27+
````
28+
29+
## Connecting
730

831
To connect to a doctrine-dbal PHPCR repository:
932

10-
$ php bin/phpcr --db-name=foobar --db-username=user --db-password=foobar
33+
$ phpcr --db-name=foobar --db-username=user --db-password=foobar
1134

1235
Full definition:
1336

@@ -40,21 +63,31 @@ Options:
4063
JCR_SQL2 Select queries can be executed in the same way as in the MySQL shell:
4164

4265
````bash
43-
PHPCR > SELECT * FROM nt:unstructured;
44-
0
45-
nt:unstructured
46-
/
47-
jcr:primaryType Name: nt:unstructured
48-
1
49-
nt:unstructured
50-
/cms
51-
jcr:primaryType Name: nt:unstructured
52-
phpcr:class String: DTL\WebBundle\Document\Site
53-
2
54-
nt:unstructured
55-
/cms/routes
56-
jcr:primaryType Name: nt:unstructured
57-
...
66+
PHPCR > select * from [n:unstructured]
67+
| Row: #0 Score: 3
68+
| Sel: nt:unstructured Path: /foobar/barfoo UID: none
69+
+-----------------+--------+----------+-----------------+
70+
| Name | Type | Multiple | Value |
71+
+-----------------+--------+----------+-----------------+
72+
| phpcr | String | no | foo |
73+
| jcr:primaryType | Name | no | nt:unstructured |
74+
+-----------------+--------+----------+-----------------+
75+
76+
| Row: #1 Score: 3
77+
| Sel: nt:unstructured Path: /foo UID: none
78+
+-----------------+------+----------+-----------------+
79+
| Name | Type | Multiple | Value |
80+
+-----------------+------+----------+-----------------+
81+
| jcr:primaryType | Name | no | nt:unstructured |
82+
+-----------------+------+----------+-----------------+
83+
84+
| Row: #2 Score: 3
85+
| Sel: nt:unstructured Path: /foobar UID: none
86+
+-----------------+------+----------+-----------------+
87+
| Name | Type | Multiple | Value |
88+
+-----------------+------+----------+-----------------+
89+
| jcr:primaryType | Name | no | nt:unstructured |
90+
+-----------------+------+----------+-----------------+
5891
````
5992

6093
## Changing the CWD

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "dantleech/phpcrsh",
2+
"name": "phpcr/phpcrsh",
33
"description": "Shell for PHPCR",
44
"require": {
55
"symfony/console": "2.3.*",

src/PHPCR/Shell/Console/Helper/ResultFormatterHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public function format(QueryResultInterface $result, OutputInterface $output, $e
2828
foreach ($selectorNames as $selectorName) {
2929
$node = $row->getNode($selectorName);
3030
$properties = $node->getProperties();
31-
$output->writeln(sprintf('| <info>selector:</info> %s <info>path:</info> %s <info>uid:</info> %s',
32-
$selectorName, $node->getPath(), $node->getIdentifier()
31+
$output->writeln(sprintf('| <info>Sel:</info> %s <info>Path:</info> %s <info>UID:</info> %s',
32+
$selectorName, $node->getPath(), $node->getIdentifier() ? : 'none'
3333
));
3434

3535
$table = new TableHelper;

tests/PHPCR/Shell/Application/ShellApplicationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function setUp()
4747
->method('getRepository')
4848
->will($this->returnValue($this->repository));
4949

50-
$this->application = new ShellApplication($this->sessionInput, array($this->transport));
50+
$this->application = new ShellApplication('phpcr','v0.test', $this->sessionInput, array($this->transport));
5151
$this->application->setAutoExit(false);
5252
}
5353

0 commit comments

Comments
 (0)