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

Commit 7c2a14b

Browse files
committed
documenting the limit on candidates
1 parent 5310fa0 commit 7c2a14b

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

bundles/routing/dynamic_customize.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ You can add your own :ref:`RouteEnhancerInterface <bundles-routing-dynamic_route
2424
implementations if you have a case not handled by the
2525
:ref:`provided enhancers <component-routing-enhancers>`. Simply define services
2626
for your enhancers and tag them with ``dynamic_router_route_enhancer`` to have
27-
them added to the routing.
27+
them added to the routing. You can specify an optional ``priority`` parameter
28+
on the tag to control the order in which enhancers are executed. The higher the
29+
priority, the earlier the enhancer is executed.
2830

2931
.. index:: Route Provider
3032
.. _bundle-routing-custom_provider:

bundles/simple_cms/multilang.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Multi-Language Support
55
----------------------
66

7-
Setting ``addLocalePattern`` to ``true`` in a
7+
Setting the option ``add_locale_pattern`` to ``true`` in a
88
``Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page`` document will
99
result in prefixing the associated route with ``/{_locale}``. Using the native
1010
translation capabilities of PHPCR ODM it is now possible to create different
@@ -42,7 +42,7 @@ For example::
4242
will have the same node name for all languages. So a url
4343
``http://foo.com/en/hello-world`` for english content will look like
4444
``http://foo.com/de/hello-world`` for german content.
45-
45+
4646
At times it might be most feasible to use integers as the node names and
4747
simple append the title of the node in the given locale as an anchor. So
4848
for example ``http://foo.com/de/1#my title`` and

components/routing/nested_matcher.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ do any elaborate matching operations yet - this will be done in the later steps.
3737
implementations for everything needed to get this component running with
3838
Doctrine PHPCR-ODM as well as with the Doctrine ORM.
3939

40+
.. tip::
41+
42+
This component provides the ``Candidates`` implementation for the very
43+
first step of splitting the URL on the ``/`` to allow matching with
44+
variable patterns.
45+
4046
To create and register your own Route Provider, create a class implementing
4147
``Symfony\Cmf\Component\Routing\RouteProviderInterface`` which will have the
4248
following methods::

reference/configuration/routing.rst

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,15 @@ manager_name
367367
.. include:: partials/persistence_phpcr_manager_name.rst.inc
368368

369369
route_basepaths
370-
**************
370+
***************
371371

372372
**type**: ``array`` **default**: ``array('/cms/routes')``
373373

374374
The basepaths where to look for routes in the PHPCR tree.
375375

376376
If the :doc:`CoreBundle <../../bundles/core/index>` is registered, this will
377377
default to ``%cmf_core.persistence.phpcr.basepath%/routes``. If the
378-
:doc:`SimpleCmsBundle <../../bundles/simplecms/index>` is registered as well,
378+
:doc:`SimpleCmsBundle <../../bundles/simple_cms/index>` is registered as well,
379379
this will additionally default to ``%cmf_core.persistence.phpcr.basepath%/simple``.
380380

381381
content_basepath
@@ -516,8 +516,22 @@ locales
516516

517517
To enable multilanguage, set the valid locales in this option.
518518

519-
If the :doc:`CoreBundle <../../bundles/core/index>` is registered, this will default to the value
520-
of ``cmf_core.locales``.
519+
If the :doc:`CoreBundle <../../bundles/core/index>` is registered, this will
520+
default to the value of ``cmf_core.locales``.
521+
522+
limit_candidates
523+
~~~~~~~~~~~~~~~~
524+
525+
**type**: ``integer`` **default**: ``20``
526+
527+
With this flag you can tune the routing behaviour when using the dynamic
528+
pattern part of routes stored in the database. If you do never use the variable
529+
pattern field of the Route model, you can set this to 1 as a small performance
530+
optimization.
531+
532+
If you have very complex URLs with patterns, you might need to increase the
533+
limit, but this will expose your site to load attacks with URLs with lots of
534+
slashes in them.
521535

522536
match_implicit_locale
523537
~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)