From 3cbf4d95db7d95ef1ae37a97b0e4d6335664067a Mon Sep 17 00:00:00 2001 From: WouterJ Date: Mon, 30 Jun 2014 23:06:05 +0200 Subject: [PATCH 01/17] Fixed invalid nesting --- contributing/documentation/standards.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contributing/documentation/standards.rst b/contributing/documentation/standards.rst index 821252113bf..a46dea693a5 100644 --- a/contributing/documentation/standards.rst +++ b/contributing/documentation/standards.rst @@ -85,10 +85,10 @@ Files and Directories ~~~~~~~~~~~~~~~~~~~~~ * When referencing directories, always add a trailing slash to avoid confusions - with regular files (e.g. *"execute the ``console`` script located at the ``app/`` - directory"*). + with regular files (e.g. "execute the ``console`` script located at the ``app/`` + directory"). * When referencing file extensions explicitly, you should include a leading dot - for every extension (e.g. "*XML files use the ``.xml`` extension*"). + for every extension (e.g. "XML files use the ``.xml`` extension"). * When you list a Symfony file/directory hierarchy, use ``your-project/`` as the top level directory. E.g. From 0cd3d89912c7adbaada0e3de5e7603ec1825c9e0 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Mon, 30 Jun 2014 23:07:05 +0200 Subject: [PATCH 02/17] Reoutlined the standards --- contributing/documentation/standards.rst | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/contributing/documentation/standards.rst b/contributing/documentation/standards.rst index a46dea693a5..57cd8933c4c 100644 --- a/contributing/documentation/standards.rst +++ b/contributing/documentation/standards.rst @@ -81,25 +81,6 @@ Configuration examples should show all supported formats using * **Validation**: YAML, Annotations, XML, PHP * **Doctrine Mapping**: Annotations, YAML, XML, PHP -Files and Directories -~~~~~~~~~~~~~~~~~~~~~ - -* When referencing directories, always add a trailing slash to avoid confusions - with regular files (e.g. "execute the ``console`` script located at the ``app/`` - directory"). -* When referencing file extensions explicitly, you should include a leading dot - for every extension (e.g. "XML files use the ``.xml`` extension"). -* When you list a Symfony file/directory hierarchy, use ``your-project/`` as the - top level directory. E.g. - - .. code-block:: text - - your-project/ - ├─ app/ - ├─ src/ - ├─ vendor/ - └─ ... - Example ~~~~~~~ @@ -133,6 +114,25 @@ Example In YAML you should put a space after ``{`` and before ``}`` (e.g. ``{ _controller: ... }``), but this should not be done in Twig (e.g. ``{'hello' : 'value'}``). +Files and Directories +--------------------- + +* When referencing directories, always add a trailing slash to avoid confusions + with regular files (e.g. "execute the ``console`` script located at the ``app/`` + directory"). +* When referencing file extensions explicitly, you should include a leading dot + for every extension (e.g. "XML files use the ``.xml`` extension"). +* When you list a Symfony file/directory hierarchy, use ``your-project/`` as the + top level directory. E.g. + + .. code-block:: text + + your-project/ + ├─ app/ + ├─ src/ + ├─ vendor/ + └─ ... + Language Standards ------------------ From f43fa0d879f51195d36fefac89df31569aa218b7 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Mon, 30 Jun 2014 23:09:48 +0200 Subject: [PATCH 03/17] comply to dir structure standards --- .../configuration/override_dir_structure.rst | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/cookbook/configuration/override_dir_structure.rst b/cookbook/configuration/override_dir_structure.rst index 73f2016c36c..0a8faad93f8 100644 --- a/cookbook/configuration/override_dir_structure.rst +++ b/cookbook/configuration/override_dir_structure.rst @@ -10,18 +10,19 @@ directory structure is: .. code-block:: text - app/ - cache/ - config/ - logs/ - ... - src/ - ... - vendor/ - ... - web/ - app.php - ... + your-project/ + ├─ app/ + │ ├─ cache/ + │ ├─ config/ + │ ├─ logs/ + │ └─ ... + ├─ src/ + │ └─ ... + ├─ vendor/ + │ └─ ... + └─ web/ + ├─ app.php + └─ ... .. _override-cache-dir: From be09679d89e3d05e9c464db3a078a650a719815e Mon Sep 17 00:00:00 2001 From: WouterJ Date: Mon, 30 Jun 2014 23:10:09 +0200 Subject: [PATCH 04/17] tried fixing code block rendering --- cookbook/configuration/override_dir_structure.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/configuration/override_dir_structure.rst b/cookbook/configuration/override_dir_structure.rst index 0a8faad93f8..2f0382e8984 100644 --- a/cookbook/configuration/override_dir_structure.rst +++ b/cookbook/configuration/override_dir_structure.rst @@ -95,7 +95,7 @@ may need to modify the paths inside these files:: Since Symfony 2.1 (in which Composer is introduced), you also need to change the ``extra.symfony-web-dir`` option in the ``composer.json`` file: -.. code-block:: json +.. code-block:: javascript { ... From 540212122d7f220f27d1a7d6b54fdf37ac809dc1 Mon Sep 17 00:00:00 2001 From: yositani2002 Date: Wed, 2 Jul 2014 22:23:55 +0900 Subject: [PATCH 05/17] fix typos. --- reference/forms/types/options/pattern.rst.inc | 4 ++-- reference/forms/types/options/post_max_size_message.rst.inc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/forms/types/options/pattern.rst.inc b/reference/forms/types/options/pattern.rst.inc index d1ff3aea732..2bb115b4483 100644 --- a/reference/forms/types/options/pattern.rst.inc +++ b/reference/forms/types/options/pattern.rst.inc @@ -6,13 +6,13 @@ pattern This adds an HTML5 ``pattern`` attribute to restrict the field input by a given regular expression. -.. caution: +.. caution:: The ``pattern`` attribute provides client-side validation for convenience purposes only and must not be used as a replacement for reliable server-side validation. -.. note: +.. note:: When using validation constraints, this option is set automatically for some constraints to match the server-side validation. diff --git a/reference/forms/types/options/post_max_size_message.rst.inc b/reference/forms/types/options/post_max_size_message.rst.inc index f85cb83a99d..9378edb4941 100644 --- a/reference/forms/types/options/post_max_size_message.rst.inc +++ b/reference/forms/types/options/post_max_size_message.rst.inc @@ -7,6 +7,6 @@ This is the validation error message that's used if submitted POST form data exceeds ``php.ini``'s ``post_max_size`` directive. The ``{{ max }}`` placeholder can be used to display the allowed size. -.. note: +.. note:: Validating the ``post_max_size`` only happens on the root form. From f806f65303a8f49ab2d2abe338f1d6e0c72d98ff Mon Sep 17 00:00:00 2001 From: Baptiste Langlade Date: Thu, 26 Jun 2014 09:21:58 +0200 Subject: [PATCH 06/17] removed call to deprecated getRequest() method --- book/templating.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/templating.rst b/book/templating.rst index 17fee4b3d81..fa274079893 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -1500,9 +1500,9 @@ In many cases, you may want to allow a single controller to render multiple different formats based on the "request format". For that reason, a common pattern is to do the following:: - public function indexAction() + public function indexAction(Request $request) { - $format = $this->getRequest()->getRequestFormat(); + $format = $request->getRequestFormat(); return $this->render('AcmeBlogBundle:Blog:index.'.$format.'.twig'); } From 811af567c4441f5b0bcfec743f11c3764c98ad7f Mon Sep 17 00:00:00 2001 From: healdropper Date: Fri, 13 Jun 2014 14:09:25 +0200 Subject: [PATCH 07/17] DQL custom functions on doctrine reference page Seems that there is two possibilities to configure custom DQL functions It should be clearified in doctrine reference page because It may confuse some people if they just read the cookbook: http://symfony.com/doc/current/cookbook/doctrine/custom_dql_functions.html --- reference/configuration/doctrine.rst | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 9c9b959123a..13b97c56f81 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -411,3 +411,42 @@ Each connection is also accessible via the ``doctrine.dbal.[name]_connection`` service where ``[name]`` is the name of the connection. .. _DBAL documentation: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html + +Register Custom DQL Functions +----------------------------- + +Doctrine allows you to specify custom DQL functions. For more information +on this topic, read Doctrine's cookbook article "`DQL User Defined Functions`_". + +In Symfony, you can register your custom DQL functions as follows: + +.. code-block:: yaml + doctrine: + orm: + # ... + entity_managers: + default: + # ... + dql: + string_functions: + test_string: Acme\HelloBundle\DQL\StringFunction + second_string: Acme\HelloBundle\DQL\SecondStringFunction + numeric_functions: + test_numeric: Acme\HelloBundle\DQL\NumericFunction + datetime_functions: + test_datetime: Acme\HelloBundle\DQL\DatetimeFunction + +However, if you are only using one entity manager, DQL functions can be registed like this: + +.. code-block:: yaml + doctrine: + orm: + # ... + dql: + string_functions: + test_string: Acme\HelloBundle\DQL\StringFunction + second_string: Acme\HelloBundle\DQL\SecondStringFunction + numeric_functions: + test_numeric: Acme\HelloBundle\DQL\NumericFunction + datetime_functions: + test_datetime: Acme\HelloBundle\DQL\DatetimeFunction From 81ad1b7acff7c12e2cca802d99869a9541bfb286 Mon Sep 17 00:00:00 2001 From: healdropper Date: Fri, 13 Jun 2014 14:27:59 +0200 Subject: [PATCH 08/17] Update doctrine.rst --- reference/configuration/doctrine.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 13b97c56f81..dd1f7e8f589 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -421,6 +421,7 @@ on this topic, read Doctrine's cookbook article "`DQL User Defined Functions`_". In Symfony, you can register your custom DQL functions as follows: .. code-block:: yaml + doctrine: orm: # ... From 2faf3a2ef9024021a54611774c7a27e83b37a06a Mon Sep 17 00:00:00 2001 From: healdropper Date: Fri, 13 Jun 2014 14:28:50 +0200 Subject: [PATCH 09/17] Update doctrine.rst --- reference/configuration/doctrine.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index dd1f7e8f589..1810189fa77 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -440,6 +440,7 @@ In Symfony, you can register your custom DQL functions as follows: However, if you are only using one entity manager, DQL functions can be registed like this: .. code-block:: yaml + doctrine: orm: # ... From 873e940c5154a6014e35642167b23e007205c5b1 Mon Sep 17 00:00:00 2001 From: healdropper Date: Fri, 13 Jun 2014 14:33:24 +0200 Subject: [PATCH 10/17] Fixed broked link --- reference/configuration/doctrine.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 1810189fa77..ad82d89106f 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -452,3 +452,6 @@ However, if you are only using one entity manager, DQL functions can be registed test_numeric: Acme\HelloBundle\DQL\NumericFunction datetime_functions: test_datetime: Acme\HelloBundle\DQL\DatetimeFunction + + +.. _`DQL User Defined Functions`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html From 3a498d2a128a38ab525d18f80cd65963bfd1ec1e Mon Sep 17 00:00:00 2001 From: healdropper Date: Mon, 16 Jun 2014 09:46:39 +0200 Subject: [PATCH 11/17] Shorten syntax mention on doctrine reference Changed documentation to explain shorten syntax in general, not just DQL functions part --- reference/configuration/doctrine.rst | 84 ++++++++++++++++++---------- 1 file changed, 55 insertions(+), 29 deletions(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index ad82d89106f..907762fe4ab 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -412,46 +412,72 @@ service where ``[name]`` is the name of the connection. .. _DBAL documentation: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html -Register Custom DQL Functions +Shorten configuration syntax ----------------------------- -Doctrine allows you to specify custom DQL functions. For more information -on this topic, read Doctrine's cookbook article "`DQL User Defined Functions`_". - -In Symfony, you can register your custom DQL functions as follows: - -.. code-block:: yaml - - doctrine: - orm: - # ... - entity_managers: - default: - # ... - dql: - string_functions: - test_string: Acme\HelloBundle\DQL\StringFunction - second_string: Acme\HelloBundle\DQL\SecondStringFunction - numeric_functions: - test_numeric: Acme\HelloBundle\DQL\NumericFunction - datetime_functions: - test_datetime: Acme\HelloBundle\DQL\DatetimeFunction - -However, if you are only using one entity manager, DQL functions can be registed like this: +When you are only using one entity manager, all config options available +for each entity manager can be placed directly under doctrine.orm config level. .. code-block:: yaml doctrine: orm: # ... + query_cache_driver: + type: array # Required + host: ~ + port: ~ + instance_class: ~ + class: ~ + metadata_cache_driver: + type: array # Required + host: ~ + port: ~ + instance_class: ~ + class: ~ + result_cache_driver: + type: array # Required + host: ~ + port: ~ + instance_class: ~ + class: ~ + connection: ~ + class_metadata_factory_name: Doctrine\ORM\Mapping\ClassMetadataFactory + default_repository_class: Doctrine\ORM\EntityRepository + auto_mapping: false + hydrators: + # An array of hydrator names + hydrator_name: [] + mappings: + # An array of mappings, which may be a bundle name or something else + mapping_name: + mapping: true + type: ~ + dir: ~ + alias: ~ + prefix: ~ + is_bundle: ~ dql: + # a collection of string functions string_functions: - test_string: Acme\HelloBundle\DQL\StringFunction - second_string: Acme\HelloBundle\DQL\SecondStringFunction + # example + # test_string: Acme\HelloBundle\DQL\StringFunction + + # a collection of numeric functions numeric_functions: - test_numeric: Acme\HelloBundle\DQL\NumericFunction - datetime_functions: - test_datetime: Acme\HelloBundle\DQL\DatetimeFunction + # example + # test_numeric: Acme\HelloBundle\DQL\NumericFunction + # a collection of datetime functions + datetime_functions: + # example + # test_datetime: Acme\HelloBundle\DQL\DatetimeFunction + filters: + # An array of filters + some_filter: + class: ~ # Required + enabled: false + +This shorten version is commonly used in other documentation sections. Keep in mind that you can't use both syntax at same time. .. _`DQL User Defined Functions`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html From 981071ef6f19990f51d38e5210914ae975c527ee Mon Sep 17 00:00:00 2001 From: healdropper Date: Sat, 21 Jun 2014 09:31:37 +0200 Subject: [PATCH 12/17] Update doctrine.rst Made more clear the shorten doctrine.yml syntax, leaving only the first level of configuration. --- reference/configuration/doctrine.rst | 54 +++++----------------------- 1 file changed, 9 insertions(+), 45 deletions(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 907762fe4ab..d031672cd7d 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -424,59 +424,23 @@ for each entity manager can be placed directly under doctrine.orm config level. orm: # ... query_cache_driver: - type: array # Required - host: ~ - port: ~ - instance_class: ~ - class: ~ + # ... metadata_cache_driver: - type: array # Required - host: ~ - port: ~ - instance_class: ~ - class: ~ + # ... result_cache_driver: - type: array # Required - host: ~ - port: ~ - instance_class: ~ - class: ~ - connection: ~ + # ... + connection: ~ class_metadata_factory_name: Doctrine\ORM\Mapping\ClassMetadataFactory default_repository_class: Doctrine\ORM\EntityRepository - auto_mapping: false + auto_mapping: false hydrators: - # An array of hydrator names - hydrator_name: [] + # ... mappings: - # An array of mappings, which may be a bundle name or something else - mapping_name: - mapping: true - type: ~ - dir: ~ - alias: ~ - prefix: ~ - is_bundle: ~ + # ... dql: - # a collection of string functions - string_functions: - # example - # test_string: Acme\HelloBundle\DQL\StringFunction - - # a collection of numeric functions - numeric_functions: - # example - # test_numeric: Acme\HelloBundle\DQL\NumericFunction - - # a collection of datetime functions - datetime_functions: - # example - # test_datetime: Acme\HelloBundle\DQL\DatetimeFunction + # ... filters: - # An array of filters - some_filter: - class: ~ # Required - enabled: false + # ... This shorten version is commonly used in other documentation sections. Keep in mind that you can't use both syntax at same time. From b61b6b8a6b2e98fef676fdec2e9bbbab5c3a4869 Mon Sep 17 00:00:00 2001 From: healdropper Date: Sun, 22 Jun 2014 16:49:27 +0200 Subject: [PATCH 13/17] Update doctrine.rst Proposed changes to format --- reference/configuration/doctrine.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index d031672cd7d..abe7d47564b 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -415,8 +415,9 @@ service where ``[name]`` is the name of the connection. Shorten configuration syntax ----------------------------- -When you are only using one entity manager, all config options available -for each entity manager can be placed directly under doctrine.orm config level. +When you are only using one entity manager, all config options available +for each entity manager can be placed directly under ``doctrine.orm`` config +level. .. code-block:: yaml @@ -442,6 +443,7 @@ for each entity manager can be placed directly under doctrine.orm config level. filters: # ... -This shorten version is commonly used in other documentation sections. Keep in mind that you can't use both syntax at same time. +This shorten version is commonly used in other documentation sections. +Keep in mind that you can't use both syntax at the same time. .. _`DQL User Defined Functions`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html From 822e2c3b2012900ac084792f8d6b33bd712f4007 Mon Sep 17 00:00:00 2001 From: healdropper Date: Sat, 28 Jun 2014 10:54:57 +0200 Subject: [PATCH 14/17] Update doctrine.rst Minor typos changes --- reference/configuration/doctrine.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index abe7d47564b..14715b8a687 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -443,7 +443,7 @@ level. filters: # ... -This shorten version is commonly used in other documentation sections. -Keep in mind that you can't use both syntax at the same time. +This shortened version is commonly used in other documentation sections. +Keep in mind that you can't use both syntaxes at the same time. .. _`DQL User Defined Functions`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html From 1e6e276c40f7b81f26b9142cae74f319c71d593d Mon Sep 17 00:00:00 2001 From: healdropper Date: Sat, 28 Jun 2014 10:57:50 +0200 Subject: [PATCH 15/17] Update doctrine.rst More typos oops :P --- reference/configuration/doctrine.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 14715b8a687..9c58a0fa2ef 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -412,7 +412,7 @@ service where ``[name]`` is the name of the connection. .. _DBAL documentation: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html -Shorten configuration syntax +Shortened Configuration syntax ----------------------------- When you are only using one entity manager, all config options available From 79b496193124d4040ffcf9c359a7ac5cec24779a Mon Sep 17 00:00:00 2001 From: healdropper Date: Sat, 28 Jun 2014 11:08:26 +0200 Subject: [PATCH 16/17] Update doctrine.rst Fix for "Title underline too short" --- reference/configuration/doctrine.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 9c58a0fa2ef..b5e0d72ca98 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -413,7 +413,7 @@ service where ``[name]`` is the name of the connection. .. _DBAL documentation: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html Shortened Configuration syntax ------------------------------ +------------------------------ When you are only using one entity manager, all config options available for each entity manager can be placed directly under ``doctrine.orm`` config From d78478e60e3d6b9b11f9e7077b329c0bd6ec855a Mon Sep 17 00:00:00 2001 From: healdropper Date: Mon, 30 Jun 2014 12:25:56 +0200 Subject: [PATCH 17/17] Update doctrine.rst Included more suggestions --- reference/configuration/doctrine.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index b5e0d72ca98..d1a25c75a39 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -412,12 +412,11 @@ service where ``[name]`` is the name of the connection. .. _DBAL documentation: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html -Shortened Configuration syntax +Shortened Configuration Syntax ------------------------------ When you are only using one entity manager, all config options available -for each entity manager can be placed directly under ``doctrine.orm`` config -level. +can be placed directly under ``doctrine.orm`` config level. .. code-block:: yaml