Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit a59be86

Browse files
committed
Merge remote-tracking branch 'origin/master' into update-master-from-1.2
Conflicts: bundles/phpcr_odm/configuration.rst
2 parents 55f885b + d856590 commit a59be86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1878
-821
lines changed

.travis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ language: python
33
python:
44
- "2.7"
55

6+
sudo: false
7+
8+
addons:
9+
apt:
10+
packages: [enchant]
11+
612
install: "pip install -q -r requirements.txt --use-mirrors"
713

8-
script: sphinx-build -nW -b html -d _build/doctrees . _build/html
14+
script:
15+
- sphinx-build -nW -b html -d _build/doctrees . _build/html
16+
- make spelling

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ help:
3737
@echo " changes to make an overview of all changed/added/deprecated items"
3838
@echo " linkcheck to check all external links for integrity"
3939
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
40+
@echo " spelling generate a spelling report"
4041

4142
clean:
4243
-rm -rf $(BUILDDIR)/*
@@ -151,3 +152,7 @@ doctest:
151152
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
152153
@echo "Testing of doctests in the sources finished, look at the " \
153154
"results in $(BUILDDIR)/doctest/output.txt."
155+
156+
spelling:
157+
$(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)/spelling
158+
@echo "Spelling report generated in $(BUILDDIR)/spelling/output.txt"

book/database_layer.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ versioning and access control.
3737

3838
Doctrine PHPCR-ODM has the same API as the other Doctrine libraries, like the
3939
`Doctrine ORM`_. The Doctrine PHPCR-ODM adds another great feature to PHPCR:
40-
Multilanguage support.
40+
multi-language support.
4141

4242
.. sidebar:: PHPCR Implementations
4343

@@ -171,7 +171,7 @@ After this, you have to create getters and setters for the properties.
171171
This Document uses the parent document and a node name to determine its
172172
position in the tree. Because there isn't any name set, it is generated
173173
automatically. If you want to use a specific node name, such as a
174-
sluggified version of the title, you need to add a property mapped as
174+
slugified version of the title, you need to add a property mapped as
175175
``Nodename``.
176176

177177
A Document must have an id property. This represents the full path (parent
@@ -272,7 +272,7 @@ you've configured a route to display a specific task by name::
272272

273273
To retrieve objects from the document repository using both the ``find`` and
274274
``findMany`` methods and all helper methods of a class-specific repository. In
275-
PHPCR, it's often unkown for developers which node has the data for a specific
275+
PHPCR, it's often unknown for developers which node has the data for a specific
276276
document, in that case you should use the document manager to find the nodes
277277
(for instance, when you want to get the root document). In example above, we
278278
know they are ``Task`` documents and so we can use the repository.
@@ -294,7 +294,7 @@ The repository contains all sorts of helpful methods::
294294
.. tip::
295295

296296
If you use the repository class, you can also create a custom repository
297-
for a specific document. This helps with "Seperation of Concern" when using more
297+
for a specific document. This helps with "Separation of Concern" when using more
298298
complex queries. This is similar to how it's done in Doctrine ORM, for
299299
more information read "`Custom Repository Classes`_" in the core
300300
documentation.

book/handling_multilang.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ transparently.
1515
.. caution::
1616

1717
You also need the ``intl`` php extension installed and enabled (otherwise
18-
composer will tell you it can't find ext-intl). If you get issues that some
18+
composer will tell you it can't find ``ext-intl``). If you get issues that some
1919
locales can not be loaded, have a look at `this discussion about ICU`_.
2020

2121
Initial Language Choice: Lunetics LocaleBundle
@@ -56,7 +56,7 @@ Configuring Available Locales
5656
-----------------------------
5757

5858
The CoreBundle needs to be configure with the available locales. If it is
59-
not configured with locales, it registeres a listener that removes all
59+
not configured with locales, it registries a listener that removes all
6060
translation mapping from PHPCR-ODM documents.
6161

6262
.. configuration-block::

book/installation.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ After that, you get a quick introduction of the bundles you have installed.
1616
This can be used to familiarize yourself with the CMF or as a starting point
1717
for a new custom application.
1818

19-
.. note::
19+
This tutorial is aimed at people who want to get started with a project based
20+
on the Symfony CMF. There are two alternate articles in the cookbook you might
21+
want to look at, depending on what you need:
2022

21-
You can also install the CMF Sandbox, this is a more complete demo
22-
instance of the Symfony CMF. You can view it online at `cmf.liip.ch`_.
23-
You can also install it locally, so you can play with the code. For
24-
installation instructions for the sandbox, please read
25-
":doc:`../cookbook/editions/cmf_sandbox`".
23+
* :doc:`../cookbook/editions/cmf_core` - a guide for adding the CMF to a standard
24+
Symfony project.
25+
* :doc:`../cookbook/editions/cmf_sandbox` for instructions on how to install a
26+
demonstration sandbox. The sandbox contains many examples of what you can do
27+
with the CMF.
2628

2729
Preconditions
2830
-------------
@@ -251,7 +253,7 @@ Adding new pages
251253
Symfony CMF SE does not provide any admin tools to create new pages. If you
252254
are interested in adding an admin UI one solution can be found in
253255
:doc:`../tutorial/sonata-admin`. However, if all you want
254-
is a simple way to add new pages that you can then edit via the inline
256+
is a simple way to add new pages that you can then edit via the in-line
255257
editing, then you can use the SimpleCmsBundle ``page`` migrator. For example,
256258
to add a page called "Testing", creating a file called
257259
``app/Resources/data/pages/test.yml`` with the following contents:

book/routing.rst

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,12 @@ As mentioned above, you can use any route provider. The example in this
449449
section applies if you use the default PHPCR-ODM route provider
450450
(``Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RouteProvider``).
451451

452-
All routes are located under the base path configured in the application
453-
configuration ``cmf_routing.persistence.phpcr.route_basepath``. By default
454-
this path is ``/cms/routes``. A new route can be created in PHP code as
455-
follows::
452+
PHPCR-ODM documents are stored in a tree, and their ID is the path in that
453+
tree. To match routes, a part of the repository path is used as URL. To avoid
454+
mixing routes and other documents, routes are placed under a common root path
455+
and that path is removed from the ID to build the URL. The common root path is
456+
called "route basepath". The default base path is ``/cms/routes``. A new route
457+
can be created in PHP code as follows::
456458

457459
// src/Acme/MainBundle/DataFixtures/PHPCR/LoadRoutingData.php
458460
namespace Acme\DemoBundle\DataFixtures\PHPCR;
@@ -481,7 +483,7 @@ follows::
481483

482484
$route = new Route();
483485
$route->setParentDocument($dm->find(null, '/cms/routes'));
484-
$route->setName('projects');
486+
$route->setName('my-page');
485487

486488
// link a content to the route
487489
$content = new StaticContent();
@@ -492,37 +494,28 @@ follows::
492494
$dm->persist($content);
493495
$route->setContent($content);
494496

495-
// now define an id parameter; do not forget the leading slash if you
496-
// want /projects/{id} and not /projects{id}
497-
$route->setVariablePattern('/{id}');
498-
$route->setRequirement('id', '\d+');
499-
$route->setDefault('id', 1);
500-
501497
$dm->persist($route);
502498
$dm->flush();
503499
}
504500
}
505501

506-
This will give you a document that matches the URL ``/projects/<number>`` but
507-
also ``/projects`` as there is a default for the id parameter.
502+
Now the CMF will be able to handle requests for the URL ``/my-content``.
508503

509504
.. caution::
510505

511-
As you can see, the code explicitely creates the ``/cms/routes`` path.
506+
As you can see, the code explicitly creates the ``/cms/routes`` path.
512507
The RoutingBundle only creates this path automatically if the Sonata Admin
513508
was enabled in the routing configuration using an :ref:`initializer
514509
<phpcr-odm-repository-initializers>`. Otherwise, it'll assume you do
515510
something yourself to create the path (by configuring an initializer or
516511
doing it in a fixture like this).
517512

518-
Because you defined the ``{id}`` route parameter, your controller can expect an
519-
``$id`` parameter. Additionally, because you called ``setContent`` on the
520-
route, your controller can expect the ``$contentDocument`` parameter.
521-
The content could be used to define an intro section that is the same for each
522-
project or other shared data. If you don't need content, you can just not set it
523-
in the document.
513+
Because you called ``setContent`` on the route, the controller can expect the
514+
``$contentDocument`` parameter. You can now configure which controller should
515+
handle ``StaticContent`` as :ref:`explained above <start-routing-getting-controller-template>`.
524516

525-
For more details, see the
517+
The PHPCR-ODM routes support more things, for example route parameters,
518+
requirements and defaults. This is explained in the
526519
:ref:`route document section in the RoutingBundle documentation <bundle-routing-document>`.
527520

528521
Further Notes

book/static_content.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,4 @@ developers with a small and easy to understand starting point you can extend
7878
or use as inspiration to develop your own content types, Controllers and Admin
7979
panels.
8080

81-
.. _`multilanguage support in PHPCR-ODM`: http://docs.doctrine-project.org/projects/doctrine-phpcr-odm/en/latest/reference/multilang.html
8281
.. _SonataDoctrinePHPCRAdminBundle: https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle

bundles/block/cache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ is triggered:
139139
* Cache keys are computed using:
140140

141141
* The cache keys of the block service;
142-
* The extraCacheKeys passed from the template.
142+
* The ``extraCacheKeys`` passed from the template.
143143

144144
* The cache adapter is asked for a cache element:
145145

0 commit comments

Comments
 (0)