Skip to content

Commit 3e6f250

Browse files
authored
Merge pull request #869 from doctrine/add-more-doc
add some more documentation from cmf docs
2 parents 0f5cc73 + b6bee7b commit 3e6f250

File tree

4 files changed

+83
-28
lines changed

4 files changed

+83
-28
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.. index::
2+
single: PHPCR Implementations
3+
4+
Choosing a PHPCR Implementation
5+
===============================
6+
7+
To use PHPCR-ODM, you need to decide on the PHPCR implementation you want to
8+
use. The implementation is a special kind of database that is responsible for
9+
storing all the content you want to persist. While every content repository
10+
can have very different requirements and performance characteristics, the API
11+
is the same for all of them.
12+
13+
Furthermore, since the API defines an export/import format, you can always
14+
switch to a different content repository implementation later on.
15+
16+
.. tip::
17+
18+
If you are just getting started with the CMF, it is best to choose a
19+
content repository based on a storage engine that you are already familiar
20+
with. For example, **Jackalope with Doctrine DBAL** will work with your
21+
existing RDBMS and does not require you to install Java Once you have a
22+
working application it should be easy to switch to another option.
23+
24+
Jackalope with Jackrabbit
25+
-------------------------
26+
27+
The most feature complete and performant implementation available today.
28+
Jackrabbit can persist into the file system, a database and other storage
29+
layers.
30+
31+
The main drawback is that Jackrabbit requires the Java runtime.
32+
33+
See :doc:`running-jackrabbit` for instructions how to install and run jackrabbit.
34+
35+
Jackalope with Doctrine DBAL
36+
----------------------------
37+
38+
A solid and tested implementation that is fine for small to medium sized
39+
projects. It can run on just a relational database (currently tested with
40+
MySQL, PostgreSQL and SQLite).
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.. index::
2+
single: Jackrabbit
3+
4+
Running Jackrabbit
5+
==================
6+
7+
`Apache Jackrabbit`_ is the reference implementation for the Java Content
8+
Repository (JCR) standard. `jackalope-jackrabbit`_ implements PHPCR on top
9+
of the Jackrabbit remoting capabilities.
10+
11+
Get the latest Apache Jackrabbit version from the project's
12+
`official download page`_. Place it in a folder where you want it
13+
to create the repository fields and start is with:
14+
15+
.. code-block:: bash
16+
17+
$ java -jar jackrabbit-standalone-*.jar
18+
19+
By default the server is listening on the 8080 port, you can change this
20+
by specifying the port on the command line:
21+
22+
.. code-block:: bash
23+
24+
$ java -jar jackrabbit-standalone-*.jar --port 8888
25+
26+
For unix systems, you can get the start-stop script for ``/etc/init.d``
27+
`here`_.
28+
29+
More information about `running a Jackrabbit server`_ can be found on the
30+
Jackalope wiki.
31+
32+
.. _`Apache Jackrabbit`: http://jackrabbit.apache.org/jcr/index.html
33+
.. _`jackalope-jackrabbit`: https://github.com/jackalope/jackalope-jackrabbit
34+
.. _`official download page`: http://jackrabbit.apache.org/jcr/downloads.html
35+
.. _`here`: https://github.com/sixty-nine/Jackrabbit-startup-script
36+
.. _`running a Jackrabbit server`: https://github.com/jackalope/jackalope/wiki/Running-a-jackrabbit-server

docs/en/index.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,11 @@ Cookbook
7777
--------
7878

7979
* **Tricks**:
80+
:doc:`Chosing a PHPCR implementation <cookbook/choosing-phpcr-implementation>` |
81+
:doc:`Running Jackrabbit <cookbook/running-jackrabbit>` |
8082
:doc:`Last modification timestamp <cookbook/last-modified>` |
8183
:doc:`Custom Document Class Mapper <cookbook/custom_documentclass_mapper>` |
8284
:doc:`Convert documents between translated and untranslated <cookbook/refactoring-multilang>`
8385

84-
.. TODO: write these
85-
|
86-
:doc:`Blending ORM and PHPCR-ODM <cookbook/blending-orm-and-phpcr-odm>` |
87-
:doc:`Mapping classes to ORM and PHPCR-ODM <cookbook/mapping-classes-to-orm-and-phpcr-odm>` |
88-
89-
Also have a look at the `Doctrine ORM cookbook <http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/#cookbook>`_,
86+
Also have a look at the `Doctrine ORM cookbook <https://www.doctrine-project.org/projects/doctrine-orm/en/latest/#cookbook>`_,
9087
notably the entries in the *Implementation* section apply to PHPCR-ODM as well.

docs/en/reference/introduction.rst

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ abstract base class or interface. A document class must not be final
2727
or contain final methods. Additionally it must not implement
2828
**clone** nor **wakeup**.
2929

30-
.. todo: or :doc:`do so safely <../cookbook/implementing-wakeup-or-clone>`.
31-
32-
See the :doc:`architecture chapter <../reference/architecture>` for a full list of the restrictions
30+
See the :doc:`architecture chapter <architecture>` for a full list of the restrictions
3331
that your entities need to comply with.
3432

3533
A document contains persistable properties. A persistable property
@@ -54,29 +52,13 @@ We do not build a web interface but simple run scripts on the command line to ke
5452
Setup Project
5553
-------------
5654

57-
Create a file composer.json in your project directory.
58-
59-
.. code-block:: javascript
60-
61-
{
62-
"minimum-stability": "dev",
63-
"require": {
64-
"doctrine/phpcr-odm": "~1.2",
65-
"jackalope/jackalope-doctrine-dbal": "~1.1"
66-
},
67-
"autoload": {
68-
"psr-0": { "Demo\\": "src/" }
69-
}
70-
}
71-
72-
Then run the following commands on your command line
55+
Use composer to install PHPCR-ODM and a PHPCR implementation:
7356

7457
.. code-block:: bash
7558
76-
$ curl -s http://getcomposer.org/installer | php --
77-
$ php composer.phar install
59+
composer require doctrine/phpcr-odm jackalope/jackalope-doctrine-dbal
7860
79-
This will download the dependencies into the vendor/ folder and generate ``vendor/autoload.php``.
61+
See :doc:`../cookbook/choosing-phpcr-implementation` for alternatives to the Jackalope Doctrine-DBAL implementation.
8062

8163
.. _intro-bootstrap:
8264

0 commit comments

Comments
 (0)