|
| 1 | +Shell for PHPCR |
| 2 | +--------------- |
| 3 | + |
| 4 | +Shell for PHPCR |
| 5 | + |
| 6 | +## Conncting |
| 7 | + |
| 8 | +To connect to a doctrine-dbal PHPCR repository: |
| 9 | + |
| 10 | + $ php bin/phpcr-shell --db_name=foobar --db_username=user --db_password=foobar |
| 11 | + |
| 12 | +Full definition: |
| 13 | + |
| 14 | +````bash |
| 15 | +$ php bin/phpcr --help |
| 16 | +Usage: |
| 17 | + phpcr_shell [-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="..."] |
| 18 | + |
| 19 | +Options: |
| 20 | + --help (-h) Display this help message. |
| 21 | + --verbose (-v) Increase verbosity of messages. |
| 22 | + --version (-V) Display this application version. |
| 23 | + --ansi Force ANSI output. |
| 24 | + --no-ansi Disable ANSI output. |
| 25 | + --transport (-t) Transport to use. (default: "doctrine-dbal") |
| 26 | + --phpcr_username (-pu) PHPCR Username. (default: "admin") |
| 27 | + --phpcr_password (-pp) PHPCR Password. (default: "admin") |
| 28 | + --phpcr_workspace (-pw) PHPCR Workspace. (default: "default") |
| 29 | + --db_username (-du) Database Username. (default: "root") |
| 30 | + --db_name (-dn) Database Name. (default: "phpcr") |
| 31 | + --db_password (-dp) Database Password. |
| 32 | + --db_host (-dh) Database Host. (default: "localhost") |
| 33 | + --db_driver (-dd) Database Transport. (default: "pdo_mysql") |
| 34 | + --db_path (-dP) Database Path. |
| 35 | +```` |
| 36 | + |
| 37 | +## Executing Select Queries |
| 38 | + |
| 39 | +JCR_SQL2 Select queries can be executed in the same way as in the MySQL shell: |
| 40 | + |
| 41 | +````bash |
| 42 | +PHPCR > select * from nt:unstructured; |
| 43 | +0 |
| 44 | + nt:unstructured |
| 45 | + / |
| 46 | + jcr:primaryType Name: nt:unstructured |
| 47 | +1 |
| 48 | + nt:unstructured |
| 49 | + /cms |
| 50 | + jcr:primaryType Name: nt:unstructured |
| 51 | + phpcr:class String: DTL\WebBundle\Document\Site |
| 52 | +2 |
| 53 | + nt:unstructured |
| 54 | + /cms/routes |
| 55 | + jcr:primaryType Name: nt:unstructured |
| 56 | +... |
| 57 | +```` |
| 58 | + |
| 59 | +## Changing the CWD |
| 60 | + |
| 61 | +The PHPCR shell (will) allows you to navigate the PHPCR document hierarchy like a file system |
| 62 | + |
| 63 | +````bash |
| 64 | +PHPCR > ls |
| 65 | +ROOT: |
| 66 | + cms/ |
| 67 | + foobar/ |
| 68 | + some-node |
| 69 | +PHPCR > cd cms/foobar |
| 70 | +PHPCR > pwd |
| 71 | +/cms/foobar |
| 72 | +PHPCR > mv foobar /barfoo |
| 73 | +```` |
| 74 | + |
| 75 | +All available commands: |
| 76 | + |
| 77 | +````bash |
| 78 | +Welcome to the PHPCR shell (1.0). |
| 79 | + |
| 80 | +At the prompt, type help for some help, |
| 81 | +or list to get a list of available commands. |
| 82 | + |
| 83 | +To exit the shell, type ^D. |
| 84 | + |
| 85 | +PHPCR > help |
| 86 | +PHPCR version 1.0 |
| 87 | + |
| 88 | +Usage: |
| 89 | + [options] command [arguments] |
| 90 | + |
| 91 | +Options: |
| 92 | + --help -h Display this help message. |
| 93 | + --quiet -q Do not output any message. |
| 94 | + --verbose -v Increase verbosity of messages. |
| 95 | + --version -V Display this application version. |
| 96 | + --ansi Force ANSI output. |
| 97 | + --no-ansi Disable ANSI output. |
| 98 | + --no-interaction -n Do not ask any interactive question. |
| 99 | + |
| 100 | +Available commands: |
| 101 | + cd Change the current path |
| 102 | + help Displays help for a command |
| 103 | + list Lists commands |
| 104 | + ls Alias for dump |
| 105 | + mv Moves a node from one path to another |
| 106 | + nt-list List all available node types in the repository |
| 107 | + nt-register Register node types in the PHPCR repository |
| 108 | + pwd Print Working Directory (or path) |
| 109 | + rm Remove content from the repository |
| 110 | + select Execute an JCR_SQL2 query. |
| 111 | + touch Create or modify a node |
| 112 | + update Command to manipulate the nodes in the workspace. |
| 113 | + workspace-create Create a workspace in the configured repository |
| 114 | + workspace-delete Delete a workspace from the configured repository |
| 115 | + workspace-export Export nodes from the repository, either to the JCR system view format or the document view format |
| 116 | + workspace-import Import xml data into the repository, either in JCR system view format or arbitrary xml |
| 117 | + workspace-list List all available workspaces in the configured repository |
| 118 | + workspace-purge Remove all nodes from a workspace |
| 119 | +```` |
0 commit comments