From 42269d4e74553b8423a9fade158f91475150b772 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 23 Jan 2015 10:10:30 +0100 Subject: [PATCH 01/11] Removed the Stable API chapter from the Symfony book --- book/index.rst | 1 - book/map.rst.inc | 1 - book/stable_api.rst | 55 --------------------------------------------- redirection_map | 1 + 4 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 book/stable_api.rst diff --git a/book/index.rst b/book/index.rst index 915b0fc7a7f..185f7ccb88f 100644 --- a/book/index.rst +++ b/book/index.rst @@ -22,6 +22,5 @@ The Book service_container performance internals - stable_api .. include:: /book/map.rst.inc diff --git a/book/map.rst.inc b/book/map.rst.inc index 573c8027524..0a1b3381c09 100644 --- a/book/map.rst.inc +++ b/book/map.rst.inc @@ -16,4 +16,3 @@ * :doc:`/book/service_container` * :doc:`/book/performance` * :doc:`/book/internals` -* :doc:`/book/stable_api` diff --git a/book/stable_api.rst b/book/stable_api.rst deleted file mode 100644 index 73ced34d6ea..00000000000 --- a/book/stable_api.rst +++ /dev/null @@ -1,55 +0,0 @@ -.. index:: - single: Stable API - -.. _the-symfony2-stable-api: - -The Symfony Stable API -====================== - -The Symfony stable API is a subset of all Symfony published public methods -(components and core bundles) that share the following properties: - -* The namespace and class name won't change; -* The method name won't change; -* The method signature (arguments and return value type) won't change; -* The semantic of what the method does won't change. - -The implementation itself can change though. The only valid case for a change -in the stable API is in order to fix a security issue. - -The stable API is based on a whitelist, tagged with `@api`. Therefore, -everything not tagged explicitly is not part of the stable API. - -.. seealso:: - - You can browse the Symfony API documentation on `api.symfony.com`_. - -.. tip:: - - Read more about the stable API in :doc:`/contributing/code/bc`. - -.. tip:: - - Any third party bundle should also publish its own stable API. - -As of Symfony 2.0, the following components have a public tagged API: - -* BrowserKit -* ClassLoader -* Console -* CssSelector -* DependencyInjection -* DomCrawler -* EventDispatcher -* Filesystem (as of Symfony 2.1) -* Finder -* HttpFoundation -* HttpKernel -* Process -* Routing -* Templating -* Translation -* Validator -* Yaml - -.. _`api.symfony.com`: http://api.symfony.com diff --git a/redirection_map b/redirection_map index e632d829662..2d782f924fb 100644 --- a/redirection_map +++ b/redirection_map @@ -1,3 +1,4 @@ +/book/stable_api /contributing/code/bc /cookbook/deployment-tools /cookbook/deployment/tools /cookbook/doctrine/migrations /bundles/DoctrineFixturesBundle/index /cookbook/doctrine/doctrine_fixtures /bundles/DoctrineFixturesBundle/index From 4d472c20f75a5d8c87c226abf7b3268a4e1a56cc Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 23 Jan 2015 12:03:06 +0100 Subject: [PATCH 02/11] Added a reference about including JS and CSS files in PHP templates --- book/templating.rst | 81 +++++++++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 24 deletions(-) diff --git a/book/templating.rst b/book/templating.rst index 4b003e8bad6..c80437954ba 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -1059,43 +1059,76 @@ one called ``stylesheets`` inside the ``head`` tag and another called ``javascri just above the closing ``body`` tag. These blocks will contain all of the stylesheets and JavaScripts that you'll need throughout your site: -.. code-block:: html+jinja +.. code-configuration:: - {# app/Resources/views/base.html.twig #} - - - {# ... #} + .. code-block:: html+jinja - {% block stylesheets %} - - {% endblock %} - - - {# ... #} + {# app/Resources/views/base.html.twig #} + + + {# ... #} - {% block javascripts %} - - {% endblock %} - - + {% block stylesheets %} + + {% endblock %} + + + {# ... #} + + {% block javascripts %} + + {% endblock %} + + + + .. code-block:: php + + // app/Resources/views/base.html.php + + + + + start('stylesheets') ?> + + stop() ?> + + + + + start('javascripts') ?> + + stop() ?> + + That's easy enough! But what if you need to include an extra stylesheet or JavaScript from a child template? For example, suppose you have a contact page and you need to include a ``contact.css`` stylesheet *just* on that page. From inside that contact page's template, do the following: -.. code-block:: html+jinja +.. code-configuration:: - {# app/Resources/views/Contact/contact.html.twig #} - {% extends 'base.html.twig' %} + .. code-block:: html+jinja - {% block stylesheets %} - {{ parent() }} + {# app/Resources/views/Contact/contact.html.twig #} + {% extends 'base.html.twig' %} - - {% endblock %} + {% block stylesheets %} + {{ parent() }} - {# ... #} + + {% endblock %} + + {# ... #} + + .. code-block:: php + + // app/Resources/views/Contact/contact.html.twig + extend('base.html.php') ?> + + start('stylesheets') ?> + + stop() ?> In the child template, you simply override the ``stylesheets`` block and put your new stylesheet tag inside of that block. Of course, since you want From 5c6d4b21711d2ef0f42595f326063870378d944e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 23 Jan 2015 12:05:46 +0100 Subject: [PATCH 03/11] Fixed a minor RST syntax issue --- book/templating.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/templating.rst b/book/templating.rst index c80437954ba..3a0c52295c5 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -1059,7 +1059,7 @@ one called ``stylesheets`` inside the ``head`` tag and another called ``javascri just above the closing ``body`` tag. These blocks will contain all of the stylesheets and JavaScripts that you'll need throughout your site: -.. code-configuration:: +.. configuration-block:: .. code-block:: html+jinja @@ -1106,7 +1106,7 @@ JavaScript from a child template? For example, suppose you have a contact page and you need to include a ``contact.css`` stylesheet *just* on that page. From inside that contact page's template, do the following: -.. code-configuration:: +.. configuration-block:: .. code-block:: html+jinja From 26415e20393a5dacf80ae8a634ca05ea74530456 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Tue, 27 Jan 2015 09:41:14 +0200 Subject: [PATCH 04/11] Remove block which doesn't make sense after best practices | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- .../dependency_injection/parameters.rst | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/components/dependency_injection/parameters.rst b/components/dependency_injection/parameters.rst index 8e76c4dd615..1ceb887a138 100644 --- a/components/dependency_injection/parameters.rst +++ b/components/dependency_injection/parameters.rst @@ -140,49 +140,6 @@ rather than being tied up and hidden with the service definition: If you were using this elsewhere as well, then you would only need to change the parameter value in one place if needed. -You can also use the parameters in the service definition, for example, -making the class of a service a parameter: - -.. configuration-block:: - - .. code-block:: yaml - - parameters: - mailer.transport: sendmail - - services: - mailer: - class: Mailer - arguments: ["%mailer.transport%"] - - .. code-block:: xml - - - - - - sendmail - - - - - %mailer.transport% - - - - - .. code-block:: php - - use Symfony\Component\DependencyInjection\Reference; - - $container->setParameter('mailer.transport', 'sendmail'); - - $container - ->register('mailer', 'Mailer') - ->addArgument('%mailer.transport%'); - .. note:: The percent sign inside a parameter or argument, as part of the string, must From da708365f324ab4445ce80332b79c54488637286 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Sun, 1 Feb 2015 09:53:25 +0200 Subject: [PATCH 05/11] Fix typos | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- components/serializer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/serializer.rst b/components/serializer.rst index ecab743a6af..e2bda4d5ff9 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -139,7 +139,7 @@ of the ``Person`` class would be encoded in XML format:: EOF; - $person = $serializer->deserialize($data,'Acme\Person','xml'); + $person = $serializer->deserialize($data, 'Acme\Person', 'xml'); In this case, :method:`Symfony\\Component\\Serializer\\Serializer::deserialize` needs three parameters: From 6e023c129985b3805777643111bce7bae2105daa Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Sun, 1 Feb 2015 09:54:47 +0200 Subject: [PATCH 06/11] Fix typos | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.6 | Fixed tickets | --- components/serializer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/serializer.rst b/components/serializer.rst index 96a6ea60f71..0fdd4870e8d 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -331,7 +331,7 @@ having unique identifiers:: $serializer = new Serializer(array($normalizer), array($encoder)); echo $serializer->serialize($org, 'json'); - // {"name":"Les-Tilleuls.coop","members":[{"name":"K\u00e9vin", organization: "Les-Tilleuls.coop"]} + // {"name":"Les-Tilleuls.coop","members":[{"name":"K\u00e9vin", organization: "Les-Tilleuls.coop"}]} JMSSerializer ------------- From e6ffd5ddac28c020bd5f2cbd9ba638119d76de19 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Sun, 1 Feb 2015 10:08:46 +0200 Subject: [PATCH 07/11] Add missing comma in array | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- components/templating/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/templating/introduction.rst b/components/templating/introduction.rst index aac7019f6ed..247ea748c35 100644 --- a/components/templating/introduction.rst +++ b/components/templating/introduction.rst @@ -196,7 +196,7 @@ method is used. $templating = new DelegatingEngine(array( new PhpEngine(...), - new CustomEngine(...) + new CustomEngine(...), )); .. _Packagist: https://packagist.org/packages/symfony/templating From 9ad21ea6b9064a30d21811865d91759086962850 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Sun, 1 Feb 2015 10:32:02 +0200 Subject: [PATCH 08/11] Fix typos | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.6 | Fixed tickets | --- components/var_dumper/advanced.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/var_dumper/advanced.rst b/components/var_dumper/advanced.rst index fb261dfc157..99998826ab2 100644 --- a/components/var_dumper/advanced.rst +++ b/components/var_dumper/advanced.rst @@ -20,7 +20,7 @@ like this:: use Symfony\Component\VarDumper\Dumper\CliDumper; use Symfony\Component\VarDumper\Dumper\HtmlDumper; - VarDumper::setHandler(function($var) { + VarDumper::setHandler(function ($var) { $cloner = new VarCloner(); $dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper(); From 475be21d08e2b14da3f92383b0d0c5666e359180 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Tue, 27 Jan 2015 09:14:33 +0200 Subject: [PATCH 09/11] Change installation method order | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.4 | Fixed tickets | --- components/debug/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/debug/introduction.rst b/components/debug/introduction.rst index 8f3fc17102e..0606cff7026 100644 --- a/components/debug/introduction.rst +++ b/components/debug/introduction.rst @@ -16,8 +16,8 @@ Installation You can install the component in many different ways: -* Use the official Git repository (https://github.com/symfony/Debug); * :doc:`Install it via Composer ` (``symfony/debug`` on `Packagist`_). +* Use the official Git repository (https://github.com/symfony/Debug); Usage ----- From 1db39c20d95ed06d638bf98fbe41b73f17b99f5b Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Tue, 27 Jan 2015 14:09:05 +0200 Subject: [PATCH 10/11] Update introduction.rst --- components/debug/introduction.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/debug/introduction.rst b/components/debug/introduction.rst index 0606cff7026..b5aa07ea9e8 100644 --- a/components/debug/introduction.rst +++ b/components/debug/introduction.rst @@ -16,8 +16,8 @@ Installation You can install the component in many different ways: -* :doc:`Install it via Composer ` (``symfony/debug`` on `Packagist`_). -* Use the official Git repository (https://github.com/symfony/Debug); +* :doc:`Install it via Composer ` (``symfony/debug`` on `Packagist`_); +* Use the official Git repository (https://github.com/symfony/Debug). Usage ----- From 0afc6892a0420090a8124f8d785d36b8679b2cf1 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 1 Feb 2015 17:51:30 -0500 Subject: [PATCH 11/11] [#4928] Backporting change after merging into 2.5 (since 2.3 is a little different) --- components/debug.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/debug.rst b/components/debug.rst index b3eba0dd0ba..68b43ca6b90 100644 --- a/components/debug.rst +++ b/components/debug.rst @@ -16,8 +16,8 @@ Installation You can install the component in many different ways: -* Use the official Git repository (https://github.com/symfony/Debug); * :doc:`Install it via Composer ` (``symfony/debug`` on `Packagist`_). +* Use the official Git repository (https://github.com/symfony/Debug); Usage -----