Skip to content

Commit 33dbe4f

Browse files
committed
Updated README
1 parent ff2b15d commit 33dbe4f

File tree

1 file changed

+2
-114
lines changed

1 file changed

+2
-114
lines changed

README.md

Lines changed: 2 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -26,118 +26,6 @@ Copy this file to your bin directory:
2626
$ sudo cp phpcrsh.phar /usr/bin/local/phpcrsh
2727
````
2828

29-
## Connecting
29+
## Documentation
3030

31-
To connect to a doctrine-dbal PHPCR repository:
32-
33-
$ phpcr --transport=doctrine-dbal --db-name=foobar --db-username=user --db-password=foobar
34-
35-
Full definition:
36-
37-
````bash
38-
Usage:
39-
phpcrsh [-h|--help] [-v|--verbose] [-V|--version] [--ansi] [--no-ansi] [-t|--transport="..."] [-pu|--phpcr-username="..."] [-pp|--phpcr-password[="..."]] [-pw|--phpcr-workspace[="..."]] [-du|--db-username="..."] [-dn|--db-name="..."] [-dp|--db-password[="..."]] [-dh|--db-host="..."] [-dd|--db-driver="..."] [-dP|--db-path="..."] [--no-interaction] [--unsupported] [-url|--repo-url="..."] [--command="..."]
40-
41-
Options:
42-
--help (-h) Display this help message.
43-
--verbose (-v) Increase verbosity of messages.
44-
--version (-V) Display this application version.
45-
--ansi Force ANSI output.
46-
--no-ansi Disable ANSI output.
47-
--transport (-t) Transport to use. (default: "doctrine-dbal")
48-
--phpcr-username (-pu) PHPCR Username. (default: "admin")
49-
--phpcr-password (-pp) PHPCR Password. (default: "admin")
50-
--phpcr-workspace (-pw) PHPCR Workspace. (default: "default")
51-
--db-username (-du) Database Username. (default: "root")
52-
--db-name (-dn) Database Name. (default: "phpcr")
53-
--db-password (-dp) Database Password.
54-
--db-host (-dh) Database Host. (default: "localhost")
55-
--db-driver (-dd) Database Transport. (default: "pdo_mysql")
56-
--db-path (-dP) Database Path.
57-
--no-interaction Turn off interaction (for testing purposes)
58-
--unsupported Show all commands, including commands not supported by the repository
59-
--repo-url (-url) URL of repository (e.g. for jackrabbit). (default: "http://localhost:8080/server/")
60-
--command Run the given command
61-
````
62-
63-
## Navigating and manipulating the repository
64-
65-
You can navigate the repository using familiar filesystem shell commands:
66-
67-
````bash
68-
PHPCRSH > ls
69-
+-----------------+------------+-----------------+
70-
| pocms/ | pocms:root | |
71-
| jcr:primaryType | NAME | nt:unstructured |
72-
+-----------------+------------+-----------------+
73-
PHPCRSH > cd pocms
74-
PHPCRSH > pwd
75-
/pocms
76-
PHPCRSH > cd ..
77-
PHPCRSH > pwd
78-
/
79-
PHPCRSH > cat jcr:primaryType
80-
nt:unstructured
81-
PHPCRSH > exit
82-
````
83-
84-
The above commands are *aliases*. Aliases are defined in your home directory
85-
in `~/.phpcrsh/aliases.yml`.
86-
87-
Aliases can be listed using the `alist` alias, or `shell:alias:list`.
88-
89-
The above commands would be expanded as:
90-
91-
````bash
92-
PHPCRSH > node:list
93-
PHPCRSH > shell:path:change pocms
94-
PHPCRSH > shell:path:show
95-
PHPCRSH > node:property:show jcr:primaryType
96-
PHPCRSH > shell:exist
97-
````
98-
99-
## Executing queries
100-
101-
PHPCR Shell allows JCR-SQL2 queries to be entered directly on the command line
102-
and adds supports UPDATE and DELETE queries in addition to SELECT.
103-
104-
````sql
105-
SELECT * FROM [nt:unstructured] WHERE title = "foobar";
106-
UPDATE [nt:unstructured] SET title="barfoo" WHERE title="foobar"
107-
DELETE FROM [nt:unstructured] WHERE title="barfoo";
108-
````
109-
110-
UPDATE and DELETE queries are bound to the session, and require a
111-
`session:save` command to be issued for the changes to be written to the
112-
database.
113-
114-
## Using profiles
115-
116-
Profiles enable you to save and reuse connection settings. Profiles can be
117-
created or used by using the `--profile` option.
118-
119-
To create or update a profile, use it in conjunction with `--transport`, i.e.:
120-
121-
````bash
122-
$ phpcrsh --profile=mydb --transport=doctrine-dbal --db-user=foobar --db-name=mydb
123-
Create new profile "mydb"?
124-
````
125-
126-
To use the profile:
127-
128-
````bash
129-
$ phpcrsh --profile=mydb
130-
````
131-
132-
Or use the short syntax:
133-
134-
````bash
135-
$ phpcrsh --pmydb
136-
````
137-
138-
139-
## Todo
140-
141-
- Better querying support
142-
- Better autocompletion
143-
- Directory aware configuration / configuration auto-detection
31+
Read the documentation on [readthedocs](http://phpcr.readthedocs.org/en/latest/phpcr-shell/index.html)

0 commit comments

Comments
 (0)