diff --git a/book/controller.rst b/book/controller.rst index 8e0db4b8bc7..17902efcf9e 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -5,13 +5,13 @@ Controller ========== A controller is a PHP function you create that takes information from the -HTTP request and constructs and returns an HTTP response (as a Symfony2 +HTTP request and constructs and returns an HTTP response (as a Symfony ``Response`` object). The response could be an HTML page, an XML document, a serialized JSON array, an image, a redirect, a 404 error or anything else you can dream up. The controller contains whatever arbitrary logic *your application* needs to render the content of a page. -See how simple this is by looking at a Symfony2 controller in action. +See how simple this is by looking at a Symfony controller in action. The following controller would render a page that simply prints ``Hello world!``:: use Symfony\Component\HttpFoundation\Response; @@ -50,7 +50,7 @@ common examples: Requests, Controller, Response Lifecycle ---------------------------------------- -Every request handled by a Symfony2 project goes through the same simple lifecycle. +Every request handled by a Symfony project goes through the same simple lifecycle. The framework takes care of the repetitive tasks and ultimately executes a controller, which houses your custom application code: @@ -87,7 +87,7 @@ A Simple Controller ------------------- While a controller can be any PHP callable (a function, method on an object, -or a ``Closure``), in Symfony2, a controller is usually a single method inside +or a ``Closure``), in Symfony, a controller is usually a single method inside a controller object. Controllers are also called *actions*. .. code-block:: php @@ -117,7 +117,7 @@ a controller object. Controllers are also called *actions*. This controller is pretty straightforward: -* *line 4*: Symfony2 takes advantage of PHP 5.3 namespace functionality to +* *line 4*: Symfony takes advantage of PHP 5.3 namespace functionality to namespace the entire controller class. The ``use`` keyword imports the ``Response`` class, which the controller must return. @@ -185,8 +185,8 @@ controller and passes in ``ryan`` for the ``$name`` variable. Creating a "page" means simply creating a controller method and associated route. Notice the syntax used to refer to the controller: ``AcmeHelloBundle:Hello:index``. -Symfony2 uses a flexible string notation to refer to different controllers. -This is the most common syntax and tells Symfony2 to look for a controller +Symfony uses a flexible string notation to refer to different controllers. +This is the most common syntax and tells Symfony to look for a controller class called ``HelloController`` inside a bundle named ``AcmeHelloBundle``. The method ``indexAction()`` is then executed. @@ -232,7 +232,7 @@ passed to that method:: The controller has a single argument, ``$name``, which corresponds to the ``{name}`` parameter from the matched route (``ryan`` in the example). In -fact, when executing your controller, Symfony2 matches each argument of +fact, when executing your controller, Symfony matches each argument of the controller with a parameter from the matched route. Take the following example: @@ -369,7 +369,7 @@ Use it! See :doc:`/cookbook/templating/render_without_controller`. The Base Controller Class ------------------------- -For convenience, Symfony2 comes with a base ``Controller`` class that assists +For convenience, Symfony comes with a base ``Controller`` class that assists with some of the most common controller tasks and gives your controller class access to any resource it might need. By extending this ``Controller`` class, you can take advantage of several helper methods. @@ -393,7 +393,7 @@ Add the ``use`` statement atop the ``Controller`` class and then modify the This doesn't actually change anything about how your controller works. In the next section, you'll learn about the helper methods that the base controller -class makes available. These methods are just shortcuts to using core Symfony2 +class makes available. These methods are just shortcuts to using core Symfony functionality that's available to you with or without the use of the base ``Controller`` class. A great way to see the core functionality in action is to look in the @@ -427,7 +427,7 @@ Common Controller Tasks Though a controller can do virtually anything, most controllers will perform the same basic tasks over and over again. These tasks, such as redirecting, forwarding, rendering templates and accessing core services, are very easy -to manage in Symfony2. +to manage in Symfony. .. index:: single: Controller; Redirecting @@ -501,15 +501,15 @@ look something like the following:: } And just like when creating a controller for a route, the order of the arguments -to ``fancyAction`` doesn't matter. Symfony2 matches the index key names +to ``fancyAction`` doesn't matter. Symfony matches the index key names (e.g. ``name``) with the method argument names (e.g. ``$name``). If you -change the order of the arguments, Symfony2 will still pass the correct +change the order of the arguments, Symfony will still pass the correct value to each variable. .. tip:: Like other base ``Controller`` methods, the ``forward`` method is just - a shortcut for core Symfony2 functionality. A forward can be accomplished + a shortcut for core Symfony functionality. A forward can be accomplished directly by duplicating the current request. When this :ref:`sub request ` is executed via the ``http_kernel`` service the ``HttpKernel`` returns a ``Response`` object:: @@ -603,7 +603,7 @@ The Symfony templating engine is explained in great detail in the Accessing other Services ~~~~~~~~~~~~~~~~~~~~~~~~ -When extending the base controller class, you can access any Symfony2 service +When extending the base controller class, you can access any Symfony service via the ``get()`` method. Here are several common services you might need:: $templating = $this->get('templating'); @@ -648,7 +648,7 @@ The ``createNotFoundException()`` method creates a special ``NotFoundHttpExcepti object, which ultimately triggers a 404 HTTP response inside Symfony. Of course, you're free to throw any ``Exception`` class in your controller - -Symfony2 will automatically return a 500 HTTP response code. +Symfony will automatically return a 500 HTTP response code. .. code-block:: php @@ -666,9 +666,9 @@ Both of these error pages can be customized. For details, read the Managing the Session -------------------- -Symfony2 provides a nice session object that you can use to store information +Symfony provides a nice session object that you can use to store information about the user (be it a real person using a browser, a bot, or a web service) -between requests. By default, Symfony2 stores the attributes in a cookie +between requests. By default, Symfony stores the attributes in a cookie by using the native PHP sessions. Storing and retrieving information from the session can be easily achieved diff --git a/book/doctrine.rst b/book/doctrine.rst index 996dcdbee9f..39a07663ad0 100644 --- a/book/doctrine.rst +++ b/book/doctrine.rst @@ -125,7 +125,7 @@ for you: .. sidebar:: Setting up the Database to be UTF8 - One mistake even seasoned developers make when starting a Symfony2 project + One mistake even seasoned developers make when starting a Symfony project is forgetting to setup default charset and collation on their database, ending up with latin type collations, which are default for most databases. They might even remember to do it the very first time, but forget that diff --git a/book/forms.rst b/book/forms.rst index 056b85bcf14..11e2219f4df 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -5,14 +5,14 @@ Forms ===== Dealing with HTML forms is one of the most common - and challenging - tasks for -a web developer. Symfony2 integrates a Form component that makes dealing with +a web developer. Symfony integrates a Form component that makes dealing with forms easy. In this chapter, you'll build a complex form from the ground-up, learning the most important features of the form library along the way. .. note:: The Symfony Form component is a standalone library that can be used outside - of Symfony2 projects. For more information, see the `Symfony2 Form component`_ + of Symfony projects. For more information, see the `Symfony Form component`_ on GitHub. .. index:: @@ -80,7 +80,7 @@ Building the Form ~~~~~~~~~~~~~~~~~ Now that you've created a ``Task`` class, the next step is to create and -render the actual HTML form. In Symfony2, this is done by building a form +render the actual HTML form. In Symfony, this is done by building a form object and then rendering it in a template. For now, this can all be done from inside a controller:: @@ -119,7 +119,7 @@ from inside a controller:: how to build your form in a standalone class, which is recommended as your form becomes reusable. -Creating a form requires relatively little code because Symfony2 form objects +Creating a form requires relatively little code because Symfony form objects are built with a "form builder". The form builder's purpose is to allow you to write simple form "recipes", and have it do all the heavy-lifting of actually building the form. @@ -136,7 +136,7 @@ the server. Support for submit buttons was introduced in Symfony 2.3. Before that, you had to add buttons to the form's HTML manually. -Symfony2 comes with many built-in types that will be discussed shortly +Symfony comes with many built-in types that will be discussed shortly (see :ref:`book-forms-type-reference`). .. index:: @@ -318,7 +318,7 @@ Form Validation --------------- In the previous section, you learned how a form can be submitted with valid -or invalid data. In Symfony2, validation is applied to the underlying object +or invalid data. In Symfony, validation is applied to the underlying object (e.g. ``Task``). In other words, the question isn't whether the "form" is valid, but whether or not the ``$task`` object is valid after the form has applied the submitted data to it. Calling ``$form->isValid()`` is a shortcut @@ -441,7 +441,7 @@ corresponding errors printed out with the form. 'attr' => array('novalidate' => 'novalidate'), )) ?> -Validation is a very powerful feature of Symfony2 and has its own +Validation is a very powerful feature of Symfony and has its own :doc:`dedicated chapter `. .. index:: @@ -982,9 +982,9 @@ to the ``form()`` or the ``form_start()`` helper: .. note:: - If the form's method is not GET or POST, but PUT, PATCH or DELETE, Symfony2 + If the form's method is not GET or POST, but PUT, PATCH or DELETE, Symfony will insert a hidden field with the name ``_method`` that stores this method. - The form will be submitted in a normal POST request, but Symfony2's router + The form will be submitted in a normal POST request, but Symfony's router is capable of detecting the ``_method`` parameter and will interpret it as a PUT, PATCH or DELETE request. Read the cookbook chapter ":doc:`/cookbook/routing/method_parameters`" for more information. @@ -1901,7 +1901,7 @@ Learn more from the Cookbook * :doc:`/cookbook/form/dynamic_form_modification` * :doc:`/cookbook/form/data_transformers` -.. _`Symfony2 Form component`: https://github.com/symfony/Form +.. _`Symfony Form component`: https://github.com/symfony/Form .. _`DateTime`: http://php.net/manual/en/class.datetime.php .. _`Twig Bridge`: https://github.com/symfony/symfony/tree/2.3/src/Symfony/Bridge/Twig .. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/2.3/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig diff --git a/book/from_flat_php_to_symfony2.rst b/book/from_flat_php_to_symfony2.rst index 0a333f4b7d3..c28d5175695 100644 --- a/book/from_flat_php_to_symfony2.rst +++ b/book/from_flat_php_to_symfony2.rst @@ -1,11 +1,13 @@ -Symfony2 versus Flat PHP -======================== +.. _symfony2-versus-flat-php: -**Why is Symfony2 better than just opening up a file and writing flat PHP?** +Symfony versus Flat PHP +======================= + +**Why is Symfony better than just opening up a file and writing flat PHP?** If you've never used a PHP framework, aren't familiar with the MVC philosophy, -or just wonder what all the *hype* is around Symfony2, this chapter is for -you. Instead of *telling* you that Symfony2 allows you to develop faster and +or just wonder what all the *hype* is around Symfony, this chapter is for +you. Instead of *telling* you that Symfony allows you to develop faster and better software than with flat PHP, you'll see for yourself. In this chapter, you'll write a simple application in flat PHP, and then @@ -13,7 +15,7 @@ refactor it to be more organized. You'll travel through time, seeing the decisions behind why web development has evolved over the past several years to where it is now. -By the end, you'll see how Symfony2 can rescue you from mundane tasks and +By the end, you'll see how Symfony can rescue you from mundane tasks and let you take back control of your code. A Simple Blog in Flat PHP @@ -72,7 +74,7 @@ to maintain. There are several problems that need to be addressed: .. note:: Another problem not mentioned here is the fact that the database is - tied to MySQL. Though not covered here, Symfony2 fully integrates `Doctrine`_, + tied to MySQL. Though not covered here, Symfony fully integrates `Doctrine`_, a library dedicated to database abstraction and mapping. Isolating the Presentation @@ -244,7 +246,7 @@ the layout: You've now introduced a methodology that allows for the reuse of the layout. Unfortunately, to accomplish this, you're forced to use a few ugly -PHP functions (``ob_start()``, ``ob_get_clean()``) in the template. Symfony2 +PHP functions (``ob_start()``, ``ob_get_clean()``) in the template. Symfony uses a Templating component that allows this to be accomplished cleanly and easily. You'll see it in action shortly. @@ -396,14 +398,14 @@ As a front controller, ``index.php`` has taken on an entirely new role, one that includes loading the core libraries and routing the application so that one of the two controllers (the ``list_action()`` and ``show_action()`` functions) is called. In reality, the front controller is beginning to look and -act a lot like Symfony2's mechanism for handling and routing requests. +act a lot like Symfony's mechanism for handling and routing requests. .. tip:: Another advantage of a front controller is flexible URLs. Notice that the URL to the blog post show page could be changed from ``/show`` to ``/read`` by changing code in only one location. Before, an entire file needed to - be renamed. In Symfony2, URLs are even more flexible. + be renamed. In Symfony, URLs are even more flexible. By now, the application has evolved from a single PHP file into a structure that is organized and allows for code reuse. You should be happier, but far @@ -415,10 +417,12 @@ routing, calling controllers, templates, etc.). More time will need to be spent to handle form submissions, input validation, logging and security. Why should you have to reinvent solutions to all these routine problems? -Add a Touch of Symfony2 -~~~~~~~~~~~~~~~~~~~~~~~ +.. _add-a-touch-of-symfony2: + +Add a Touch of Symfony +~~~~~~~~~~~~~~~~~~~~~~ -Symfony2 to the rescue. Before actually using Symfony2, you need to download +Symfony to the rescue. Before actually using Symfony, you need to download it. This can be done by using Composer, which takes care of downloading the correct version and all its dependencies and provides an autoloader. An autoloader is a tool that makes it possible to start using PHP classes @@ -450,7 +454,7 @@ which takes care of autoloading for all the files in the Symfony Framework as we the files mentioned in the autoload section of your ``composer.json``. Core to Symfony's philosophy is the idea that an application's main job is -to interpret each request and return a response. To this end, Symfony2 provides +to interpret each request and return a response. To this end, Symfony provides both a :class:`Symfony\\Component\\HttpFoundation\\Request` and a :class:`Symfony\\Component\\HttpFoundation\\Response` class. These classes are object-oriented representations of the raw HTTP request being processed and @@ -485,7 +489,7 @@ the HTTP response being returned. Use them to improve the blog: The controllers are now responsible for returning a ``Response`` object. To make this easier, you can add a new ``render_template()`` function, which, -incidentally, acts quite a bit like the Symfony2 templating engine: +incidentally, acts quite a bit like the Symfony templating engine: .. code-block:: php @@ -519,7 +523,7 @@ incidentally, acts quite a bit like the Symfony2 templating engine: return $html; } -By bringing in a small part of Symfony2, the application is more flexible and +By bringing in a small part of Symfony, the application is more flexible and reliable. The ``Request`` provides a dependable way to access information about the HTTP request. Specifically, the ``getPathInfo()`` method returns a cleaned URI (always returning ``/show`` and never ``/index.php/show``). @@ -531,8 +535,10 @@ allowing HTTP headers and content to be added via an object-oriented interface. And while the responses in this application are simple, this flexibility will pay dividends as your application grows. -The Sample Application in Symfony2 -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. _the-sample-application-in-symfony2: + +The Sample Application in Symfony +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The blog has come a *long* way, but it still contains a lot of code for such a simple application. Along the way, you've made a simple routing @@ -541,8 +547,8 @@ templates. If, for some reason, you needed to continue building this "framework" from scratch, you could at least use Symfony's standalone `Routing`_ and `Templating`_ components, which already solve these problems. -Instead of re-solving common problems, you can let Symfony2 take care of -them for you. Here's the same sample application, now built in Symfony2:: +Instead of re-solving common problems, you can let Symfony take care of +them for you. Here's the same sample application, now built in Symfony:: // src/Acme/BlogBundle/Controller/BlogController.php namespace Acme\BlogBundle\Controller; @@ -632,7 +638,7 @@ The layout is nearly identical: The show template is left as an exercise, as it should be trivial to create based on the list template. -When Symfony2's engine (called the ``Kernel``) boots up, it needs a map so +When Symfony's engine (called the ``Kernel``) boots up, it needs a map so that it knows which controllers to execute based on the request information. A routing configuration map provides this information in a readable format: @@ -647,9 +653,9 @@ A routing configuration map provides this information in a readable format: path: /blog/show/{id} defaults: { _controller: AcmeBlogBundle:Blog:show } -Now that Symfony2 is handling all the mundane tasks, the front controller +Now that Symfony is handling all the mundane tasks, the front controller is dead simple. And since it does so little, you'll never have to touch -it once it's created (and if you use a Symfony2 distribution, you won't +it once it's created (and if you use a Symfony distribution, you won't even need to create it!):: // web/app.php @@ -661,21 +667,23 @@ even need to create it!):: $kernel = new AppKernel('prod', false); $kernel->handle(Request::createFromGlobals())->send(); -The front controller's only job is to initialize Symfony2's engine (``Kernel``) -and pass it a ``Request`` object to handle. Symfony2's core then uses the +The front controller's only job is to initialize Symfony's engine (``Kernel``) +and pass it a ``Request`` object to handle. Symfony's core then uses the routing map to determine which controller to call. Just like before, the controller method is responsible for returning the final ``Response`` object. There's really not much else to it. -For a visual representation of how Symfony2 handles each request, see the +For a visual representation of how Symfony handles each request, see the :ref:`request flow diagram `. -Where Symfony2 Delivers -~~~~~~~~~~~~~~~~~~~~~~~ +.. _where-symfony2-delivers: + +Where Symfony Delivers +~~~~~~~~~~~~~~~~~~~~~~ In the upcoming chapters, you'll learn more about how each piece of Symfony works and the recommended organization of a project. For now, have a look -at how migrating the blog from flat PHP to Symfony2 has improved life: +at how migrating the blog from flat PHP to Symfony has improved life: * Your application now has **clear and consistently organized code** (though Symfony doesn't force you into this). This promotes **reusability** and @@ -685,26 +693,26 @@ at how migrating the blog from flat PHP to Symfony2 has improved life: to develop or maintain low-level utilities** such as :ref:`autoloading `, :doc:`routing `, or rendering :doc:`controllers `; -* Symfony2 gives you **access to open source tools** such as Doctrine and the +* Symfony gives you **access to open source tools** such as Doctrine and the Templating, Security, Form, Validation and Translation components (to name a few); * The application now enjoys **fully-flexible URLs** thanks to the Routing component; -* Symfony2's HTTP-centric architecture gives you access to powerful tools - such as **HTTP caching** powered by **Symfony2's internal HTTP cache** or +* Symfony's HTTP-centric architecture gives you access to powerful tools + such as **HTTP caching** powered by **Symfony's internal HTTP cache** or more powerful tools such as `Varnish`_. This is covered in a later chapter all about :doc:`caching `. -And perhaps best of all, by using Symfony2, you now have access to a whole -set of **high-quality open source tools developed by the Symfony2 community**! -A good selection of Symfony2 community tools can be found on `KnpBundles.com`_. +And perhaps best of all, by using Symfony, you now have access to a whole +set of **high-quality open source tools developed by the Symfony community**! +A good selection of Symfony community tools can be found on `KnpBundles.com`_. Better Templates ---------------- -If you choose to use it, Symfony2 comes standard with a templating engine +If you choose to use it, Symfony comes standard with a templating engine called `Twig`_ that makes templates faster to write and easier to read. It means that the sample application could contain even less code! Take, for example, the list template written in Twig: @@ -744,8 +752,8 @@ The corresponding ``layout.html.twig`` template is also easier to write: -Twig is well-supported in Symfony2. And while PHP templates will always -be supported in Symfony2, the many advantages of Twig will continue to +Twig is well-supported in Symfony. And while PHP templates will always +be supported in Symfony, the many advantages of Twig will continue to be discussed. For more information, see the :doc:`templating chapter `. Learn more from the Cookbook diff --git a/book/http_cache.rst b/book/http_cache.rst index dc77604fd63..766f9303a9d 100644 --- a/book/http_cache.rst +++ b/book/http_cache.rst @@ -8,7 +8,7 @@ The nature of rich web applications means that they're dynamic. No matter how efficient your application, each request will always contain more overhead than serving a static file. -And for most Web applications, that's fine. Symfony2 is lightning fast, and +And for most Web applications, that's fine. Symfony is lightning fast, and unless you're doing some serious heavy-lifting, each request will come back quickly without putting too much stress on your server. @@ -22,28 +22,28 @@ Caching on the Shoulders of Giants The most effective way to improve performance of an application is to cache the full output of a page and then bypass the application entirely on each subsequent request. Of course, this isn't always possible for highly dynamic -websites, or is it? In this chapter, you'll see how the Symfony2 cache +websites, or is it? In this chapter, you'll see how the Symfony cache system works and why this is the best possible approach. -The Symfony2 cache system is different because it relies on the simplicity +The Symfony cache system is different because it relies on the simplicity and power of the HTTP cache as defined in the :term:`HTTP specification`. -Instead of reinventing a caching methodology, Symfony2 embraces the standard +Instead of reinventing a caching methodology, Symfony embraces the standard that defines basic communication on the Web. Once you understand the fundamental HTTP validation and expiration caching models, you'll be ready to master -the Symfony2 cache system. +the Symfony cache system. -For the purposes of learning how to cache with Symfony2, the +For the purposes of learning how to cache with Symfony, the subject is covered in four steps: #. A :ref:`gateway cache `, or reverse proxy, is an independent layer that sits in front of your application. The reverse proxy caches responses as they're returned from your application and answers - requests with cached responses before they hit your application. Symfony2 + requests with cached responses before they hit your application. Symfony provides its own reverse proxy, but any reverse proxy can be used. #. :ref:`HTTP cache ` headers are used to communicate with the gateway cache and any other caches between your - application and the client. Symfony2 provides sensible defaults and a + application and the client. Symfony provides sensible defaults and a powerful interface for interacting with the cache headers. #. HTTP :ref:`expiration and validation ` @@ -85,7 +85,7 @@ the cache sends the cached response to the client, ignoring your application entirely. This type of cache is known as a HTTP gateway cache and many exist such -as `Varnish`_, `Squid in reverse proxy mode`_, and the Symfony2 reverse proxy. +as `Varnish`_, `Squid in reverse proxy mode`_, and the Symfony reverse proxy. .. index:: single: Cache; Types of @@ -126,16 +126,17 @@ the first two cache types. These caches are outside of your control but follow the HTTP cache directions set in the response. .. index:: - single: Cache; Symfony2 reverse proxy + single: Cache; Symfony reverse proxy .. _`symfony-gateway-cache`: +.. _symfony2-reverse-proxy: -Symfony2 Reverse Proxy -~~~~~~~~~~~~~~~~~~~~~~ +Symfony Reverse Proxy +~~~~~~~~~~~~~~~~~~~~~ -Symfony2 comes with a reverse proxy (also called a gateway cache) written +Symfony comes with a reverse proxy (also called a gateway cache) written in PHP. Enable it and cacheable responses from your application will start -to be cached right away. Installing it is just as easy. Each new Symfony2 +to be cached right away. Installing it is just as easy. Each new Symfony application comes with a pre-configured caching kernel (``AppCache``) that wraps the default one (``AppKernel``). The caching Kernel *is* the reverse proxy. @@ -234,28 +235,28 @@ Here is a list of the main options: error is encountered (default: ``60``). This setting is overridden by the ``stale-if-error`` HTTP ``Cache-Control`` extension (see RFC 5861). -If ``debug`` is ``true``, Symfony2 automatically adds a ``X-Symfony-Cache`` +If ``debug`` is ``true``, Symfony automatically adds a ``X-Symfony-Cache`` header to the response containing useful information about cache hits and misses. .. sidebar:: Changing from one Reverse Proxy to another - The Symfony2 reverse proxy is a great tool to use when developing your + The Symfony reverse proxy is a great tool to use when developing your website or when you deploy your website to a shared host where you cannot install anything beyond PHP code. But being written in PHP, it cannot be as fast as a proxy written in C. That's why it is highly recommended you use Varnish or Squid on your production servers if possible. The good news is that the switch from one proxy server to another is easy and transparent as no code modification is needed in your application. Start - easy with the Symfony2 reverse proxy and upgrade later to Varnish when + easy with the Symfony reverse proxy and upgrade later to Varnish when your traffic increases. - For more information on using Varnish with Symfony2, see the + For more information on using Varnish with Symfony, see the :doc:`How to use Varnish ` cookbook chapter. .. note:: - The performance of the Symfony2 reverse proxy is independent of the + The performance of the Symfony reverse proxy is independent of the complexity of the application. That's because the application kernel is only booted when the request needs to be forwarded to it. @@ -349,7 +350,7 @@ To handle this situation, every response may be set to be public or private: for a single user and must not be cached by a shared cache. Symfony conservatively defaults each response to be private. To take advantage -of shared caches (like the Symfony2 reverse proxy), the response will need +of shared caches (like the Symfony reverse proxy), the response will need to be explicitly set as public. .. index:: @@ -381,7 +382,7 @@ HTTP 1.1 allows caching anything by default unless there is an explicit have a cookie, an authorization header, use a non-safe method (i.e. PUT, POST, DELETE), or when responses have a redirect status code. -Symfony2 automatically sets a sensible and conservative ``Cache-Control`` +Symfony automatically sets a sensible and conservative ``Cache-Control`` header when none is set by the developer by following these rules: * If no cache header is defined (``Cache-Control``, ``Expires``, ``ETag`` @@ -392,7 +393,7 @@ header when none is set by the developer by following these rules: its value is set to ``private, must-revalidate``; * But if at least one ``Cache-Control`` directive is set, and no ``public`` or - ``private`` directives have been explicitly added, Symfony2 adds the + ``private`` directives have been explicitly added, Symfony adds the ``private`` directive automatically (except when ``s-maxage`` is set). .. _http-expiration-validation: @@ -595,7 +596,7 @@ doing so much work. .. tip:: - Symfony2 also supports weak ETags by passing ``true`` as the second + Symfony also supports weak ETags by passing ``true`` as the second argument to the :method:`Symfony\\Component\\HttpFoundation\\Response::setETag` method. @@ -766,7 +767,7 @@ at some interval (the expiration) to verify that the content is still valid. .. tip:: You can also define HTTP caching headers for expiration and validation by using - annotations. See the + annotations. See the :doc:`FrameworkExtraBundle documentation `. .. index:: @@ -809,13 +810,13 @@ Using Edge Side Includes Gateway caches are a great way to make your website perform better. But they have one limitation: they can only cache whole pages. If you can't cache whole pages or if parts of a page has "more" dynamic parts, you are out of -luck. Fortunately, Symfony2 provides a solution for these cases, based on a +luck. Fortunately, Symfony provides a solution for these cases, based on a technology called `ESI`_, or Edge Side Includes. Akamai wrote this specification almost 10 years ago, and it allows specific parts of a page to have a different caching strategy than the main page. The ESI specification describes tags you can embed in your pages to communicate -with the gateway cache. Only one tag is implemented in Symfony2, ``include``, +with the gateway cache. Only one tag is implemented in Symfony, ``include``, as this is the only useful one outside of Akamai context: .. code-block:: html @@ -848,10 +849,12 @@ page and sends the final content to the client. All of this happens transparently at the gateway cache level (i.e. outside of your application). As you'll see, if you choose to take advantage of ESI -tags, Symfony2 makes the process of including them almost effortless. +tags, Symfony makes the process of including them almost effortless. -Using ESI in Symfony2 -~~~~~~~~~~~~~~~~~~~~~ +.. _using-esi-in-symfony2: + +Using ESI in Symfony +~~~~~~~~~~~~~~~~~~~~ First, to use ESI, be sure to enable it in your application configuration: @@ -909,7 +912,7 @@ This is done via the ``render`` helper (See :ref:`templating-embedding-controlle for more details). As the embedded content comes from another page (or controller for that -matter), Symfony2 uses the standard ``render`` helper to configure ESI tags: +matter), Symfony uses the standard ``render`` helper to configure ESI tags: .. configuration-block:: @@ -934,24 +937,24 @@ matter), Symfony2 uses the standard ``render`` helper to configure ESI tags: ) ?> By using the ``esi`` renderer (via the ``render_esi`` Twig function), you -tell Symfony2 that the action should be rendered as an ESI tag. You might be +tell Symfony that the action should be rendered as an ESI tag. You might be wondering why you would want to use a helper instead of just writing the ESI tag yourself. That's because using a helper makes your application work even if there is no gateway cache installed. When using the default ``render`` function (or setting the renderer to -``inline``), Symfony2 merges the included page content into the main one +``inline``), Symfony merges the included page content into the main one before sending the response to the client. But if you use the ``esi`` renderer -(i.e. call ``render_esi``), *and* if Symfony2 detects that it's talking to a +(i.e. call ``render_esi``), *and* if Symfony detects that it's talking to a gateway cache that supports ESI, it generates an ESI include tag. But if there -is no gateway cache or if it does not support ESI, Symfony2 will just merge +is no gateway cache or if it does not support ESI, Symfony will just merge the included page content within the main one as it would have done if you had used ``render``. .. note:: - Symfony2 detects if a gateway cache supports ESI via another Akamai - specification that is supported out of the box by the Symfony2 reverse + Symfony detects if a gateway cache supports ESI via another Akamai + specification that is supported out of the box by the Symfony reverse proxy. The embedded action can now specify its own caching rules, entirely independent @@ -971,7 +974,7 @@ component cache will only last for 60 seconds. When using a controller reference, the ESI tag should reference the embedded action as an accessible URL so the gateway cache can fetch it independently of -the rest of the page. Symfony2 takes care of generating a unique URL for any +the rest of the page. Symfony takes care of generating a unique URL for any controller reference and it is able to route them properly thanks to the :class:`Symfony\\Component\\HttpKernel\\EventListener\\FragmentListener` that must be enabled in your configuration: @@ -1062,7 +1065,7 @@ Actually, all reverse proxies provide ways to purge cached data, but you should avoid them as much as possible. The most standard way is to purge the cache for a given URL by requesting it with the special ``PURGE`` HTTP method. -Here is how you can configure the Symfony2 reverse proxy to support the +Here is how you can configure the Symfony reverse proxy to support the ``PURGE`` HTTP method:: // app/AppCache.php @@ -1102,10 +1105,10 @@ Here is how you can configure the Symfony2 reverse proxy to support the Summary ------- -Symfony2 was designed to follow the proven rules of the road: HTTP. Caching -is no exception. Mastering the Symfony2 cache system means becoming familiar +Symfony was designed to follow the proven rules of the road: HTTP. Caching +is no exception. Mastering the Symfony cache system means becoming familiar with the HTTP cache models and using them effectively. This means that, instead -of relying only on Symfony2 documentation and code examples, you have access +of relying only on Symfony documentation and code examples, you have access to a world of knowledge related to HTTP caching and gateway caches such as Varnish. diff --git a/book/http_fundamentals.rst b/book/http_fundamentals.rst index 8db213faa9b..50a7eadd91f 100644 --- a/book/http_fundamentals.rst +++ b/book/http_fundamentals.rst @@ -1,21 +1,23 @@ .. index:: - single: Symfony2 Fundamentals + single: Symfony Fundamentals -Symfony2 and HTTP Fundamentals -============================== +.. _symfony2-and-http-fundamentals: -Congratulations! By learning about Symfony2, you're well on your way towards +Symfony and HTTP Fundamentals +============================= + +Congratulations! By learning about Symfony, you're well on your way towards being a more *productive*, *well-rounded* and *popular* web developer (actually, -you're on your own for the last part). Symfony2 is built to get back to +you're on your own for the last part). Symfony is built to get back to basics: to develop tools that let you develop faster and build more robust applications, while staying out of your way. Symfony is built on the best ideas from many technologies: the tools and concepts you're about to learn represent the efforts of thousands of people, over many years. In other words, you're not just learning "Symfony", you're learning the fundamentals of the web, development best practices, and how to use many amazing new PHP libraries, -inside or independently of Symfony2. So, get ready. +inside or independently of Symfony. So, get ready. -True to the Symfony2 philosophy, this chapter begins by explaining the fundamental +True to the Symfony philosophy, this chapter begins by explaining the fundamental concept common to web development: HTTP. Regardless of your background or preferred programming language, this chapter is a **must-read** for everyone. @@ -35,8 +37,8 @@ HTTP is the term used to describe this simple text-based language. And no matter how you develop on the web, the goal of your server is *always* to understand simple text requests, and return simple text responses. -Symfony2 is built from the ground-up around that reality. Whether you realize -it or not, HTTP is something you use everyday. With Symfony2, you'll learn +Symfony is built from the ground-up around that reality. Whether you realize +it or not, HTTP is something you use everyday. With Symfony, you'll learn how to master it. .. index:: @@ -173,7 +175,7 @@ Symfony is architected to match this reality. while browsing is the `Live HTTP Headers`_ extension for Firefox. .. index:: - single: Symfony2 Fundamentals; Requests and responses + single: Symfony Fundamentals; Requests and responses Requests and Responses in PHP ----------------------------- @@ -264,7 +266,7 @@ the user is connecting via a secured connection (i.e. HTTPS). The Request class also has a public ``attributes`` property, which holds special data related to how the application works internally. For the - Symfony2 framework, the ``attributes`` holds the values returned by the + Symfony framework, the ``attributes`` holds the values returned by the matched route, like ``_controller``, ``id`` (if you have an ``{id}`` wildcard), and even the name of the matched route (``_route``). The ``attributes`` property exists entirely to be a place where you can @@ -393,7 +395,7 @@ the same simple pattern for every request: .. figure:: /images/request-flow.png :align: center - :alt: Symfony2 request flow + :alt: Symfony request flow Incoming requests are interpreted by the routing and passed to controller functions that return ``Response`` objects. @@ -491,8 +493,10 @@ template file. This frees up the controller to worry only about the hard stuff: interacting with the database, handling submitted data, or sending email messages. -Symfony2: Build your App, not your Tools. ------------------------------------------ +.. _symfony2-build-your-app-not-your-tools: + +Symfony: Build your App, not your Tools. +---------------------------------------- You now know that the goal of any app is to interpret each incoming request and create an appropriate response. As an application grows, it becomes more @@ -503,18 +507,20 @@ emails, validating user input and handling security. The good news is that none of these problems is unique. Symfony provides a framework full of tools that allow you to build your application, not your -tools. With Symfony2, nothing is imposed on you: you're free to use the full +tools. With Symfony, nothing is imposed on you: you're free to use the full Symfony framework, or just one piece of Symfony all by itself. .. index:: - single: Symfony2 Components + single: Symfony Components -Standalone Tools: The Symfony2 *Components* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. _standalone-tools-the-symfony2-components: -So what *is* Symfony2? First, Symfony2 is a collection of over twenty independent +Standalone Tools: The Symfony *Components* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +So what *is* Symfony? First, Symfony is a collection of over twenty independent libraries that can be used inside *any* PHP project. These libraries, called -the *Symfony2 Components*, contain something useful for almost any situation, +the *Symfony Components*, contain something useful for almost any situation, regardless of how your project is developed. To name a few: * :doc:`HttpFoundation ` - Contains @@ -546,16 +552,18 @@ regardless of how your project is developed. To name a few: * `Translation`_ - A framework for translating strings in your application. Each and every one of these components is decoupled and can be used in *any* -PHP project, regardless of whether or not you use the Symfony2 framework. +PHP project, regardless of whether or not you use the Symfony framework. Every part is made to be used if needed and replaced when necessary. -The Full Solution: The Symfony2 *Framework* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. _the-full-solution-the-symfony2-framework: + +The Full Solution: The Symfony *Framework* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -So then, what *is* the Symfony2 *Framework*? The *Symfony2 Framework* is +So then, what *is* the Symfony *Framework*? The *Symfony Framework* is a PHP library that accomplishes two distinct tasks: -#. Provides a selection of components (i.e. the Symfony2 Components) and +#. Provides a selection of components (i.e. the Symfony Components) and third-party libraries (e.g. `Swift Mailer`_ for sending emails); #. Provides sensible configuration and a "glue" library that ties all of these @@ -563,12 +571,12 @@ a PHP library that accomplishes two distinct tasks: The goal of the framework is to integrate many independent tools in order to provide a consistent experience for the developer. Even the framework -itself is a Symfony2 bundle (i.e. a plugin) that can be configured or replaced +itself is a Symfony bundle (i.e. a plugin) that can be configured or replaced entirely. -Symfony2 provides a powerful set of tools for rapidly developing web applications +Symfony provides a powerful set of tools for rapidly developing web applications without imposing on your application. Normal users can quickly start development -by using a Symfony2 distribution, which provides a project skeleton with +by using a Symfony distribution, which provides a project skeleton with sensible defaults. For more advanced users, the sky is the limit. .. _`xkcd`: http://xkcd.com/ diff --git a/book/installation.rst b/book/installation.rst index f106786aef2..6dacc986a41 100644 --- a/book/installation.rst +++ b/book/installation.rst @@ -14,30 +14,32 @@ developing in immediately. If you're looking for instructions on how best to create a new project and store it via source control, see `Using Source Control`_. -Installing a Symfony2 Distribution ----------------------------------- +.. _installing-a-symfony2-distribution: + +Installing a Symfony Distribution +--------------------------------- .. tip:: First, check that you have installed and configured a Web server (such - as Apache) with PHP. For more information on Symfony2 requirements, see the + as Apache) with PHP. For more information on Symfony requirements, see the :doc:`requirements reference `. -Symfony2 packages "distributions", which are fully-functional applications -that include the Symfony2 core libraries, a selection of useful bundles, a +Symfony packages "distributions", which are fully-functional applications +that include the Symfony core libraries, a selection of useful bundles, a sensible directory structure and some default configuration. When you download -a Symfony2 distribution, you're downloading a functional application skeleton +a Symfony distribution, you're downloading a functional application skeleton that can be used immediately to begin developing your application. -Start by visiting the Symfony2 download page at `http://symfony.com/download`_. +Start by visiting the Symfony download page at `http://symfony.com/download`_. On this page, you'll see the *Symfony Standard Edition*, which is the main -Symfony2 distribution. There are 2 ways to get your project started: +Symfony distribution. There are 2 ways to get your project started: Option 1) Composer ~~~~~~~~~~~~~~~~~~ `Composer`_ is a dependency management library for PHP, which you can use -to download the Symfony2 Standard Edition. +to download the Symfony Standard Edition. Start by `downloading Composer`_ anywhere onto your local computer. If you have curl installed, it's as easy as: @@ -119,7 +121,7 @@ next section. information. All public files and the front controller that handles incoming requests in -a Symfony2 application live in the ``Symfony/web/`` directory. So, assuming +a Symfony application live in the ``Symfony/web/`` directory. So, assuming you unpacked the archive into your web server's or virtual host's document root, your application's URLs will start with ``http://localhost/Symfony/web/``. @@ -202,7 +204,7 @@ At this point, all of the needed third-party libraries now live in the ``vendor/ directory. You also have a default application setup in ``app/`` and some sample code inside the ``src/`` directory. -Symfony2 comes with a visual server configuration tester to help make sure +Symfony comes with a visual server configuration tester to help make sure your Web server and PHP are configured to use Symfony. Use the following URL to check your configuration: @@ -282,13 +284,13 @@ If there are any issues, correct them now before moving on. and Group values). When everything is fine, click on "Go to the Welcome page" to request your -first "real" Symfony2 webpage: +first "real" Symfony webpage: .. code-block:: text http://localhost/app_dev.php/ -Symfony2 should welcome and congratulate you for your hard work so far! +Symfony should welcome and congratulate you for your hard work so far! .. image:: /images/quick_tour/welcome.png @@ -307,7 +309,7 @@ Symfony2 should welcome and congratulate you for your hard work so far! Beginning Development --------------------- -Now that you have a fully-functional Symfony2 application, you can begin +Now that you have a fully-functional Symfony application, you can begin development! Your distribution may contain some sample code - check the ``README.md`` file included with the distribution (open it as a text file) to learn about what sample code was included with your distribution. diff --git a/book/internals.rst b/book/internals.rst index 939b0f56839..1bd8db4699f 100644 --- a/book/internals.rst +++ b/book/internals.rst @@ -4,19 +4,19 @@ Internals ========= -Looks like you want to understand how Symfony2 works and how to extend it. +Looks like you want to understand how Symfony works and how to extend it. That makes me very happy! This section is an in-depth explanation of the -Symfony2 internals. +Symfony internals. .. note:: - You only need to read this section if you want to understand how Symfony2 - works behind the scenes, or if you want to extend Symfony2. + You only need to read this section if you want to understand how Symfony + works behind the scenes, or if you want to extend Symfony. Overview -------- -The Symfony2 code is made of several independent layers. Each layer is built +The Symfony code is made of several independent layers. Each layer is built on top of the previous one. .. tip:: @@ -81,11 +81,11 @@ Kernel ------ The :class:`Symfony\\Component\\HttpKernel\\HttpKernel` class is the central -class of Symfony2 and is responsible for handling client requests. Its main +class of Symfony and is responsible for handling client requests. Its main goal is to "convert" a :class:`Symfony\\Component\\HttpFoundation\\Request` object to a :class:`Symfony\\Component\\HttpFoundation\\Response` object. -Every Symfony2 Kernel implements +Every Symfony Kernel implements :class:`Symfony\\Component\\HttpKernel\\HttpKernelInterface`:: function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true) @@ -129,11 +129,11 @@ the Request attributes. .. sidebar:: Matching Controller Method Arguments from Request Attributes - For each method argument, Symfony2 tries to get the value of a Request + For each method argument, Symfony tries to get the value of a Request attribute with the same name. If it is not defined, the argument default value is used if defined:: - // Symfony2 will look for an 'id' attribute (mandatory) + // Symfony will look for an 'id' attribute (mandatory) // and an 'admin' one (optional) public function showAction($id, $admin = true) { @@ -245,7 +245,7 @@ add the following code at the beginning of your listener method:: .. tip:: - If you are not yet familiar with the Symfony2 EventDispatcher, read the + If you are not yet familiar with the Symfony EventDispatcher, read the :doc:`EventDispatcher component documentation ` section first. @@ -471,15 +471,15 @@ see the :doc:`EventDispatcher component documentation handle(Request::createFromGlobals())->send(); The front controller file (``app.php`` in this example) is the actual PHP -file that's executed when using a Symfony2 application and its job is to +file that's executed when using a Symfony application and its job is to use a Kernel class, ``AppKernel``, to bootstrap the application. .. tip:: @@ -606,9 +608,9 @@ The Bundle System ----------------- A bundle is similar to a plugin in other software, but even better. The key -difference is that *everything* is a bundle in Symfony2, including both the +difference is that *everything* is a bundle in Symfony, including both the core framework functionality and the code written for your application. -Bundles are first-class citizens in Symfony2. This gives you the flexibility +Bundles are first-class citizens in Symfony. This gives you the flexibility to use pre-built features packaged in `third-party bundles`_ or to distribute your own bundles. It makes it easy to pick and choose which features to enable in your application and to optimize them the way you want. @@ -724,7 +726,7 @@ generating a basic bundle skeleton: $ php app/console generate:bundle --namespace=Acme/TestBundle The bundle skeleton generates with a basic controller, template and routing -resource that can be customized. You'll learn more about Symfony2's command-line +resource that can be customized. You'll learn more about Symfony's command-line tools later. .. tip:: @@ -738,7 +740,7 @@ Bundle Directory Structure The directory structure of a bundle is simple and flexible. By default, the bundle system follows a set of conventions that help to keep code consistent -between all Symfony2 bundles. Take a look at ``AcmeDemoBundle``, as it contains +between all Symfony bundles. Take a look at ``AcmeDemoBundle``, as it contains some of the most common elements of a bundle: * ``Controller/`` contains the controllers of the bundle (e.g. ``RandomController.php``); @@ -860,7 +862,7 @@ routing, templating, and other core systems. For now, don't worry about the specific configuration options in each section. The configuration file ships with sensible defaults. As you read more and -explore each part of Symfony2, you'll learn about the specific configuration +explore each part of Symfony, you'll learn about the specific configuration options of each feature. .. sidebar:: Configuration Formats @@ -915,7 +917,7 @@ rebuilt on each request in the ``dev`` environment (for the developer's convenie but cached in the ``prod`` environment. All environments live together on the same machine and execute the same application. -A Symfony2 project generally begins with three environments (``dev``, ``test`` +A Symfony project generally begins with three environments (``dev``, ``test`` and ``prod``), though creating new environments is easy. You can view your application in different environments simply by changing the front controller in your browser. To see the application in the ``dev`` environment, access @@ -1043,7 +1045,7 @@ just pieces of it between environments. Summary ------- -Congratulations! You've now seen every fundamental aspect of Symfony2 and have +Congratulations! You've now seen every fundamental aspect of Symfony and have hopefully discovered how easy and flexible it can be. And while there are *a lot* of features still to come, be sure to keep the following basic points in mind: @@ -1056,7 +1058,7 @@ in mind: and ``vendor/`` (third-party code) (there's also a ``bin/`` directory that's used to help updated vendor libraries); -* Each feature in Symfony2 (including the Symfony2 framework core) is organized +* Each feature in Symfony (including the Symfony framework core) is organized into a *bundle*, which is a structured set of files for that feature; * The **configuration** for each bundle lives in the ``Resources/config`` @@ -1069,7 +1071,7 @@ in mind: ``app.php`` and ``app_dev.php``) and loads a different configuration file. From here, each chapter will introduce you to more and more powerful tools -and advanced concepts. The more you know about Symfony2, the more you'll +and advanced concepts. The more you know about Symfony, the more you'll appreciate the flexibility of its architecture and the power it gives you to rapidly develop applications. diff --git a/book/performance.rst b/book/performance.rst index 47fdb482c78..b2e21a42610 100644 --- a/book/performance.rst +++ b/book/performance.rst @@ -4,7 +4,7 @@ Performance =========== -Symfony2 is fast, right out of the box. Of course, if you really need speed, +Symfony is fast, right out of the box. Of course, if you really need speed, there are many ways that you can make Symfony even faster. In this chapter, you'll explore many of the most common and powerful ways to make your Symfony application even faster. @@ -21,7 +21,7 @@ the need to constantly recompile the PHP source code. There are a number of `byte code caches`_ available, some of which are open source. The most widely used byte code cache is probably `APC`_ -Using a byte code cache really has no downside, and Symfony2 has been architected +Using a byte code cache really has no downside, and Symfony has been architected to perform really well in this type of environment. Further Optimizations @@ -45,7 +45,7 @@ your ``php.ini`` configuration. Use Composer's Class Map Functionality -------------------------------------- -By default, the Symfony2 standard edition uses Composer's autoloader +By default, the Symfony standard edition uses Composer's autoloader in the `autoload.php`_ file. This autoloader is easy to use, as it will automatically find any new classes that you've placed in the registered directories. @@ -105,16 +105,16 @@ For more details, see :doc:`/components/class_loader/cache_class_loader`. Use Bootstrap Files ------------------- -To ensure optimal flexibility and code reuse, Symfony2 applications leverage +To ensure optimal flexibility and code reuse, Symfony applications leverage a variety of classes and 3rd party components. But loading all of these classes from separate files on each request can result in some overhead. To reduce -this overhead, the Symfony2 Standard Edition provides a script to generate +this overhead, the Symfony Standard Edition provides a script to generate a so-called `bootstrap file`_, consisting of multiple classes definitions in a single file. By including this file (which contains a copy of many of the core classes), Symfony no longer needs to include any of the source files containing those classes. This will reduce disc IO quite a bit. -If you're using the Symfony2 Standard Edition, then you're probably already +If you're using the Symfony Standard Edition, then you're probably already using the bootstrap file. To be sure, open your front controller (usually ``app.php``) and check to make sure that the following line exists:: @@ -123,11 +123,11 @@ using the bootstrap file. To be sure, open your front controller (usually Note that there are two disadvantages when using a bootstrap file: * the file needs to be regenerated whenever any of the original sources change - (i.e. when you update the Symfony2 source or vendor libraries); + (i.e. when you update the Symfony source or vendor libraries); * when debugging, one will need to place break points inside the bootstrap file. -If you're using Symfony2 Standard Edition, the bootstrap file is automatically +If you're using the Symfony Standard Edition, the bootstrap file is automatically rebuilt after updating the vendor libraries via the ``php composer.phar install`` command. diff --git a/book/propel.rst b/book/propel.rst index b48b5f3a5a1..79377a03526 100644 --- a/book/propel.rst +++ b/book/propel.rst @@ -5,7 +5,7 @@ Databases and Propel ==================== One of the most common and challenging tasks for any application -involves persisting and reading information to and from a database. Symfony2 +involves persisting and reading information to and from a database. Symfony does not come integrated with any ORMs but the Propel integration is easy. To install Propel, read `Working With Symfony2`_ on the Propel documentation. @@ -60,7 +60,7 @@ configuration file (``config.yml``): password: "%database_password%" dsn: "%database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%" -Now that Propel knows about your database, Symfony2 can create the database for +Now that Propel knows about your database, Symfony can create the database for you: .. code-block:: bash @@ -81,7 +81,7 @@ generated by Propel contain some business logic. .. note:: - For people who use Symfony2 with Doctrine2, **models** are equivalent to + For people who use Symfony with Doctrine2, **models** are equivalent to **entities**. Suppose you're building an application where products need to be displayed. @@ -272,7 +272,7 @@ from cheapest to most expensive. From inside a controller, do the following:: ->find(); In one line, you get your products in a powerful oriented object way. No need -to waste your time with SQL or whatever, Symfony2 offers fully object oriented +to waste your time with SQL or whatever, Symfony offers fully object oriented programming and Propel respects the same philosophy by providing an awesome abstraction layer. @@ -479,7 +479,7 @@ Propel provides the following hooks: Behaviors --------- -All bundled behaviors in Propel are working with Symfony2. To get more +All bundled behaviors in Propel are working with Symfony. To get more information about how to use Propel behaviors, look at the `Behaviors reference section`_. diff --git a/book/routing.rst b/book/routing.rst index b8e8dcfa1d2..39759c52edc 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -13,7 +13,7 @@ URL of a page from ``/blog`` to ``/news``? How many links should you need to hunt down and update to make the change? If you're using Symfony's router, the change is simple. -The Symfony2 router lets you define creative URLs that you map to different +The Symfony router lets you define creative URLs that you map to different areas of your application. By the end of this chapter, you'll be able to: * Create complex routes that map to controllers @@ -106,7 +106,7 @@ Congratulations! You've just created your first route and connected it to a controller. Now, when you visit ``/blog/my-post``, the ``showAction`` controller will be executed and the ``$slug`` variable will be equal to ``my-post``. -This is the goal of the Symfony2 router: to map the URL of a request to a +This is the goal of the Symfony router: to map the URL of a request to a controller. Along the way, you'll learn all sorts of tricks that make mapping even the most complex URLs easy. @@ -125,22 +125,22 @@ else. Take the following HTTP request for example: GET /blog/my-blog-post -The goal of the Symfony2 routing system is to parse this URL and determine +The goal of the Symfony routing system is to parse this URL and determine which controller should be executed. The whole process looks like this: -#. The request is handled by the Symfony2 front controller (e.g. ``app.php``); +#. The request is handled by the Symfony front controller (e.g. ``app.php``); -#. The Symfony2 core (i.e. Kernel) asks the router to inspect the request; +#. The Symfony core (i.e. Kernel) asks the router to inspect the request; #. The router matches the incoming URL to a specific route and returns information about the route, including the controller that should be executed; -#. The Symfony2 Kernel executes the controller, which ultimately returns +#. The Symfony Kernel executes the controller, which ultimately returns a ``Response`` object. .. figure:: /images/request-flow.png :align: center - :alt: Symfony2 request flow + :alt: Symfony request flow The routing layer is a tool that translates the incoming URL into a specific controller to execute. @@ -244,7 +244,7 @@ A basic route consists of just two parts: the ``path`` to match and a return $collection; This route matches the homepage (``/``) and maps it to the ``AcmeDemoBundle:Main:homepage`` -controller. The ``_controller`` string is translated by Symfony2 into an +controller. The ``_controller`` string is translated by Symfony into an actual PHP function and executed. That process will be explained shortly in the :ref:`controller-string-syntax` section. diff --git a/book/security.rst b/book/security.rst index 53e35165cc8..a0dbdac562d 100644 --- a/book/security.rst +++ b/book/security.rst @@ -274,7 +274,7 @@ the request flow is always the same: .. tip:: - You'll also learn later how *anything* can be secured in Symfony2, including + You'll also learn later how *anything* can be secured in Symfony, including specific controllers, objects, or even PHP methods. .. _book-security-form-login: @@ -809,7 +809,7 @@ You can define as many URL patterns as you need - each is a regular expression. Understanding how ``access_control`` Works ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -For each incoming request, Symfony2 checks each ``access_control`` entry +For each incoming request, Symfony checks each ``access_control`` entry to find *one* that matches the current request. As soon as it finds a matching ``access_control`` entry, it stops - only the **first** matching ``access_control`` is used to enforce access. @@ -825,7 +825,7 @@ things: 1. Matching Options ................... -Symfony2 creates an instance of :class:`Symfony\\Component\\HttpFoundation\\RequestMatcher` +Symfony creates an instance of :class:`Symfony\\Component\\HttpFoundation\\RequestMatcher` for each ``access_control`` entry, which determines whether or not a given access control should be used on this request. The following ``access_control`` options are used for matching: @@ -937,7 +937,7 @@ will match any ``ip``, ``host`` or ``method``: 2. Access Enforcement ..................... -Once Symfony2 has decided which ``access_control`` entry matches (if any), +Once Symfony has decided which ``access_control`` entry matches (if any), it then *enforces* access restrictions based on the ``roles`` and ``requires_channel`` options: @@ -1241,10 +1241,10 @@ During authentication, the user submits a set of credentials (usually a username and password). The job of the authentication system is to match those credentials against some pool of users. So where does this list of users come from? -In Symfony2, users can come from anywhere - a configuration file, a database +In Symfony, users can come from anywhere - a configuration file, a database table, a web service, or anything else you can dream up. Anything that provides one or more users to the authentication system is known as a "user provider". -Symfony2 comes standard with the two most common user providers: one that +Symfony comes standard with the two most common user providers: one that loads users from a configuration file and one that loads users from a database table. @@ -1790,7 +1790,7 @@ doesn't need to be defined anywhere - you can just start using it. .. note:: All roles **must** begin with the ``ROLE_`` prefix to be managed by - Symfony2. If you define your own roles with a dedicated ``Role`` class + Symfony. If you define your own roles with a dedicated ``Role`` class (more advanced), don't use the ``ROLE_`` prefix. .. _book-security-role-hierarchy: @@ -2163,12 +2163,12 @@ more information on configuring the logout, see the Stateless Authentication ------------------------ -By default, Symfony2 relies on a cookie (the Session) to persist the security +By default, Symfony relies on a cookie (the Session) to persist the security context of the user. But if you use certificates or HTTP authentication for instance, persistence is not needed as credentials are available for each request. In that case, and if you don't need to store anything else between requests, you can activate the stateless authentication (which means that no -cookie will be ever created by Symfony2): +cookie will be ever created by Symfony): .. configuration-block:: @@ -2209,7 +2209,7 @@ cookie will be ever created by Symfony2): .. note:: - If you use a form login, Symfony2 will create a cookie even if you set + If you use a form login, Symfony will create a cookie even if you set ``stateless`` to ``true``. Utilities diff --git a/book/service_container.rst b/book/service_container.rst index f03793e54a4..34120f60ee7 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -12,15 +12,15 @@ your product inventory, or another object that processes data from a third-party API. The point is that a modern application does many things and is organized into many objects that handle each task. -This chapter is about a special PHP object in Symfony2 that helps +This chapter is about a special PHP object in Symfony that helps you instantiate, organize and retrieve the many objects of your application. This object, called a service container, will allow you to standardize and centralize the way objects are constructed in your application. The container makes your life easier, is super fast, and emphasizes an architecture that -promotes reusable and decoupled code. Since all core Symfony2 classes +promotes reusable and decoupled code. Since all core Symfony classes use the container, you'll learn how to extend, configure and use any object -in Symfony2. In large part, the service container is the biggest contributor -to the speed and extensibility of Symfony2. +in Symfony. In large part, the service container is the biggest contributor +to the speed and extensibility of Symfony. Finally, configuring and using the service container is easy. By the end of this chapter, you'll be comfortable creating your own objects via the @@ -61,7 +61,7 @@ application into a series of services. Since each service does just one job, you can easily access each service and use its functionality wherever you need it. Each service can also be more easily tested and configured since it's separated from the other functionality in your application. This idea -is called `service-oriented architecture`_ and is not unique to Symfony2 +is called `service-oriented architecture`_ and is not unique to Symfony or even PHP. Structuring your application around a set of independent service classes is a well-known and trusted object-oriented best-practice. These skills are key to being a good developer in almost any language. @@ -107,7 +107,7 @@ be specified in YAML, XML or PHP: .. note:: - When Symfony2 initializes, it builds the service container using the + When Symfony initializes, it builds the service container using the application configuration (``app/config/config.yml`` by default). The exact file that's loaded is dictated by the ``AppKernel::registerContainerConfiguration()`` method, which loads an environment-specific configuration file (e.g. @@ -115,7 +115,7 @@ be specified in YAML, XML or PHP: for ``prod``). An instance of the ``Acme\HelloBundle\Mailer`` object is now available via -the service container. The container is available in any traditional Symfony2 +the service container. The container is available in any traditional Symfony controller where you can access the services of the container via the ``get()`` shortcut method:: @@ -266,13 +266,13 @@ Importing other Container Configuration Resources In this section, service configuration files are referred to as *resources*. This is to highlight the fact that, while most configuration resources - will be files (e.g. YAML, XML, PHP), Symfony2 is so flexible that configuration + will be files (e.g. YAML, XML, PHP), Symfony is so flexible that configuration could be loaded from anywhere (e.g. a database or even via an external web service). The service container is built using a single configuration resource (``app/config/config.yml`` by default). All other service configuration -(including the core Symfony2 and third-party bundle configuration) must +(including the core Symfony and third-party bundle configuration) must be imported from inside this file in one way or another. This gives you absolute flexibility over the services in your application. @@ -393,10 +393,10 @@ directory. Importing Configuration via Container Extensions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When developing in Symfony2, you'll most commonly use the ``imports`` directive +When developing in Symfony, you'll most commonly use the ``imports`` directive to import container configuration from the bundles you've created specifically for your application. Third-party bundle container configuration, including -Symfony2 core services, are usually loaded using another method that's more +Symfony core services, are usually loaded using another method that's more flexible and easy to configure in your application. Here's how it works. Internally, each bundle defines its services very much @@ -419,7 +419,7 @@ In other words, a service container extension configures the services for a bundle on your behalf. And as you'll see in a moment, the extension provides a sensible, high-level interface for configuring the bundle. -Take the FrameworkBundle - the core Symfony2 framework bundle - as an +Take the FrameworkBundle - the core Symfony framework bundle - as an example. The presence of the following code in your application configuration invokes the service container extension inside the FrameworkBundle: @@ -471,8 +471,8 @@ When the configuration is parsed, the container looks for an extension that can handle the ``framework`` configuration directive. The extension in question, which lives in the FrameworkBundle, is invoked and the service configuration for the FrameworkBundle is loaded. If you remove the ``framework`` key -from your application configuration file entirely, the core Symfony2 services -won't be loaded. The point is that you're in control: the Symfony2 framework +from your application configuration file entirely, the core Symfony services +won't be loaded. The point is that you're in control: the Symfony framework doesn't contain any magic or perform any actions that you don't have control over. @@ -827,7 +827,7 @@ Injecting the dependency by the setter method just needs a change of syntax: .. note:: The approaches presented in this section are called "constructor injection" - and "setter injection". The Symfony2 service container also supports + and "setter injection". The Symfony service container also supports "property injection". .. _book-container-request-stack: @@ -1005,12 +1005,12 @@ allow for an optional dependency:: Core Symfony and Third-Party Bundle Services -------------------------------------------- -Since Symfony2 and all third-party bundles configure and retrieve their services +Since Symfony and all third-party bundles configure and retrieve their services via the container, you can easily access them or even use them in your own -services. To keep things simple, Symfony2 by default does not require that -controllers be defined as services. Furthermore Symfony2 injects the entire +services. To keep things simple, Symfony by default does not require that +controllers be defined as services. Furthermore, Symfony injects the entire service container into your controller. For example, to handle the storage of -information on a user's session, Symfony2 provides a ``session`` service, +information on a user's session, Symfony provides a ``session`` service, which you can access inside a standard controller as follows:: public function indexAction($bar) @@ -1021,13 +1021,13 @@ which you can access inside a standard controller as follows:: // ... } -In Symfony2, you'll constantly use services provided by the Symfony core or +In Symfony, you'll constantly use services provided by the Symfony core or other third-party bundles to perform tasks such as rendering templates (``templating``), sending emails (``mailer``), or accessing information on the request (``request``). You can take this a step further by using these services inside services that you've created for your application. Beginning by modifying the ``NewsletterManager`` -to use the real Symfony2 ``mailer`` service (instead of the pretend ``my_mailer``). +to use the real Symfony ``mailer`` service (instead of the pretend ``my_mailer``). Also pass the templating engine service to the ``NewsletterManager`` so that it can generate the email content via a template:: @@ -1153,7 +1153,7 @@ the bundle knows that the ``foo.twig.extension`` service should be registered as a Twig extension with Twig. In other words, Twig finds all services tagged with ``twig.extension`` and automatically registers them as extensions. -Tags, then, are a way to tell Symfony2 or other third-party bundles that +Tags, then, are a way to tell Symfony or other third-party bundles that your service should be registered or used in some special way by the bundle. For a list of all the tags available in the core Symfony Framework, check diff --git a/book/stable_api.rst b/book/stable_api.rst index 23f7d7b7741..56d0bcb7d4d 100644 --- a/book/stable_api.rst +++ b/book/stable_api.rst @@ -1,10 +1,12 @@ .. index:: single: Stable API -The Symfony2 Stable API -======================= +.. _the-symfony2-stable-api: -The Symfony2 stable API is a subset of all Symfony2 published public methods +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; diff --git a/book/templating.rst b/book/templating.rst index 656afbd30bc..4f5d80ebebf 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -5,7 +5,7 @@ Creating and Using Templates ============================ As you know, the :doc:`controller ` is responsible for -handling each request that comes into a Symfony2 application. In reality, +handling each request that comes into a Symfony application. In reality, the controller delegates most of the heavy work to other places so that code can be tested and reused. When a controller needs to generate HTML, CSS or any other content, it hands the work off to the templating engine. @@ -53,7 +53,7 @@ template - a text file parsed by PHP that contains a mix of text and PHP code: .. index:: Twig; Introduction -But Symfony2 packages an even more powerful templating language called `Twig`_. +But Symfony packages an even more powerful templating language called `Twig`_. Twig allows you to write concise, readable templates that are more friendly to web designers and, in several ways, more powerful than PHP templates: @@ -178,7 +178,7 @@ Template Inheritance and Layouts -------------------------------- More often than not, templates in a project share common elements, like the -header, footer, sidebar or more. In Symfony2, this problem is thought about +header, footer, sidebar or more. In Symfony, this problem is thought about differently: a template can be decorated by another one. This works exactly the same as PHP classes: template inheritance allows you to build a base "layout" template that contains all the common elements of your site @@ -332,7 +332,7 @@ tag in a parent template is always used by default. You can use as many levels of inheritance as you want. In the next section, a common three-level inheritance model will be explained along with how templates -are organized inside a Symfony2 project. +are organized inside a Symfony project. When working with template inheritance, here are some tips to keep in mind: @@ -389,7 +389,7 @@ By default, templates can live in two different locations: ``Resources/views`` directory (and subdirectories). The majority of templates will live inside a bundle. -Symfony2 uses a **bundle**:**controller**:**template** string syntax for +Symfony uses a **bundle**:**controller**:**template** string syntax for templates. This allows for several different types of templates, each which lives in a specific location: @@ -443,11 +443,11 @@ that specify the *format* and *engine* for that template. * **AcmeBlogBundle:Blog:index.css.twig** - CSS format, Twig engine -By default, any Symfony2 template can be written in either Twig or PHP, and +By default, any Symfony template can be written in either Twig or PHP, and the last part of the extension (e.g. ``.twig`` or ``.php``) specifies which of these two *engines* should be used. The first part of the extension, (e.g. ``.html``, ``.css``, etc) is the final format that the template will -generate. Unlike the engine, which determines how Symfony2 parses the template, +generate. Unlike the engine, which determines how Symfony parses the template, this is simply an organizational tactic used in case the same resource needs to be rendered as HTML (``index.html.twig``), XML (``index.xml.twig``), or any other format. For more information, read the :ref:`template-formats` @@ -471,7 +471,7 @@ this section, you'll learn about a large group of tools available to help perform the most common template tasks such as including other templates, linking to pages and including images. -Symfony2 comes bundled with several specialized Twig tags and functions that +Symfony comes bundled with several specialized Twig tags and functions that ease the work of the template designer. In PHP, the templating system provides an extensible *helper* system that provides useful features in a template context. @@ -676,7 +676,7 @@ Asynchronous Content with hinclude.js Controllers can be embedded asynchronously using the hinclude.js_ JavaScript library. As the embedded content comes from another page (or controller for that matter), -Symfony2 uses a version of the standard ``render`` function to configure ``hinclude`` +Symfony uses a version of the standard ``render`` function to configure ``hinclude`` tags: .. configuration-block:: @@ -984,7 +984,7 @@ Linking to Assets Templates also commonly refer to images, JavaScript, stylesheets and other assets. Of course you could hard-code the path to these assets (e.g. ``/images/logo.png``), -but Symfony2 provides a more dynamic option via the ``asset`` Twig function: +but Symfony provides a more dynamic option via the ``asset`` Twig function: .. configuration-block:: @@ -1098,7 +1098,7 @@ stylesheets. Global Template Variables ------------------------- -During each request, Symfony2 will set a global template variable ``app`` +During each request, Symfony will set a global template variable ``app`` in both Twig and PHP template engines by default. The ``app`` variable is a :class:`Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables` instance which will give you access to some application specific variables @@ -1140,7 +1140,7 @@ automatically: Configuring and Using the ``templating`` Service ------------------------------------------------ -The heart of the template system in Symfony2 is the templating ``Engine``. +The heart of the template system in Symfony is the templating ``Engine``. This special object is responsible for rendering templates and returning their content. When you render a template in a controller, for example, you're actually using the templating engine service. For example:: @@ -1159,7 +1159,7 @@ is equivalent to:: .. _template-configuration: The templating engine (or "service") is preconfigured to work automatically -inside Symfony2. It can, of course, be configured further in the application +inside Symfony. It can, of course, be configured further in the application configuration file: .. configuration-block:: @@ -1216,7 +1216,7 @@ Several configuration options are available and are covered in the Overriding Bundle Templates --------------------------- -The Symfony2 community prides itself on creating and maintaining high quality +The Symfony community prides itself on creating and maintaining high quality bundles (see `KnpBundles.com`_) for a large number of different features. Once you use a third-party bundle, you'll likely need to override and customize one or more of its templates. @@ -1238,7 +1238,7 @@ customize the markup specifically for your application. By digging into the ); } -When the ``AcmeBlogBundle:Blog:index.html.twig`` is rendered, Symfony2 actually +When the ``AcmeBlogBundle:Blog:index.html.twig`` is rendered, Symfony actually looks in two different locations for the template: #. ``app/Resources/AcmeBlogBundle/views/Blog/index.html.twig`` @@ -1256,7 +1256,7 @@ to create it). You're now free to customize the template. This logic also applies to base bundle templates. Suppose also that each template in ``AcmeBlogBundle`` inherits from a base template called -``AcmeBlogBundle::layout.html.twig``. Just as before, Symfony2 will look in +``AcmeBlogBundle::layout.html.twig``. Just as before, Symfony will look in the following two places for the template: #. ``app/Resources/AcmeBlogBundle/views/layout.html.twig`` @@ -1266,7 +1266,7 @@ Once again, to override the template, just copy it from the bundle to ``app/Resources/AcmeBlogBundle/views/layout.html.twig``. You're now free to customize this copy as you see fit. -If you take a step back, you'll see that Symfony2 always starts by looking in +If you take a step back, you'll see that Symfony always starts by looking in the ``app/Resources/{BUNDLE_NAME}/views/`` directory for a template. If the template doesn't exist there, it continues by checking inside the ``Resources/views`` directory of the bundle itself. This means that all bundle @@ -1286,7 +1286,7 @@ subdirectory. Overriding Core Templates ~~~~~~~~~~~~~~~~~~~~~~~~~ -Since the Symfony2 framework itself is just a bundle, core templates can be +Since the Symfony framework itself is just a bundle, core templates can be overridden in the same way. For example, the core TwigBundle contains a number of different "exception" and "error" templates that can be overridden by copying each from the ``Resources/views/Exception`` directory of the @@ -1568,7 +1568,7 @@ the most common tasks. Overall, the topic of templating should be thought of as a powerful tool that's at your disposal. In some cases, you may not need to render a template, -and in Symfony2, that's absolutely fine. +and in Symfony, that's absolutely fine. Learn more from the Cookbook ---------------------------- diff --git a/book/testing.rst b/book/testing.rst index a86230f710a..f870ac58272 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -11,13 +11,13 @@ using both functional and unit tests. The PHPUnit Testing Framework ----------------------------- -Symfony2 integrates with an independent library - called PHPUnit - to give +Symfony integrates with an independent library - called PHPUnit - to give you a rich testing framework. This chapter won't cover PHPUnit itself, but it has its own excellent `documentation`_. .. note:: - Symfony2 works with PHPUnit 3.5.11 or later, though version 3.6.4 is + Symfony works with PHPUnit 3.5.11 or later, though version 3.6.4 is needed to test the Symfony core code itself. Each test - whether it's a unit test or a functional test - is a PHP class @@ -47,7 +47,7 @@ Unit Tests A unit test is usually a test against a specific PHP class. If you want to test the overall behavior of your application, see the section about `Functional Tests`_. -Writing Symfony2 unit tests is no different than writing standard PHPUnit +Writing Symfony unit tests is no different than writing standard PHPUnit unit tests. Suppose, for example, that you have an *incredibly* simple class called ``Calculator`` in the ``Utility/`` directory of your bundle:: @@ -129,7 +129,7 @@ directory of your bundle. If you want to test the pages handled by your ``DemoController`` class, start by creating a new ``DemoControllerTest.php`` file that extends a special ``WebTestCase`` class. -For example, the Symfony2 Standard Edition provides a simple functional test +For example, the Symfony Standard Edition provides a simple functional test for its ``DemoController`` (`DemoControllerTest`_) that reads as follows:: // src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php @@ -320,7 +320,7 @@ Working with the Test Client ----------------------------- The Test Client simulates an HTTP client like a browser and makes requests -into your Symfony2 application:: +into your Symfony application:: $crawler = $client->request('GET', '/hello/Fabien'); diff --git a/book/translation.rst b/book/translation.rst index 5e8a3207a4c..0e0dc68852f 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -27,7 +27,7 @@ into the language of the user:: *country* code (e.g. ``fr_FR`` for French/France) is recommended. In this chapter, you'll learn how to use the Translation component in the -Symfony2 framework. You can read the +Symfony framework. You can read the :doc:`Translation component documentation ` to learn even more. Overall, the process has several steps: @@ -105,16 +105,16 @@ for example, that you're translating a simple message from inside a controller:: public function indexAction() { - $translated = $this->get('translator')->trans('Symfony2 is great'); + $translated = $this->get('translator')->trans('Symfony is great'); return new Response($translated); } .. _book-translation-resources: -When this code is executed, Symfony2 will attempt to translate the message -"Symfony2 is great" based on the ``locale`` of the user. For this to work, -you need to tell Symfony2 how to translate the message via a "translation +When this code is executed, Symfony will attempt to translate the message +"Symfony is great" based on the ``locale`` of the user. For this to work, +you need to tell Symfony how to translate the message via a "translation resource", which is usually a file that contains a collection of translations for a given locale. This "dictionary" of translations can be created in several different formats, XLIFF being the recommended format: @@ -129,8 +129,8 @@ different formats, XLIFF being the recommended format: - Symfony2 is great - J'aime Symfony2 + Symfony is great + J'aime Symfony @@ -139,26 +139,26 @@ different formats, XLIFF being the recommended format: .. code-block:: yaml # messages.fr.yml - Symfony2 is great: J'aime Symfony2 + Symfony is great: J'aime Symfony .. code-block:: php // messages.fr.php return array( - 'Symfony2 is great' => 'J\'aime Symfony2', + 'Symfony is great' => 'J\'aime Symfony', ); For information on where these files should be located, see :ref:`book-translation-resource-locations`. Now, if the language of the user's locale is French (e.g. ``fr_FR`` or ``fr_BE``), -the message will be translated into ``J'aime Symfony2``. You can also translate +the message will be translated into ``J'aime Symfony``. You can also translate the message inside your :ref:`templates `. The Translation Process ~~~~~~~~~~~~~~~~~~~~~~~ -To actually translate the message, Symfony2 uses a simple process: +To actually translate the message, Symfony uses a simple process: * The ``locale`` of the current user, which is stored on the request is determined; @@ -171,7 +171,7 @@ To actually translate the message, Symfony2 uses a simple process: * If the message is located in the catalog, the translation is returned. If not, the translator returns the original message. -When using the ``trans()`` method, Symfony2 looks for the exact string inside +When using the ``trans()`` method, Symfony looks for the exact string inside the appropriate message catalog and returns it (if it exists). Message Placeholders @@ -215,7 +215,7 @@ in the Translation component documentation. Translations in Templates ------------------------- -Most of the time, translation occurs in templates. Symfony2 provides native +Most of the time, translation occurs in templates. Symfony provides native support for both Twig and PHP templates. .. _book-translation-tags: @@ -223,7 +223,7 @@ support for both Twig and PHP templates. Twig Templates ~~~~~~~~~~~~~~ -Symfony2 provides specialized Twig tags (``trans`` and ``transchoice``) to +Symfony provides specialized Twig tags (``trans`` and ``transchoice``) to help with message translation of *static blocks of text*: .. code-block:: jinja @@ -315,7 +315,7 @@ The translator service is accessible in PHP templates through the .. code-block:: html+php - trans('Symfony2 is great') ?> + trans('Symfony is great') ?> transChoice( '{0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples', @@ -328,7 +328,7 @@ The translator service is accessible in PHP templates through the Translation Resource/File Names and Locations --------------------------------------------- -Symfony2 looks for message files (i.e. translations) in the following locations: +Symfony looks for message files (i.e. translations) in the following locations: * the ``app/Resources/translations`` directory; @@ -352,7 +352,7 @@ must be named according to the following path: ``domain.locale.loader``: * **locale**: The locale that the translations are for (e.g. ``en_GB``, ``en``, etc); -* **loader**: How Symfony2 should load and parse the file (e.g. ``xliff``, +* **loader**: How Symfony should load and parse the file (e.g. ``xliff``, ``php``, ``yml``, etc). The loader can be the name of any registered loader. By default, Symfony @@ -388,7 +388,7 @@ Fallback Translation Locales ---------------------------- Imagine that the user's locale is ``fr_FR`` and that you're translating the -key ``Symfony2 is great``. To find the French translation, Symfony actually +key ``Symfony is great``. To find the French translation, Symfony actually checks translation resources for several different locales: 1. First, Symfony looks for the translation in a ``fr_FR`` translation resource @@ -661,7 +661,7 @@ For more information, see the documentation for these libraries. Summary ------- -With the Symfony2 Translation component, creating an internationalized application +With the Symfony Translation component, creating an internationalized application no longer needs to be a painful process and boils down to just a few basic steps: @@ -671,7 +671,7 @@ steps: (learn about this in :doc:`/components/translation/usage`); * Translate each message into multiple locales by creating translation message - files. Symfony2 discovers and processes each file because its name follows + files. Symfony discovers and processes each file because its name follows a specific convention; * Manage the user's locale, which is stored on the request, but can also diff --git a/book/validation.rst b/book/validation.rst index 2f961f8b161..3e0bfa7855f 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -8,7 +8,7 @@ Validation is a very common task in web applications. Data entered in forms needs to be validated. Data also needs to be validated before it is written into a database or passed to a web service. -Symfony2 ships with a `Validator`_ component that makes this task easy and +Symfony ships with a `Validator`_ component that makes this task easy and transparent. This component is based on the `JSR303 Bean Validation specification`_. @@ -253,7 +253,7 @@ For more information, see the :doc:`Forms ` chapter. Configuration ------------- -The Symfony2 validator is enabled by default, but you must explicitly enable +The Symfony validator is enabled by default, but you must explicitly enable annotations if you're using the annotation method to specify your constraints: .. configuration-block:: @@ -302,14 +302,14 @@ to its class and then pass it to the ``validator`` service. Behind the scenes, a constraint is simply a PHP object that makes an assertive statement. In real life, a constraint could be: "The cake must not be burned". -In Symfony2, constraints are similar: they are assertions that a condition +In Symfony, constraints are similar: they are assertions that a condition is true. Given a value, a constraint will tell you whether or not that value adheres to the rules of the constraint. Supported Constraints ~~~~~~~~~~~~~~~~~~~~~ -Symfony2 packages a large number of the most commonly-needed constraints: +Symfony packages a large number of the most commonly-needed constraints: .. include:: /reference/constraints/map.rst.inc @@ -502,7 +502,7 @@ to use, but the second allows you to specify more complex validation rules. Properties ~~~~~~~~~~ -Validating class properties is the most basic validation technique. Symfony2 +Validating class properties is the most basic validation technique. Symfony allows you to validate private, protected or public properties. The next listing shows you how to configure the ``$firstName`` property of an ``Author`` class to have at least 3 characters. @@ -581,7 +581,7 @@ class to have at least 3 characters. Getters ~~~~~~~ -Constraints can also be applied to the return value of a method. Symfony2 +Constraints can also be applied to the return value of a method. Symfony allows you to add a constraint to any public method whose name starts with "get" or "is". In this guide, both of these types of methods are referred to as "getters". @@ -1217,7 +1217,7 @@ which holds the error message on its ``getMessage`` method. Final Thoughts -------------- -The Symfony2 ``validator`` is a powerful tool that can be leveraged to +The Symfony ``validator`` is a powerful tool that can be leveraged to guarantee that the data of any object is "valid". The power behind validation lies in "constraints", which are rules that you can apply to properties or getter methods of your object. And while you'll most commonly use the validation diff --git a/components/class_loader/class_loader.rst b/components/class_loader/class_loader.rst index 198f25d168a..246ee38a68a 100644 --- a/components/class_loader/class_loader.rst +++ b/components/class_loader/class_loader.rst @@ -36,7 +36,7 @@ is straightforward:: .. note:: - The autoloader is automatically registered in a Symfony2 application (see + The autoloader is automatically registered in a Symfony application (see ``app/autoload.php``). Use the :method:`Symfony\\Component\\ClassLoader\\ClassLoader::addPrefix` or diff --git a/components/class_loader/introduction.rst b/components/class_loader/introduction.rst index 2eff7ee69e8..ab8f1566a6e 100644 --- a/components/class_loader/introduction.rst +++ b/components/class_loader/introduction.rst @@ -12,7 +12,7 @@ Usage Whenever you reference a class that has not been required or included yet, PHP uses the `autoloading mechanism`_ to delegate the loading of a file defining -the class. Symfony2 provides two autoloaders, which are able to load your classes: +the class. Symfony provides two autoloaders, which are able to load your classes: * :doc:`/components/class_loader/class_loader`: loads classes that follow the `PSR-0` class naming standard; diff --git a/components/console/helpers/dialoghelper.rst b/components/console/helpers/dialoghelper.rst index 9b2d0363839..09b3e215033 100644 --- a/components/console/helpers/dialoghelper.rst +++ b/components/console/helpers/dialoghelper.rst @@ -102,7 +102,7 @@ Validating the Answer --------------------- You can even validate the answer. For instance, in the last example you asked -for the bundle name. Following the Symfony2 naming conventions, it should +for the bundle name. Following the Symfony naming conventions, it should be suffixed with ``Bundle``. You can validate that by using the :method:`Symfony\\Component\\Console\\Helper\\DialogHelper::askAndValidate` method:: @@ -160,7 +160,7 @@ You can also ask and validate a hidden response:: if ('' === trim($value)) { throw new \Exception('The password can not be empty'); } - + return $value; }; diff --git a/components/console/introduction.rst b/components/console/introduction.rst index 20ebbf9371c..6182690864d 100644 --- a/components/console/introduction.rst +++ b/components/console/introduction.rst @@ -413,7 +413,7 @@ tools capable of helping you with different tasks: Testing Commands ---------------- -Symfony2 provides several tools to help you test your commands. The most +Symfony provides several tools to help you test your commands. The most useful one is the :class:`Symfony\\Component\\Console\\Tester\\CommandTester` class. It uses special input and output classes to ease testing without a real console:: diff --git a/components/dependency_injection/compilation.rst b/components/dependency_injection/compilation.rst index 84b4afe9b95..f3c074106cf 100644 --- a/components/dependency_injection/compilation.rst +++ b/components/dependency_injection/compilation.rst @@ -207,7 +207,7 @@ The XML version of the config would then look like this: .. note:: - In the Symfony2 full stack framework there is a base Extension class which + In the Symfony full stack framework there is a base Extension class which implements these methods as well as a shortcut method for processing the configuration. See :doc:`/cookbook/bundles/extension` for more details. @@ -302,7 +302,7 @@ method is called by implementing :class:`Symfony\\Component\\DependencyInjection } For more details, see :doc:`/cookbook/bundles/prepend_extension`, which is -specific to the Symfony2 Framework, but contains more details about this feature. +specific to the Symfony Framework, but contains more details about this feature. Creating a Compiler Pass ------------------------ diff --git a/components/dependency_injection/factories.rst b/components/dependency_injection/factories.rst index 0682a00e624..9f74efa50d5 100644 --- a/components/dependency_injection/factories.rst +++ b/components/dependency_injection/factories.rst @@ -4,7 +4,7 @@ Using a Factory to Create Services ================================== -Symfony2's Service Container provides a powerful way of controlling the +Symfony's Service Container provides a powerful way of controlling the creation of objects, allowing you to specify arguments passed to the constructor as well as calling methods and setting parameters. Sometimes, however, this will not provide you with everything you need to construct your objects. diff --git a/components/dependency_injection/introduction.rst b/components/dependency_injection/introduction.rst index 50d5d2d19c5..e58e6409726 100644 --- a/components/dependency_injection/introduction.rst +++ b/components/dependency_injection/introduction.rst @@ -209,7 +209,7 @@ Loading a YAML config file:: .. note:: If you want to load YAML config files then you will also need to install - :doc:`The YAML component `. + :doc:`the Yaml component `. If you *do* want to use PHP to create the services then you can move this into a separate config file and load it in a similar way:: diff --git a/components/dependency_injection/parentservices.rst b/components/dependency_injection/parentservices.rst index d8d53cffdbd..3158738fa15 100644 --- a/components/dependency_injection/parentservices.rst +++ b/components/dependency_injection/parentservices.rst @@ -190,7 +190,7 @@ and:: // ... } -In a similar fashion, the Symfony2 service container also supports extending +In a similar fashion, the Symfony service container also supports extending services in the configuration so you can also reduce the repetition by specifying a parent for a service. diff --git a/components/dependency_injection/workflow.rst b/components/dependency_injection/workflow.rst index 2373ec5f4dc..f769fefd1a1 100644 --- a/components/dependency_injection/workflow.rst +++ b/components/dependency_injection/workflow.rst @@ -8,7 +8,7 @@ In the preceding pages of this section, there has been little to say about where the various files and classes should be located. This is because this depends on the application, library or framework in which you want to use the container. Looking at how the container is configured and built in the -Symfony2 full stack framework will help you see how this all fits together, +Symfony full stack framework will help you see how this all fits together, whether you are using the full stack framework or looking to use the service container in another application. diff --git a/components/event_dispatcher/introduction.rst b/components/event_dispatcher/introduction.rst index 61de74a97b4..23a74e338ab 100644 --- a/components/event_dispatcher/introduction.rst +++ b/components/event_dispatcher/introduction.rst @@ -24,20 +24,20 @@ or after a method is executed, without interfering with other plugins. This is not an easy problem to solve with single inheritance, and multiple inheritance (were it possible with PHP) has its own drawbacks. -The Symfony2 EventDispatcher component implements the `Mediator`_ pattern in +The Symfony EventDispatcher component implements the `Mediator`_ pattern in a simple and effective way to make all these things possible and to make your projects truly extensible. Take a simple example from :doc:`/components/http_kernel/introduction`. Once a ``Response`` object has been created, it may be useful to allow other elements in the system to modify it (e.g. add some cache headers) before it's actually -used. To make this possible, the Symfony2 kernel throws an event - +used. To make this possible, the Symfony kernel throws an event - ``kernel.response``. Here's how it works: * A *listener* (PHP object) tells a central *dispatcher* object that it wants to listen to the ``kernel.response`` event; -* At some point, the Symfony2 kernel tells the *dispatcher* object to dispatch +* At some point, the Symfony kernel tells the *dispatcher* object to dispatch the ``kernel.response`` event, passing with it an ``Event`` object that has access to the ``Response`` object; diff --git a/components/form/introduction.rst b/components/form/introduction.rst index f65556defc9..21f2d669eb3 100644 --- a/components/form/introduction.rst +++ b/components/form/introduction.rst @@ -30,7 +30,7 @@ Configuration If you are working with the full-stack Symfony framework, the Form component is already configured for you. In this case, skip to :ref:`component-form-intro-create-simple-form`. -In Symfony2, forms are represented by objects and these objects are built +In Symfony, forms are represented by objects and these objects are built by using a *form factory*. Building a form factory is simple:: use Symfony\Component\Form\Forms; @@ -50,7 +50,7 @@ support for very important features: * **Validation:** Integration with a validation library to generate error messages for submitted data. -The Symfony2 Form component relies on other libraries to solve these problems. +The Symfony Form component relies on other libraries to solve these problems. Most of the time you will use Twig and the Symfony :doc:`HttpFoundation `, Translation and Validator components, but you can replace any of these with @@ -154,7 +154,7 @@ errors, and labels). If you use `Twig`_ as your template engine, the Form component offers a rich integration. To use the integration, you'll need the ``TwigBridge``, which provides integration -between Twig and several Symfony2 components. If you're using Composer, you +between Twig and several Symfony components. If you're using Composer, you could install the latest 2.3 version by adding the following ``require`` line to your ``composer.json`` file: @@ -369,7 +369,7 @@ Creating a simple Form .. tip:: - If you're using the Symfony2 framework, then the form factory is available + If you're using the Symfony framework, then the form factory is available automatically as a service called ``form.factory``. Also, the default base controller class has a :method:`Symfony\\Bundle\\FrameworkBundle\\Controller::createFormBuilder` method, which is a shortcut to fetch the form factory and call ``createBuilder`` diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index b6235f8761c..2c42b9931ea 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -13,7 +13,7 @@ In PHP, the request is represented by some global variables (``$_GET``, ``$_POST``, ``$_FILES``, ``$_COOKIE``, ``$_SESSION``, ...) and the response is generated by some functions (``echo``, ``header``, ``setcookie``, ...). -The Symfony2 HttpFoundation component replaces these default PHP global +The Symfony HttpFoundation component replaces these default PHP global variables and functions by an object-oriented layer. Installation @@ -173,8 +173,8 @@ in the request, which is also an instance of :class:`Symfony\\Component\\HttpFoundation\\ParameterBag`. This is mostly used to attach information that belongs to the Request and that needs to be accessed from many different points in your application. For information -on how this is used in the Symfony2 framework, see -:ref:`the Symfony2 book `. +on how this is used in the Symfony framework, see +:ref:`the Symfony book `. Finally, the raw data sent with the request body can be accessed using :method:`Symfony\\Component\\HttpFoundation\\Request::getContent`:: diff --git a/components/http_foundation/session_configuration.rst b/components/http_foundation/session_configuration.rst index f54aecc8487..07413e7f162 100644 --- a/components/http_foundation/session_configuration.rst +++ b/components/http_foundation/session_configuration.rst @@ -32,10 +32,10 @@ the docblock of the ``setOptions()`` method of each class. For instance, the one provided by the Memcached extension can be found on `php.net/memcached.setoption`_ While native save handlers can be activated by directly using -``ini_set('session.save_handler', $name);``, Symfony2 provides a convenient way to +``ini_set('session.save_handler', $name);``, Symfony provides a convenient way to activate these in the same way as it does for custom handlers. -Symfony2 provides drivers for the following native save handler as an example: +Symfony provides drivers for the following native save handler as an example: * :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeFileSessionHandler` @@ -58,7 +58,7 @@ Example usage:: Native save handlers provide a quick solution to session storage, however, in complex systems where you need more control, custom save handlers may - provide more freedom and flexibility. Symfony2 provides several implementations + provide more freedom and flexibility. Symfony provides several implementations which you may further customize as required. Custom Save Handlers @@ -68,8 +68,8 @@ Custom handlers are those which completely replace PHP's built-in session save handlers by providing six callback functions which PHP calls internally at various points in the session workflow. -Symfony2 HttpFoundation provides some by default and these can easily serve as -examples if you wish to write your own. +The Symfony HttpFoundation component provides some by default and these can +easily serve as examples if you wish to write your own. * :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\PdoSessionHandler` * :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\MemcacheSessionHandler` @@ -148,7 +148,7 @@ method. Session Lifetime ~~~~~~~~~~~~~~~~ -When a new session is created, meaning Symfony2 issues a new session cookie +When a new session is created, meaning Symfony issues a new session cookie to the client, the cookie will be stamped with an expiry time. This is calculated by adding the PHP runtime configuration value in ``session.cookie_lifetime`` with the current server time. @@ -186,7 +186,7 @@ session is started. The session can be destroyed as required. This method of processing can allow the expiry of sessions to be integrated into the user experience, for example, by displaying a message. -Symfony2 records some basic metadata about each session to give you complete +Symfony records some basic metadata about each session to give you complete freedom in this area. Session Metadata @@ -229,7 +229,7 @@ libraries. :phpclass:`SessionHandler` is a special PHP internal class which exposes native save handlers to PHP user-space. -In order to provide a solution for those using PHP 5.4, Symfony2 has a special +In order to provide a solution for those using PHP 5.4, Symfony has a special class called :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeSessionHandler` which under PHP 5.4, extends from ``\SessionHandler`` and under PHP 5.3 is just a empty base class. This provides some interesting opportunities to leverage diff --git a/components/http_foundation/session_testing.rst b/components/http_foundation/session_testing.rst index a35b23caebe..1bc80b03fbb 100644 --- a/components/http_foundation/session_testing.rst +++ b/components/http_foundation/session_testing.rst @@ -5,7 +5,7 @@ Testing with Sessions ===================== -Symfony2 is designed from the ground up with code-testability in mind. In order +Symfony is designed from the ground up with code-testability in mind. In order to make your code which utilizes session easily testable we provide two separate mock storage mechanisms for both unit testing and functional testing. diff --git a/components/http_foundation/sessions.rst b/components/http_foundation/sessions.rst index f2c40873af7..27296fc7529 100644 --- a/components/http_foundation/sessions.rst +++ b/components/http_foundation/sessions.rst @@ -5,7 +5,7 @@ Session Management ================== -The Symfony2 HttpFoundation component has a very powerful and flexible session +The Symfony HttpFoundation component has a very powerful and flexible session subsystem which is designed to provide session management through a simple object-oriented interface using a variety of session storage drivers. @@ -138,16 +138,16 @@ Session Data Management PHP's session management requires the use of the ``$_SESSION`` super-global, however, this interferes somewhat with code testability and encapsulation in an -OOP paradigm. To help overcome this, Symfony2 uses *session bags* linked to the +OOP paradigm. To help overcome this, Symfony uses *session bags* linked to the session to encapsulate a specific dataset of attributes or flash messages. This approach also mitigates namespace pollution within the ``$_SESSION`` super-global because each bag stores all its data under a unique namespace. -This allows Symfony2 to peacefully co-exist with other applications or libraries +This allows Symfony to peacefully co-exist with other applications or libraries that might use the ``$_SESSION`` super-global and all data remains completely -compatible with Symfony2's session management. +compatible with Symfony's session management. -Symfony2 provides two kinds of storage bags, with two separate implementations. +Symfony provides two kinds of storage bags, with two separate implementations. Everything is written against interfaces so you may extend or create your own bag types if necessary. @@ -159,7 +159,7 @@ the following API which is intended mainly for internal purposes: Generally this value can be left at its default and is for internal use. * :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::initialize`: - This is called internally by Symfony2 session storage classes to link bag data + This is called internally by Symfony session storage classes to link bag data to the session. * :method:`Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface::getName`: diff --git a/components/http_foundation/trusting_proxies.rst b/components/http_foundation/trusting_proxies.rst index 61d4448914f..dc126617e5e 100644 --- a/components/http_foundation/trusting_proxies.rst +++ b/components/http_foundation/trusting_proxies.rst @@ -15,7 +15,7 @@ headers. For example, the ``Host`` HTTP header is usually used to return the requested host. But when you're behind a proxy, the true host may be stored in a ``X-Forwarded-Host`` header. -Since HTTP headers can be spoofed, Symfony2 does *not* trust these proxy +Since HTTP headers can be spoofed, Symfony does *not* trust these proxy headers by default. If you are behind a proxy, you should manually whitelist your proxy. diff --git a/components/http_kernel/introduction.rst b/components/http_kernel/introduction.rst index 3598eec9a8f..f011ef68633 100644 --- a/components/http_kernel/introduction.rst +++ b/components/http_kernel/introduction.rst @@ -118,7 +118,7 @@ For general information on adding listeners to the events below, see .. tip:: Fabien Potencier also wrote a wonderful series on using the HttpKernel - component and other Symfony2 components to create your own framework. See + component and other Symfony components to create your own framework. See `Create your own framework... on top of the Symfony2 Components`_. .. _component-http-kernel-kernel-request: @@ -226,7 +226,7 @@ on the request's information. The second method, :method:`Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface::getArguments`, will be called after another event - ``kernel.controller`` - is dispatched. -.. sidebar:: Resolving the Controller in the Symfony2 Framework +.. sidebar:: Resolving the Controller in the Symfony Framework The Symfony Framework uses the built-in :class:`Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver` @@ -243,10 +243,10 @@ will be called after another event - ``kernel.controller`` - is dispatched. a) The ``AcmeDemoBundle:Default:index`` format of the ``_controller`` key is changed to another string that contains the full class and method - name of the controller by following the convention used in Symfony2 - e.g. + name of the controller by following the convention used in Symfony - e.g. ``Acme\DemoBundle\Controller\DefaultController::indexAction``. This transformation is specific to the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver` - sub-class used by the Symfony2 Framework. + sub-class used by the Symfony Framework. b) A new instance of your controller class is instantiated with no constructor arguments. @@ -254,7 +254,7 @@ will be called after another event - ``kernel.controller`` - is dispatched. c) If the controller implements :class:`Symfony\\Component\\DependencyInjection\\ContainerAwareInterface`, ``setContainer`` is called on the controller object and the container is passed to it. This step is also specific to the :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver` - sub-class used by the Symfony2 Framework. + sub-class used by the Symfony Framework. There are also a few other variations on the above process (e.g. if you're registering your controllers as services). @@ -273,7 +273,7 @@ After the controller callable has been determined, ``HttpKernel::handle`` dispatches the ``kernel.controller`` event. Listeners to this event might initialize some part of the system that needs to be initialized after certain things have been determined (e.g. the controller, routing information) but before -the controller is executed. For some examples, see the Symfony2 section below. +the controller is executed. For some examples, see the Symfony section below. .. image:: /images/components/http_kernel/06-kernel-controller.png :align: center @@ -316,7 +316,7 @@ is a good example. At this point the kernel has a PHP callable (the controller) and an array of arguments that should be passed when executing that callable. -.. sidebar:: Getting the Controller Arguments in the Symfony2 Framework +.. sidebar:: Getting the Controller Arguments in the Symfony Framework Now that you know exactly what the controller callable (usually a method inside a controller object) is, the ``ControllerResolver`` uses `reflection`_ @@ -479,7 +479,7 @@ as possible to the client (e.g. sending emails). .. sidebar:: ``kernel.terminate`` in the Symfony Framework - If you use the SwiftmailerBundle with Symfony2 and use ``memory`` + If you use the SwiftmailerBundle with Symfony and use ``memory`` spooling, then the :class:`Symfony\\Bundle\\SwiftmailerBundle\\EventListener\\EmailSenderListener` is activated, which actually delivers any emails that you scheduled to send during the request. diff --git a/components/intl.rst b/components/intl.rst index 9560d6e4790..bed02fc2b55 100644 --- a/components/intl.rst +++ b/components/intl.rst @@ -64,7 +64,7 @@ code:: The intl extension internally uses the `ICU library`_ to obtain localization data such as number formats in different languages, country names and more. - To make this data accessible to userland PHP libraries, Symfony2 ships a copy + To make this data accessible to userland PHP libraries, Symfony ships a copy in the `Icu component`_. Depending on the ICU version compiled with your intl extension, a matching diff --git a/components/templating/introduction.rst b/components/templating/introduction.rst index 1e5b0999b4c..0f4ec567a5b 100644 --- a/components/templating/introduction.rst +++ b/components/templating/introduction.rst @@ -83,7 +83,7 @@ Global Variables ---------------- Sometimes, you need to set a variable which is available in all templates -rendered by an engine (like the ``$app`` variable when using the Symfony2 +rendered by an engine (like the ``$app`` variable when using the Symfony framework). These variables can be set by using the :method:`Symfony\\Component\\Templating\\PhpEngine::addGlobal` method and they can be accessed in the template as normal variables:: diff --git a/components/translation/introduction.rst b/components/translation/introduction.rst index a0deba774b8..60cf79e5785 100644 --- a/components/translation/introduction.rst +++ b/components/translation/introduction.rst @@ -200,9 +200,9 @@ loaded like this:: When translating strings that are not in the default domain (``messages``), you must specify the domain as the third argument of ``trans()``:: - $translator->trans('Symfony2 is great', array(), 'admin'); + $translator->trans('Symfony is great', array(), 'admin'); -Symfony2 will now look for the message in the ``admin`` domain of the +Symfony will now look for the message in the ``admin`` domain of the specified locale. Usage diff --git a/components/translation/usage.rst b/components/translation/usage.rst index 6b57f74ff2c..68a85e44681 100644 --- a/components/translation/usage.rst +++ b/components/translation/usage.rst @@ -4,7 +4,7 @@ Using the Translator ==================== -Imagine you want to translate the string *"Symfony2 is great"* into French:: +Imagine you want to translate the string *"Symfony is great"* into French:: use Symfony\Component\Translation\Translator; use Symfony\Component\Translation\Loader\ArrayLoader; @@ -12,12 +12,12 @@ Imagine you want to translate the string *"Symfony2 is great"* into French:: $translator = new Translator('fr_FR'); $translator->addLoader('array', new ArrayLoader()); $translator->addResource('array', array( - 'Symfony2 is great!' => 'J\'aime Symfony2!', + 'Symfony is great!' => 'J\'aime Symfony!', ), 'fr_FR'); - echo $translator->trans('Symfony2 is great!'); + echo $translator->trans('Symfony is great!'); -In this example, the message *"Symfony2 is great!"* will be translated into +In this example, the message *"Symfony is great!"* will be translated into the locale set in the constructor (``fr_FR``) if the message exists in one of the message catalogs. @@ -47,7 +47,7 @@ variable with a "placeholder":: echo $translated; -Symfony2 will now look for a translation of the raw message (``Hello %name%``) +Symfony will now look for a translation of the raw message (``Hello %name%``) and *then* replace the placeholders with their values. Creating a translation is done just as before: @@ -102,7 +102,7 @@ The act of creating translation files is an important part of "localization" id-translation pairs for the given domain and locale. The source is the identifier for the individual translation, and can be the message in the main locale (e.g. *"Symfony is great"*) of your application or a unique identifier (e.g. -``symfony2.great`` - see the sidebar below). +``symfony.great`` - see the sidebar below). Translation files can be created in several different formats, XLIFF being the recommended format. These files are parsed by one of the loader classes. @@ -116,12 +116,12 @@ recommended format. These files are parsed by one of the loader classes. - Symfony2 is great - J'aime Symfony2 + Symfony is great + J'aime Symfony - symfony2.great - J'aime Symfony2 + symfony.great + J'aime Symfony @@ -129,14 +129,14 @@ recommended format. These files are parsed by one of the loader classes. .. code-block:: yaml - Symfony2 is great: J'aime Symfony2 - symfony2.great: J'aime Symfony2 + Symfony is great: J'aime Symfony + symfony.great: J'aime Symfony .. code-block:: php return array( - 'Symfony2 is great' => 'J\'aime Symfony2', - 'symfony2.great' => 'J\'aime Symfony2', + 'Symfony is great' => 'J\'aime Symfony', + 'symfony.great' => 'J\'aime Symfony', ); .. sidebar:: Using Real or Keyword Messages @@ -144,9 +144,9 @@ recommended format. These files are parsed by one of the loader classes. This example illustrates the two different philosophies when creating messages to be translated:: - $translator->trans('Symfony2 is great'); + $translator->trans('Symfony is great'); - $translator->trans('symfony2.great'); + $translator->trans('symfony.great'); In the first method, messages are written in the language of the default locale (English in this case). That message is then used as the "id" @@ -155,11 +155,11 @@ recommended format. These files are parsed by one of the loader classes. In the second method, messages are actually "keywords" that convey the idea of the message. The keyword message is then used as the "id" for any translations. In this case, translations must be made for the default - locale (i.e. to translate ``symfony2.great`` to ``Symfony2 is great``). + locale (i.e. to translate ``symfony.great`` to ``Symfony is great``). The second method is handy because the message key won't need to be changed in every translation file if you decide that the message should actually - read "Symfony2 is really great" in the default locale. + read "Symfony is really great" in the default locale. The choice of which method to use is entirely up to you, but the "keyword" format is often recommended. @@ -172,25 +172,25 @@ recommended format. These files are parsed by one of the loader classes. .. code-block:: yaml - symfony2: + symfony: is: - great: Symfony2 is great - amazing: Symfony2 is amazing + great: Symfony is great + amazing: Symfony is amazing has: - bundles: Symfony2 has bundles + bundles: Symfony has bundles user: login: Login .. code-block:: php array( - 'symfony2' => array( + 'symfony' => array( 'is' => array( - 'great' => 'Symfony2 is great', - 'amazing' => 'Symfony2 is amazing', + 'great' => 'Symfony is great', + 'amazing' => 'Symfony is amazing', ), 'has' => array( - 'bundles' => 'Symfony2 has bundles', + 'bundles' => 'Symfony has bundles', ), ), 'user' => array( @@ -206,17 +206,17 @@ recommended format. These files are parsed by one of the loader classes. .. code-block:: yaml - symfony2.is.great: Symfony2 is great - symfony2.is.amazing: Symfony2 is amazing - symfony2.has.bundles: Symfony2 has bundles + symfony.is.great: Symfony is great + symfony.is.amazing: Symfony is amazing + symfony.has.bundles: Symfony has bundles user.login: Login .. code-block:: php return array( - 'symfony2.is.great' => 'Symfony2 is great', - 'symfony2.is.amazing' => 'Symfony2 is amazing', - 'symfony2.has.bundles' => 'Symfony2 has bundles', + 'symfony.is.great' => 'Symfony is great', + 'symfony.is.amazing' => 'Symfony is amazing', + 'symfony.has.bundles' => 'Symfony has bundles', 'user.login' => 'Login', ); @@ -355,7 +355,7 @@ When translating a message, the Translator uses the specified locale or the use for translation:: $translator->trans( - 'Symfony2 is great', + 'Symfony is great', array(), 'messages', 'fr_FR' diff --git a/components/using_components.rst b/components/using_components.rst index ae0aa6a4716..6c9c13c003c 100644 --- a/components/using_components.rst +++ b/components/using_components.rst @@ -2,8 +2,10 @@ single: Components; Installation single: Components; Usage -How to Install and Use the Symfony2 Components -============================================== +.. _how-to-install-and-use-the-symfony2-components: + +How to Install and Use the Symfony Components +============================================= If you're starting a new project (or already have a project) that will use one or more components, the easiest way to integrate everything is with `Composer`_. @@ -62,7 +64,7 @@ immediately:: .. tip:: - If you want to use all of the Symfony2 Components, then instead of adding + If you want to use all of the Symfony Components, then instead of adding them one by one: .. code-block:: json diff --git a/components/yaml/introduction.rst b/components/yaml/introduction.rst index bfc0c7f102e..e2733083a9b 100644 --- a/components/yaml/introduction.rst +++ b/components/yaml/introduction.rst @@ -2,15 +2,15 @@ single: Yaml single: Components; Yaml -The YAML Component +The Yaml Component ================== - The YAML Component loads and dumps YAML files. + The Yaml component loads and dumps YAML files. What is It? ----------- -The Symfony2 YAML Component parses YAML strings to convert them to PHP arrays. +The Symfony Yaml component parses YAML strings to convert them to PHP arrays. It is also able to convert PHP arrays to YAML strings. `YAML`_, *YAML Ain't Markup Language*, is a human friendly data serialization @@ -18,8 +18,8 @@ standard for all programming languages. YAML is a great format for your configuration files. YAML files are as expressive as XML files and as readable as INI files. -The Symfony2 YAML Component implements the YAML 1.2 version of the -specification. +The Symfony Yaml Component implements a selected subset of features defined in +the `YAML 1.2 version specification`_. .. tip:: @@ -40,8 +40,10 @@ Why? Fast ~~~~ -One of the goal of Symfony YAML is to find the right balance between speed and -features. It supports just the needed feature to handle configuration files. +One of the goals of Symfony Yaml is to find the right balance between speed and +features. It supports just the needed features to handle configuration files. +Notable lacking features are: document directives, multi-line quoted messages, +compact block collections and multi-document files. Real Parser ~~~~~~~~~~~ @@ -75,10 +77,12 @@ Full Merge Key Support Full support for references, aliases, and full merge key. Don't repeat yourself by referencing common configuration bits. -Using the Symfony2 YAML Component ---------------------------------- +.. _using-the-symfony2-yaml-component: -The Symfony2 YAML Component is very simple and consists of two main classes: +Using the Symfony YAML Component +-------------------------------- + +The Symfony2 Yaml component is very simple and consists of two main classes: one parses YAML strings (:class:`Symfony\\Component\\Yaml\\Parser`), and the other dumps a PHP array to a YAML string (:class:`Symfony\\Component\\Yaml\\Dumper`). @@ -163,7 +167,7 @@ array to its YAML representation: .. note:: - Of course, the Symfony2 YAML dumper is not able to dump resources. Also, + Of course, the Symfony Yaml dumper is not able to dump resources. Also, even if the dumper is able to dump PHP objects, it is considered to be a not supported feature. @@ -213,3 +217,4 @@ representation to the inline one: .. _YAML: http://yaml.org/ .. _Packagist: https://packagist.org/packages/symfony/yaml +.. _`YAML 1.2 version specification`: http://yaml.org/spec/1.2/spec.html diff --git a/conf.py b/conf.py index aa0723b6458..b8ffe20fc86 100644 --- a/conf.py +++ b/conf.py @@ -47,7 +47,7 @@ master_doc = 'index' # General information about the project. -project = 'Symfony2 Framework Documentation' +project = 'Symfony Framework Documentation' copyright = '' # The version info for the project you're documenting, acts as replacement for diff --git a/contributing/code/bugs.rst b/contributing/code/bugs.rst index ddb786f17d9..58d1396e54a 100644 --- a/contributing/code/bugs.rst +++ b/contributing/code/bugs.rst @@ -1,8 +1,8 @@ Reporting a Bug =============== -Whenever you find a bug in Symfony2, we kindly ask you to report it. It helps -us make a better Symfony2. +Whenever you find a bug in Symfony, we kindly ask you to report it. It helps +us make a better Symfony. .. caution:: diff --git a/contributing/code/conventions.rst b/contributing/code/conventions.rst index 35d850bb627..67962aebc00 100644 --- a/contributing/code/conventions.rst +++ b/contributing/code/conventions.rst @@ -1,7 +1,7 @@ Conventions =========== -The :doc:`standards` document describes the coding standards for the Symfony2 +The :doc:`standards` document describes the coding standards for the Symfony projects and the internal and third-party bundles. This document describes coding standards and conventions used in the core framework to make it more consistent and predictable. You are encouraged to follow them in your own diff --git a/contributing/code/license.rst b/contributing/code/license.rst index df1c9f3289c..aff6b6666d4 100644 --- a/contributing/code/license.rst +++ b/contributing/code/license.rst @@ -1,7 +1,9 @@ -Symfony2 License -================ +.. _symfony2-license: -Symfony2 is released under the MIT license. +Symfony License +=============== + +Symfony is released under the MIT license. According to `Wikipedia`_: diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index d546a690e86..62a2d051b30 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -2,7 +2,7 @@ Submitting a Patch ================== Patches are the best way to provide a bug fix or to propose enhancements to -Symfony2. +Symfony. Step 1: Setup your Environment ------------------------------ @@ -10,7 +10,7 @@ Step 1: Setup your Environment Install the Software Stack ~~~~~~~~~~~~~~~~~~~~~~~~~~ -Before working on Symfony2, setup a friendly environment with the following +Before working on Symfony, setup a friendly environment with the following software: * Git; @@ -65,11 +65,11 @@ Set up your user information with your real name and a working email address: Get the Symfony Source Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Get the Symfony2 source code: +Get the Symfony source code: * Create a `GitHub`_ account and sign in; -* Fork the `Symfony2 repository`_ (click on the "Fork" button); +* Fork the `Symfony repository`_ (click on the "Fork" button); * After the "forking action" has completed, clone your fork locally (this will create a ``symfony`` directory): @@ -88,7 +88,7 @@ Get the Symfony2 source code: Check that the current Tests Pass ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Now that Symfony2 is installed, check that all unit tests pass for your +Now that Symfony is installed, check that all unit tests pass for your environment as explained in the dedicated :doc:`document `. Step 2: Work on your Patch @@ -266,7 +266,7 @@ pull request message, like in: The pull request description must include the following checklist at the top to ensure that contributions may be reviewed without needless feedback -loops and that your contributions can be included into Symfony2 as quickly as +loops and that your contributions can be included into Symfony as quickly as possible: .. code-block:: text @@ -402,7 +402,7 @@ messages of all the commits. When you are finished, execute the push command. .. _ProGit: http://git-scm.com/book .. _GitHub: https://github.com/signup/free .. _`GitHub's Documentation`: https://help.github.com/articles/ignoring-files -.. _Symfony2 repository: https://github.com/symfony/symfony +.. _Symfony repository: https://github.com/symfony/symfony .. _dev mailing-list: http://groups.google.com/group/symfony-devs .. _travis-ci.org: https://travis-ci.org/ .. _`travis-ci.org status icon`: http://about.travis-ci.org/docs/user/status-images/ diff --git a/contributing/code/standards.rst b/contributing/code/standards.rst index ecff6254849..a2720e991df 100644 --- a/contributing/code/standards.rst +++ b/contributing/code/standards.rst @@ -1,9 +1,9 @@ Coding Standards ================ -When contributing code to Symfony2, you must follow its coding standards. To +When contributing code to Symfony, you must follow its coding standards. To make a long story short, here is the golden rule: **Imitate the existing -Symfony2 code**. Most open-source Bundles and libraries used by Symfony2 also +Symfony code**. Most open-source Bundles and libraries used by Symfony also follow the same guidelines, and you should too. Remember that the main advantage of standards is that every piece of code @@ -73,7 +73,7 @@ example containing most features described below: if ('values' === $mergedOptions['some_default']) { return substr($dummy, 0, 5); } - + return ucwords($dummy); } @@ -103,8 +103,8 @@ Structure * Declare class properties before methods; -* Declare public methods first, then protected ones and finally private ones. - The exceptions to this rule are the class constructor and the ``setUp`` and +* Declare public methods first, then protected ones and finally private ones. + The exceptions to this rule are the class constructor and the ``setUp`` and ``tearDown`` methods of PHPUnit tests, which should always be the first methods to increase readability; @@ -123,7 +123,7 @@ Naming Conventions * Use namespaces for all classes; -* Prefix abstract classes with ``Abstract``. Please note some early Symfony2 classes +* Prefix abstract classes with ``Abstract``. Please note some early Symfony classes do not follow this convention and have not been renamed for backward compatibility reasons. However all new abstract classes must follow this naming convention; diff --git a/contributing/code/tests.rst b/contributing/code/tests.rst index 8bda32458b7..3614cc772ca 100644 --- a/contributing/code/tests.rst +++ b/contributing/code/tests.rst @@ -1,19 +1,21 @@ -Running Symfony2 Tests -====================== +.. _running-symfony2-tests: + +Running Symfony Tests +===================== Before submitting a :doc:`patch ` for inclusion, you need to run the -Symfony2 test suite to check that you have not broken anything. +Symfony test suite to check that you have not broken anything. PHPUnit ------- -To run the Symfony2 test suite, `install PHPUnit`_ 3.7 (or later) first. +To run the Symfony test suite, `install PHPUnit`_ 3.7 (or later) first. Dependencies (optional) ----------------------- To run the entire test suite, including tests that depend on external -dependencies, Symfony2 needs to be able to autoload them. By default, they are +dependencies, Symfony needs to be able to autoload them. By default, they are autoloaded from ``vendor/`` under the main root directory (see ``autoload.php.dist``). @@ -68,7 +70,7 @@ Running First, update the vendors (see above). -Then, run the test suite from the Symfony2 root directory with the following +Then, run the test suite from the Symfony root directory with the following command: .. code-block:: bash diff --git a/contributing/community/releases.rst b/contributing/community/releases.rst index 6c953c83f85..39325e9ed67 100644 --- a/contributing/community/releases.rst +++ b/contributing/community/releases.rst @@ -77,7 +77,7 @@ Schedule Below is the schedule for the first few versions that use this release model: -.. image:: /images/release-process.jpg +.. image:: /images/contributing/release-process.jpg :align: center * **Yellow** represents the Development phase diff --git a/contributing/documentation/format.rst b/contributing/documentation/format.rst index 491d27df407..d00cdfa4592 100644 --- a/contributing/documentation/format.rst +++ b/contributing/documentation/format.rst @@ -1,7 +1,7 @@ Documentation Format ==================== -The Symfony2 documentation uses `reStructuredText`_ as its markup language and +The Symfony documentation uses `reStructuredText`_ as its markup language and `Sphinx`_ for building the output (HTML, PDF, ...). reStructuredText @@ -10,7 +10,7 @@ reStructuredText reStructuredText *"is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system"*. -You can learn more about its syntax by reading existing Symfony2 `documents`_ +You can learn more about its syntax by reading existing Symfony `documents`_ or by reading the `reStructuredText Primer`_ on the Sphinx website. .. caution:: diff --git a/contributing/documentation/license.rst b/contributing/documentation/license.rst index c8bce4bdaea..d2ee34b4077 100644 --- a/contributing/documentation/license.rst +++ b/contributing/documentation/license.rst @@ -1,7 +1,9 @@ -Symfony2 Documentation License -============================== +.. _symfony2-documentation-license: -The Symfony2 documentation is licensed under a Creative Commons +Symfony Documentation License +============================= + +The Symfony documentation is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported `License`_. **You are free:** diff --git a/contributing/documentation/overview.rst b/contributing/documentation/overview.rst index 8796557e56d..cb91c8b9111 100644 --- a/contributing/documentation/overview.rst +++ b/contributing/documentation/overview.rst @@ -12,7 +12,7 @@ Contributing Before contributing, you need to become familiar with the :doc:`markup language ` used by the documentation. -The Symfony2 documentation is hosted on GitHub: +The Symfony documentation is hosted on GitHub: .. code-block:: text @@ -61,7 +61,7 @@ If you have made your changes based on the 2.3 branch then you need to change the base branch to be 2.3 on the preview page by clicking the ``edit`` button on the top left: -.. image:: /images/docs-pull-request-change-base.png +.. image:: /images/contributing/docs-pull-request-change-base.png :align: center .. note:: @@ -73,7 +73,7 @@ GitHub covers the topic of `pull requests`_ in detail. .. note:: - The Symfony2 documentation is licensed under a Creative Commons + The Symfony documentation is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported :doc:`License `. You can also prefix the title of your pull request in a few cases: @@ -129,7 +129,7 @@ Documenting new Features or Behavior Changes -------------------------------------------- If you're documenting a brand new feature or a change that's been made in -Symfony2, you should precede your description of the change with a ``.. versionadded:: 2.X`` +Symfony, you should precede your description of the change with a ``.. versionadded:: 2.X`` tag and a short description: .. code-block:: text @@ -148,9 +148,9 @@ how the behavior has changed. The ``include()`` function is a new Twig feature that's available in Symfony 2.3. Prior, the ``{% include %}`` tag was used. -Whenever a new minor version of Symfony2 is released (e.g. 2.4, 2.5, etc), +Whenever a new minor version of Symfony is released (e.g. 2.4, 2.5, etc), a new branch of the documentation is created from the ``master`` branch. -At this point, all the ``versionadded`` tags for Symfony2 versions that have +At this point, all the ``versionadded`` tags for Symfony versions that have reached end-of-life will be removed. For example, if Symfony 2.5 were released today, and 2.2 had recently reached its end-of-life, the 2.2 ``versionadded`` tags would be removed from the new 2.5 branch. diff --git a/contributing/documentation/translations.rst b/contributing/documentation/translations.rst index c1c434ce35b..cc6838dbccb 100644 --- a/contributing/documentation/translations.rst +++ b/contributing/documentation/translations.rst @@ -1,7 +1,7 @@ Translations ============ -The Symfony2 documentation is written in English and many people are involved +The Symfony documentation is written in English and many people are involved in the translation process. Contributing @@ -53,7 +53,7 @@ Adding a new Language --------------------- This section gives some guidelines for starting the translation of the -Symfony2 documentation for a new language. +Symfony documentation for a new language. As starting a translation is a lot of work, talk about your plan on the `Symfony docs mailing-list`_ and try to find motivated people willing to help. diff --git a/cookbook/assetic/uglifyjs.rst b/cookbook/assetic/uglifyjs.rst index 965e8c28e71..05d378b43d7 100644 --- a/cookbook/assetic/uglifyjs.rst +++ b/cookbook/assetic/uglifyjs.rst @@ -57,7 +57,7 @@ in the ``node_modules`` directory: Configure the ``uglifyjs2`` Filter ---------------------------------- -Now we need to configure Symfony2 to use the ``uglifyjs2`` filter when processing +Now we need to configure Symfony to use the ``uglifyjs2`` filter when processing your JavaScripts: .. configuration-block:: diff --git a/cookbook/cache/varnish.rst b/cookbook/cache/varnish.rst index abbd56e6962..cb6ba5b8174 100644 --- a/cookbook/cache/varnish.rst +++ b/cookbook/cache/varnish.rst @@ -4,7 +4,7 @@ How to Use Varnish to Speed up my Website ========================================= -Because Symfony2's cache uses the standard HTTP cache headers, the +Because Symfony's cache uses the standard HTTP cache headers, the :ref:`symfony-gateway-cache` can easily be replaced with any other reverse proxy. `Varnish`_ is a powerful, open-source, HTTP accelerator capable of serving cached content quickly and including support for :ref:`Edge Side Includes `. @@ -22,12 +22,12 @@ headers to be used, you need to configure Varnish as a Configuration ------------- -As seen previously, Symfony2 is smart enough to detect whether it talks to a +As seen previously, Symfony is smart enough to detect whether it talks to a reverse proxy that understands ESI or not. It works out of the box when you -use the Symfony2 reverse proxy, but you need a special configuration to make -it work with Varnish. Thankfully, Symfony2 relies on yet another standard +use the Symfony reverse proxy, but you need a special configuration to make +it work with Varnish. Thankfully, Symfony relies on yet another standard written by Akamai (`Edge Architecture`_), so the configuration tips in this -chapter can be useful even if you don't use Symfony2. +chapter can be useful even if you don't use Symfony. .. note:: @@ -52,7 +52,7 @@ application: Then, optimize Varnish so that it only parses the Response contents when there is at least one ESI tag by checking the ``Surrogate-Control`` header that -Symfony2 adds automatically: +Symfony adds automatically: .. code-block:: text @@ -91,16 +91,16 @@ Symfony2 adds automatically: Cache Invalidation ------------------ -If you want to cache content that changes frequently and still serve -the most recent version to users, you need to invalidate that content. -While `cache invalidation`_ allows you to purge content from your +If you want to cache content that changes frequently and still serve +the most recent version to users, you need to invalidate that content. +While `cache invalidation`_ allows you to purge content from your proxy before it has expired, it adds complexity to your caching setup. .. tip:: - The open source `FOSHttpCacheBundle`_ takes the pain out of cache - invalidation by helping you to organize your caching and - invalidation setup. + The open source `FOSHttpCacheBundle`_ takes the pain out of cache + invalidation by helping you to organize your caching and + invalidation setup. Varnish can be configured to accept a special HTTP ``PURGE`` method that will invalidate the cache for a given resource: diff --git a/cookbook/configuration/apache_router.rst b/cookbook/configuration/apache_router.rst index 97e8774cf96..90f652992f4 100644 --- a/cookbook/configuration/apache_router.rst +++ b/cookbook/configuration/apache_router.rst @@ -4,14 +4,14 @@ How to Use the Apache Router ============================ -Symfony2, while fast out of the box, also provides various ways to increase that speed with a little bit of tweaking. -One of these ways is by letting Apache handle routes directly, rather than using Symfony2 for this task. +Symfony, while fast out of the box, also provides various ways to increase that speed with a little bit of tweaking. +One of these ways is by letting Apache handle routes directly, rather than using Symfony for this task. Change Router Configuration Parameters -------------------------------------- To dump Apache routes you must first tweak some configuration parameters to tell -Symfony2 to use the ``ApacheUrlMatcher`` instead of the default one: +Symfony to use the ``ApacheUrlMatcher`` instead of the default one: .. configuration-block:: diff --git a/cookbook/configuration/configuration_organization.rst b/cookbook/configuration/configuration_organization.rst index 52c5c0f0d4a..d124ff9629d 100644 --- a/cookbook/configuration/configuration_organization.rst +++ b/cookbook/configuration/configuration_organization.rst @@ -4,7 +4,7 @@ How to Organize Configuration Files =================================== -The default Symfony2 Standard Edition defines three +The default Symfony Standard Edition defines three :doc:`execution environments ` called ``dev``, ``prod`` and ``test``. An environment simply represents a way to execute the same codebase with different configurations. diff --git a/cookbook/configuration/environments.rst b/cookbook/configuration/environments.rst index d4884e2223a..4547b4fc1b1 100644 --- a/cookbook/configuration/environments.rst +++ b/cookbook/configuration/environments.rst @@ -7,7 +7,7 @@ How to Master and Create new Environments Every application is the combination of code and a set of configuration that dictates how that code should function. The configuration may define the database being used, whether or not something should be cached, or how verbose -logging should be. In Symfony2, the idea of "environments" is the idea that +logging should be. In Symfony, the idea of "environments" is the idea that the same codebase can be run using multiple different configurations. For example, the ``dev`` environment should use configuration that makes development easy and friendly, while the ``prod`` environment should use a set of configuration @@ -19,7 +19,7 @@ optimized for speed. Different Environments, different Configuration Files ----------------------------------------------------- -A typical Symfony2 application begins with three environments: ``dev``, +A typical Symfony application begins with three environments: ``dev``, ``prod``, and ``test``. As discussed, each "environment" simply represents a way to execute the same codebase with different configuration. It should be no surprise then that each environment loads its own individual configuration @@ -49,7 +49,7 @@ class: } } -As you can see, when Symfony2 is loaded, it uses the given environment to +As you can see, when Symfony is loaded, it uses the given environment to determine which configuration file to load. This accomplishes the goal of multiple environments in an elegant, powerful and transparent way. @@ -141,7 +141,7 @@ either the ``app.php`` (for the ``prod`` environment) or the ``app_dev.php`` The given URLs assume that your web server is configured to use the ``web/`` directory of the application as its root. Read more in - :doc:`Installing Symfony2 `. + :doc:`Installing Symfony `. If you open up one of these files, you'll quickly see that the environment used by each is explicitly set:: @@ -154,7 +154,7 @@ used by each is explicitly set:: // ... As you can see, the ``prod`` key specifies that this application will run -in the ``prod`` environment. A Symfony2 application can be executed in any +in the ``prod`` environment. A Symfony application can be executed in any environment by using this code and changing the environment string. .. note:: @@ -172,7 +172,7 @@ environment by using this code and changing the environment string. Important, but unrelated to the topic of *environments* is the ``false`` argument as the second argument to the ``AppKernel`` constructor. This specifies whether or not the application should run in "debug mode". Regardless - of the environment, a Symfony2 application can be run with debug mode + of the environment, a Symfony application can be run with debug mode set to ``true`` or ``false``. This affects many things in the application, such as whether or not errors should be displayed or if cache files are dynamically rebuilt on each request. Though not a requirement, debug mode @@ -218,14 +218,14 @@ environment by using this code and changing the environment string. Creating a new Environment -------------------------- -By default, a Symfony2 application has three environments that handle most +By default, a Symfony application has three environments that handle most cases. Of course, since an environment is nothing more than a string that corresponds to a set of configuration, creating a new environment is quite easy. Suppose, for example, that before deployment, you need to benchmark your application. One way to benchmark the application is to use near-production -settings, but with Symfony2's ``web_profiler`` enabled. This allows Symfony2 +settings, but with Symfony's ``web_profiler`` enabled. This allows Symfony to record information about your application while benchmarking. The best way to accomplish this is via a new environment called, for example, @@ -306,7 +306,7 @@ The new environment is now accessible via:: Environments and the Cache Directory ------------------------------------ -Symfony2 takes advantage of caching in many ways: the application configuration, +Symfony takes advantage of caching in many ways: the application configuration, routing configuration, Twig templates and more are cached to PHP objects stored in files on the filesystem. diff --git a/cookbook/configuration/external_parameters.rst b/cookbook/configuration/external_parameters.rst index 39ee107aa61..0f9c56501c5 100644 --- a/cookbook/configuration/external_parameters.rst +++ b/cookbook/configuration/external_parameters.rst @@ -24,7 +24,7 @@ the following ``VirtualHost`` configuration: .. code-block:: apache - ServerName Symfony2 + ServerName Symfony DocumentRoot "/path/to/symfony_2_app/web" DirectoryIndex index.php index.html SetEnv SYMFONY__DATABASE__USER user @@ -65,7 +65,7 @@ You can now reference these parameters wherever you need them. doctrine: dbal: driver pdo_mysql - dbname: symfony2_project + dbname: symfony_project user: "%database.user%" password: "%database.password%" @@ -77,7 +77,7 @@ You can now reference these parameters wherever you need them. @@ -88,7 +88,7 @@ You can now reference these parameters wherever you need them. $container->loadFromExtension('doctrine', array( 'dbal' => array( 'driver' => 'pdo_mysql', - 'dbname' => 'symfony2_project', + 'dbname' => 'symfony_project', 'user' => '%database.user%', 'password' => '%database.password%', ) diff --git a/cookbook/configuration/front_controllers_and_kernel.rst b/cookbook/configuration/front_controllers_and_kernel.rst index 0acb4be5ff4..705b6697983 100644 --- a/cookbook/configuration/front_controllers_and_kernel.rst +++ b/cookbook/configuration/front_controllers_and_kernel.rst @@ -18,7 +18,7 @@ three parts that work together: .. note:: Usually, you will not need to define your own front controller or - ``AppKernel`` class as the `Symfony2 Standard Edition`_ provides + ``AppKernel`` class as the `Symfony Standard Edition`_ provides sensible default implementations. This documentation section is provided to explain what is going on behind @@ -30,7 +30,7 @@ The Front Controller The `front controller`_ is a well-known design pattern; it is a section of code that *all* requests served by an application run through. -In the `Symfony2 Standard Edition`_, this role is taken by the `app.php`_ +In the `Symfony Standard Edition`_, this role is taken by the `app.php`_ and `app_dev.php`_ files in the ``web/`` directory. These are the very first PHP scripts executed when a request is processed. @@ -83,7 +83,7 @@ The Kernel Class ---------------- The :class:`Symfony\\Component\\HttpKernel\\Kernel` is the core of -Symfony2. It is responsible for setting up all the bundles that make up +Symfony. It is responsible for setting up all the bundles that make up your application and providing them with the application's configuration. It then creates the service container before serving requests in its :method:`Symfony\\Component\\HttpKernel\\HttpKernelInterface::handle` @@ -105,7 +105,7 @@ To fill these (small) blanks, your application needs to subclass the Kernel and implement these methods. The resulting class is conventionally called the ``AppKernel``. -Again, the Symfony2 Standard Edition provides an `AppKernel`_ in the ``app/`` +Again, the Symfony Standard Edition provides an `AppKernel`_ in the ``app/`` directory. This class uses the name of the environment - which is passed to the Kernel's :method:`constructor ` method and is available via :method:`Symfony\\Component\\HttpKernel\\Kernel::getEnvironment` - @@ -162,7 +162,7 @@ free to implement this method differently if you need a more sophisticated way of loading your configuration. .. _front controller: http://en.wikipedia.org/wiki/Front_Controller_pattern -.. _Symfony2 Standard Edition: https://github.com/symfony/symfony-standard +.. _Symfony Standard Edition: https://github.com/symfony/symfony-standard .. _app.php: https://github.com/symfony/symfony-standard/blob/master/web/app.php .. _app_dev.php: https://github.com/symfony/symfony-standard/blob/master/web/app_dev.php .. _app/console: https://github.com/symfony/symfony-standard/blob/master/app/console diff --git a/cookbook/configuration/pdo_session_storage.rst b/cookbook/configuration/pdo_session_storage.rst index 85d04ef3c8d..be5e606d2ef 100644 --- a/cookbook/configuration/pdo_session_storage.rst +++ b/cookbook/configuration/pdo_session_storage.rst @@ -4,12 +4,12 @@ How to Use PdoSessionHandler to Store Sessions in the Database ============================================================== -The default session storage of Symfony2 writes the session information to +The default Symfony session storage writes the session information to file(s). Most medium to large websites use a database to store the session values instead of files, because databases are easier to use and scale in a multi-webserver environment. -Symfony2 has a built-in solution for database session storage called +Symfony has a built-in solution for database session storage called :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\PdoSessionHandler`. To use it, you just need to change some parameters in ``config.yml`` (or the configuration format of your choice): diff --git a/cookbook/configuration/web_server_configuration.rst b/cookbook/configuration/web_server_configuration.rst index 9c9fcfb4af8..e93e873307c 100644 --- a/cookbook/configuration/web_server_configuration.rst +++ b/cookbook/configuration/web_server_configuration.rst @@ -4,7 +4,7 @@ Configuring a Web Server ======================== -The preferred way to develop your Symfony2 application is to use +The preferred way to develop your Symfony application is to use :doc:`PHP's internal web server `. However, when using an older PHP version or when running the application in the production environment, you'll need to use a fully-featured web server. This article diff --git a/cookbook/console/console_command.rst b/cookbook/console/console_command.rst index c460fe7e74b..23f2ad2b494 100644 --- a/cookbook/console/console_command.rst +++ b/cookbook/console/console_command.rst @@ -6,12 +6,12 @@ How to Create a Console Command The Console page of the Components section (:doc:`/components/console/introduction`) covers how to create a console command. This cookbook article covers the differences -when creating console commands within the Symfony2 framework. +when creating console commands within the Symfony framework. Automatically Registering Commands ---------------------------------- -To make the console commands available automatically with Symfony2, create a +To make the console commands available automatically with Symfony, create a ``Command`` directory inside your bundle and create a PHP file suffixed with ``Command.php`` for each command that you want to provide. For example, if you want to extend the AcmeDemoBundle to greet you from the command line, create diff --git a/cookbook/controller/error_pages.rst b/cookbook/controller/error_pages.rst index 1f4af550f39..00cb1b420f8 100644 --- a/cookbook/controller/error_pages.rst +++ b/cookbook/controller/error_pages.rst @@ -5,7 +5,7 @@ How to Customize Error Pages ============================ -When any exception is thrown in Symfony2, the exception is caught inside the +When any exception is thrown in Symfony, the exception is caught inside the ``Kernel`` class and eventually forwarded to a special controller, ``TwigBundle:Exception:show`` for handling. This controller, which lives inside the core TwigBundle, determines which error template to display and @@ -31,7 +31,7 @@ shown to the end-user. You should not set ``kernel.debug`` to ``false`` in order to see your error pages during development. This will also stop - Symfony2 from recompiling your twig templates, among other things. + Symfony from recompiling your twig templates, among other things. The third-party `WebfactoryExceptionsBundle`_ provides a special test controller that allows you to display your custom error @@ -75,7 +75,7 @@ template located at .. tip:: If you're not familiar with Twig, don't worry. Twig is a simple, powerful - and optional templating engine that integrates with Symfony2. For more + and optional templating engine that integrates with Symfony. For more information about Twig see :doc:`/book/templating`. In addition to the standard HTML error page, Symfony provides a default error @@ -111,7 +111,7 @@ Symfony uses the following algorithm to determine which template to use: To see the full list of default error templates, see the ``Resources/views/Exception`` directory of the TwigBundle. In a - standard Symfony2 installation, the TwigBundle can be found at + standard Symfony installation, the TwigBundle can be found at ``vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle``. Often, the easiest way to customize an error page is to copy it from the TwigBundle into ``app/Resources/TwigBundle/views/Exception`` and then modify it. diff --git a/cookbook/controller/service.rst b/cookbook/controller/service.rst index 602b14aead3..2fa69b5c332 100644 --- a/cookbook/controller/service.rst +++ b/cookbook/controller/service.rst @@ -25,7 +25,7 @@ this works fine, controllers can also be specified as services. split into multiple controllers. So, even if you don't specify your controllers as services, you'll likely - see this done in some open-source Symfony2 bundles. It's also important + see this done in some open-source Symfony bundles. It's also important to understand the pros and cons of both approaches. Defining the Controller as a Service diff --git a/cookbook/deployment/azure-website.rst b/cookbook/deployment/azure-website.rst index a35ccbaea03..efee282260e 100644 --- a/cookbook/deployment/azure-website.rst +++ b/cookbook/deployment/azure-website.rst @@ -4,7 +4,7 @@ Deploying to Microsoft Azure Website Cloud ========================================== -This step by step cookbook describes how to deploy a small Symfony2 web +This step by step cookbook describes how to deploy a small Symfony web application to the Microsoft Azure Website cloud platform. It will explain how to setup a new Azure website including configuring the right PHP version and global environment variables. The document also shows how to you can leverage @@ -355,7 +355,7 @@ below. Of course, each value depends on what you've already configured. .. code-block:: text - Database=mysymfony2MySQL;Data Source=eu-cdbr-azure-north-c.cloudapp.net;User Id=bff2481a5b6074;Password=bdf50b42 + Database=mysymfonyMySQL;Data Source=eu-cdbr-azure-north-c.cloudapp.net;User Id=bff2481a5b6074;Password=bdf50b42 Switch back to the console and answer the prompted questions and provide the following answers. Don't forget to adapt the values below with your real values @@ -366,7 +366,7 @@ from the MySQL connection string. database_driver: pdo_mysql database_host: u-cdbr-azure-north-c.cloudapp.net database_port: null - database_name: mysymfony2MySQL + database_name: mysymfonyMySQL database_user: bff2481a5b6074 database_password: bdf50b42 // ... diff --git a/cookbook/deployment/heroku.rst b/cookbook/deployment/heroku.rst index 22370e8152b..87baeb6c8d6 100644 --- a/cookbook/deployment/heroku.rst +++ b/cookbook/deployment/heroku.rst @@ -4,7 +4,7 @@ Deploying to Heroku Cloud ========================= -This step by step cookbook describes how to deploy a Symfony2 web application to +This step by step cookbook describes how to deploy a Symfony web application to the Heroku cloud platform. Its contents are based on `the original article`_ published by Heroku. @@ -15,24 +15,24 @@ To setup a new Heroku website, first `signup with Heroku`_ or sign in with your credentials. Then download and install the `Heroku Toolbelt`_ on your local computer. -You can also check out the `getting Started with PHP on Heroku`_ guide to gain +You can also check out the `getting Started with PHP on Heroku`_ guide to gain more familiarity with the specifics of working with PHP applications on Heroku. Preparing your Application ~~~~~~~~~~~~~~~~~~~~~~~~~~ -Deploying a Symfony2 application to Heroku doesn't require any change in its +Deploying a Symfony application to Heroku doesn't require any change in its code, but it requires some minor tweaks to its configuration. -By default, the Symfony2 app will log into your application's ``app/log/`` -directory. This is not ideal as Heroku uses an `ephemeral file system`_. On -Heroku, the best way to handle logging is using `Logplex`_. And the best way to -send log data to Logplex is by writing to ``STDERR`` or ``STDOUT``. Luckily, -Symfony2 uses the excellent Monolog library for logging. So, a new log +By default, the Symfony app will log into your application's ``app/log/`` +directory. This is not ideal as Heroku uses an `ephemeral file system`_. On +Heroku, the best way to handle logging is using `Logplex`_. And the best way to +send log data to Logplex is by writing to ``STDERR`` or ``STDOUT``. Luckily, +Symfony uses the excellent Monolog library for logging. So, a new log destination is just a change to a config file away. Open the ``app/config/config_prod.yml`` file, locate the -``monolog/handlers/nested`` section (or create it if it doesn't exist yet) and +``monolog/handlers/nested`` section (or create it if it doesn't exist yet) and change the value of ``path`` from ``"%kernel.logs_dir%/%kernel.environment%.log"`` to ``"php://stderr"``: @@ -47,7 +47,7 @@ change the value of ``path`` from # ... path: "php://stderr" -Once the application is deployed, run ``heroku logs --tail`` to keep the +Once the application is deployed, run ``heroku logs --tail`` to keep the stream of logs from Heroku open in your terminal. Creating a new Application on Heroku @@ -69,37 +69,37 @@ You are now ready to deploy the application as explained in the next section. Deploying your Application on Heroku ------------------------------------ -To deploy your application to Heroku, you must first create a ``Procfile``, -which tells Heroku what command to use to launch the web server with the -correct settings. After you've done that, you can simply ``git push`` and +To deploy your application to Heroku, you must first create a ``Procfile``, +which tells Heroku what command to use to launch the web server with the +correct settings. After you've done that, you can simply ``git push`` and you're done! Creating a Procfile ~~~~~~~~~~~~~~~~~~~ -By default, Heroku will launch an Apache web server together with PHP to serve +By default, Heroku will launch an Apache web server together with PHP to serve applications. However, two special circumstances apply to Symfony applications: 1. The document root is in the ``web/`` directory and not in the root directory of the application; -2. The Composer ``bin-dir``, where vendor binaries (and thus Heroku's own boot +2. The Composer ``bin-dir``, where vendor binaries (and thus Heroku's own boot scripts) are placed, is ``bin/`` , and not the default ``vendor/bin``. .. note:: - Vendor binaries are usually installed to ``vendor/bin`` by Composer, but - sometimes (e.g. when running a Symfony Standard Edition project!), the + Vendor binaries are usually installed to ``vendor/bin`` by Composer, but + sometimes (e.g. when running a Symfony Standard Edition project!), the location will be different. If in doubt, you can always run ``composer config bin-dir`` to figure out the right location. -Create a new file called ``Procfile`` (without any extension) at the root +Create a new file called ``Procfile`` (without any extension) at the root directory of the application and add just the following content: .. code-block:: text web: bin/heroku-php-apache2 web/ -If you prefer working on the command console, execute the following commands to +If you prefer working on the command console, execute the following commands to create the ``Procfile`` file and to add it to the repository: .. code-block:: bash @@ -175,8 +175,8 @@ Then, deploy your application executing this command: To git@heroku.com:mighty-hamlet-1981.git * [new branch] master -> master -And that's it! If you now open your browser, either by manually pointing -it to the URL ``heroku create`` gave you, or by using the Heroku Toolbelt, the +And that's it! If you now open your browser, either by manually pointing +it to the URL ``heroku create`` gave you, or by using the Heroku Toolbelt, the application will respond: .. code-block:: bash @@ -184,7 +184,7 @@ application will respond: $ heroku open Opening mighty-hamlet-1981... done -You should be seeing your Symfony2 application in your browser. +You should be seeing your Symfony application in your browser. .. _`the original article`: https://devcenter.heroku.com/articles/getting-started-with-symfony2 .. _`signup with Heroku`: https://signup.heroku.com/signup/dc diff --git a/cookbook/deployment/tools.rst b/cookbook/deployment/tools.rst index 58cc3bd6cfc..5f6a9991a65 100644 --- a/cookbook/deployment/tools.rst +++ b/cookbook/deployment/tools.rst @@ -1,8 +1,10 @@ .. index:: single: Deployment; Deployment tools -How to Deploy a Symfony2 Application -==================================== +.. _how-to-deploy-a-symfony2-application: + +How to Deploy a Symfony Application +=================================== .. note:: @@ -10,10 +12,12 @@ How to Deploy a Symfony2 Application This entry doesn't try to explain everything, but rather offers the most common requirements and ideas for deployment. -Symfony2 Deployment Basics --------------------------- +.. _symfony2-deployment-basics: + +Symfony Deployment Basics +------------------------- -The typical steps taken while deploying a Symfony2 application include: +The typical steps taken while deploying a Symfony application include: #. Upload your modified code to the live server; #. Update your vendor dependencies (typically done via Composer, and may @@ -29,10 +33,10 @@ A deployment may also include other things, such as: * Removal of any unnecessary files from ``web`` to keep your production environment clean; * Clearing of external cache systems (like `Memcached`_ or `Redis`_). -How to Deploy a Symfony2 Application ------------------------------------- +How to Deploy a Symfony Application +----------------------------------- -There are several ways you can deploy a Symfony2 application. +There are several ways you can deploy a Symfony application. Start with a few basic deployment strategies and build up from there. @@ -60,7 +64,7 @@ Using Build Scripts and other Tools There are also high-quality tools to help ease the pain of deployment. There are even a few tools which have been specifically tailored to the requirements of -Symfony2, and which take special care to ensure that everything before, during, +Symfony, and which take special care to ensure that everything before, during, and after a deployment has gone correctly. See `The Tools`_ for a list of tools that can help with deployment. @@ -159,11 +163,11 @@ The Tools `Capifony`_: This tool provides a specialized set of tools on top of Capistrano, tailored - specifically to symfony and Symfony2 projects. + specifically to symfony and Symfony projects. `sf2debpkg`_: - This tool helps you build a native Debian package for your Symfony2 project. + This tool helps you build a native Debian package for your Symfony project. `Magallanes`_: @@ -173,7 +177,7 @@ The Tools Bundles: There are many `bundles that add deployment features`_ directly into your - Symfony2 console. + Symfony console. Basic scripting: @@ -185,7 +189,7 @@ Platform as a Service Providers: PaaS is a relatively new way to deploy your application. Typically a PaaS will use a single configuration file in your project's root directory to determine how to build an environment on the fly that supports your software. - One provider with confirmed Symfony2 support is `PagodaBox`_. + One provider with confirmed Symfony support is `PagodaBox`_. .. tip:: diff --git a/cookbook/doctrine/common_extensions.rst b/cookbook/doctrine/common_extensions.rst index 8f6719745a6..0944fa5e7cb 100644 --- a/cookbook/doctrine/common_extensions.rst +++ b/cookbook/doctrine/common_extensions.rst @@ -20,7 +20,7 @@ To do this, you have two options: #. Use the `StofDoctrineExtensionsBundle`_, which integrates the above library. #. Implement this services directly by following the documentation for integration - with Symfony2: `Install Gedmo Doctrine2 extensions in Symfony2`_ + with Symfony: `Install Gedmo Doctrine2 extensions in Symfony2`_ .. _`DoctrineExtensions`: https://github.com/Atlantic18/DoctrineExtensions .. _`StofDoctrineExtensionsBundle`: https://github.com/stof/StofDoctrineExtensionsBundle diff --git a/cookbook/doctrine/dbal.rst b/cookbook/doctrine/dbal.rst index 2f208c23c99..5cc468202c2 100644 --- a/cookbook/doctrine/dbal.rst +++ b/cookbook/doctrine/dbal.rst @@ -31,7 +31,7 @@ To get started, configure the database connection parameters: doctrine: dbal: driver: pdo_mysql - dbname: Symfony2 + dbname: Symfony user: root password: null charset: UTF8 @@ -42,7 +42,7 @@ To get started, configure the database connection parameters: loadFromExtension('doctrine', array( 'dbal' => array( 'driver' => 'pdo_mysql', - 'dbname' => 'Symfony2', + 'dbname' => 'Symfony', 'user' => 'root', 'password' => null, ), diff --git a/cookbook/doctrine/file_uploads.rst b/cookbook/doctrine/file_uploads.rst index ab90001194e..95a06bd7672 100644 --- a/cookbook/doctrine/file_uploads.rst +++ b/cookbook/doctrine/file_uploads.rst @@ -213,7 +213,7 @@ rules:: .. note:: - As you are using the ``File`` constraint, Symfony2 will automatically guess + As you are using the ``File`` constraint, Symfony will automatically guess that the form field is a file upload input. That's why you did not have to set it explicitly when creating the form above (``->add('file')``). diff --git a/cookbook/doctrine/multiple_entity_managers.rst b/cookbook/doctrine/multiple_entity_managers.rst index 271ed3f6f7a..689d9d1bba2 100644 --- a/cookbook/doctrine/multiple_entity_managers.rst +++ b/cookbook/doctrine/multiple_entity_managers.rst @@ -4,7 +4,7 @@ How to Work with multiple Entity Managers and Connections ========================================================= -You can use multiple Doctrine entity managers or connections in a Symfony2 +You can use multiple Doctrine entity managers or connections in a Symfony application. This is necessary if you are using different databases or even vendors with entirely different sets of entities. In other words, one entity manager that connects to one database will handle some entities while another diff --git a/cookbook/email/dev_environment.rst b/cookbook/email/dev_environment.rst index 216370d2f72..65a5a64524e 100644 --- a/cookbook/email/dev_environment.rst +++ b/cookbook/email/dev_environment.rst @@ -6,7 +6,7 @@ How to Work with Emails during Development When developing an application which sends email, you will often not want to actually send the email to the specified recipient during -development. If you are using the SwiftmailerBundle with Symfony2, you +development. If you are using the SwiftmailerBundle with Symfony, you can easily achieve this through configuration settings without having to make any changes to your application's code at all. There are two main choices when it comes to handling email during development: (a) disabling the diff --git a/cookbook/email/email.rst b/cookbook/email/email.rst index 6c2d8978714..77392629a9f 100644 --- a/cookbook/email/email.rst +++ b/cookbook/email/email.rst @@ -129,7 +129,7 @@ of `Creating Messages`_ in great detail in its documentation. .. tip:: Several other cookbook articles are available related to sending emails - in Symfony2: + in Symfony: * :doc:`gmail` * :doc:`dev_environment` diff --git a/cookbook/email/spool.rst b/cookbook/email/spool.rst index 37fb02f2344..9210787160d 100644 --- a/cookbook/email/spool.rst +++ b/cookbook/email/spool.rst @@ -4,7 +4,7 @@ How to Spool Emails =================== -When you are using the SwiftmailerBundle to send an email from a Symfony2 +When you are using the SwiftmailerBundle to send an email from a Symfony application, it will default to sending the email immediately. You may, however, want to avoid the performance hit of the communication between Swift Mailer and the email transport, which could cause the user to wait for the next diff --git a/cookbook/email/testing.rst b/cookbook/email/testing.rst index f42025bef6e..db6e717ec36 100644 --- a/cookbook/email/testing.rst +++ b/cookbook/email/testing.rst @@ -4,11 +4,11 @@ How to Test that an Email is Sent in a functional Test ====================================================== -Sending e-mails with Symfony2 is pretty straightforward thanks to the +Sending e-mails with Symfony is pretty straightforward thanks to the SwiftmailerBundle, which leverages the power of the `Swift Mailer`_ library. To functionally test that an email was sent, and even assert the email subject, -content or any other headers, you can use :ref:`the Symfony2 Profiler `. +content or any other headers, you can use :ref:`the Symfony Profiler `. Start with an easy controller action that sends an e-mail:: diff --git a/cookbook/event_dispatcher/before_after_filters.rst b/cookbook/event_dispatcher/before_after_filters.rst index b4e17c33590..569f0c7cce5 100644 --- a/cookbook/event_dispatcher/before_after_filters.rst +++ b/cookbook/event_dispatcher/before_after_filters.rst @@ -125,7 +125,7 @@ event listeners, you can learn more about them at :doc:`/cookbook/service_contai $controller = $event->getController(); /* - * $controller passed can be either a class or a Closure. This is not usual in Symfony2 but it may happen. + * $controller passed can be either a class or a Closure. This is not usual in Symfony but it may happen. * If it is a class, it comes in array format */ if (!is_array($controller)) { diff --git a/cookbook/logging/channels_handlers.rst b/cookbook/logging/channels_handlers.rst index 9e749ac9a16..131317eb47a 100644 --- a/cookbook/logging/channels_handlers.rst +++ b/cookbook/logging/channels_handlers.rst @@ -10,7 +10,7 @@ service (``monolog.logger.XXX``) in the container and is injected to the concerned service. The purpose of channels is to be able to organize different types of log messages. -By default, Symfony2 logs every messages into a single file (regardless of +By default, Symfony logs every message into a single file (regardless of the channel). Switching a Channel to a different Handler diff --git a/cookbook/logging/monolog.rst b/cookbook/logging/monolog.rst index 51c8cd5976f..ab290e5d519 100644 --- a/cookbook/logging/monolog.rst +++ b/cookbook/logging/monolog.rst @@ -4,7 +4,7 @@ How to Use Monolog to Write Logs ================================ -Monolog_ is a logging library for PHP 5.3 used by Symfony2. It is +Monolog_ is a logging library for PHP 5.3 used by Symfony. It is inspired by the Python LogBook library. Usage diff --git a/cookbook/map.rst.inc b/cookbook/map.rst.inc index 93b59121a03..b772f276c9a 100644 --- a/cookbook/map.rst.inc +++ b/cookbook/map.rst.inc @@ -196,6 +196,7 @@ * :doc:`/cookbook/testing/doctrine` * :doc:`/cookbook/testing/bootstrap` * (email) :doc:`/cookbook/email/testing` + * (form) :doc:`/cookbook/form/unit_testing` * :doc:`/cookbook/validation/index` diff --git a/cookbook/profiler/data_collector.rst b/cookbook/profiler/data_collector.rst index c88d55701df..6c02639f197 100644 --- a/cookbook/profiler/data_collector.rst +++ b/cookbook/profiler/data_collector.rst @@ -4,8 +4,8 @@ How to Create a custom Data Collector ===================================== -The Symfony2 :ref:`Profiler ` delegates data collecting to -data collectors. Symfony2 comes bundled with a few of them, but you can easily +The Symfony :ref:`Profiler ` delegates data collecting to +data collectors. Symfony comes bundled with a few of them, but you can easily create your own. Creating a custom Data Collector diff --git a/cookbook/profiler/matchers.rst b/cookbook/profiler/matchers.rst index 09f83c73f55..b23af0d21f0 100644 --- a/cookbook/profiler/matchers.rst +++ b/cookbook/profiler/matchers.rst @@ -13,7 +13,7 @@ by using matchers. Using the built-in Matcher -------------------------- -Symfony2 provides a +Symfony provides a :class:`built-in matcher ` which can match paths and IPs. For example, if you want to only show the profiler when accessing the page with the ``168.0.0.1`` IP, then you can diff --git a/cookbook/routing/method_parameters.rst b/cookbook/routing/method_parameters.rst index 097ae3daebc..72bf7120afc 100644 --- a/cookbook/routing/method_parameters.rst +++ b/cookbook/routing/method_parameters.rst @@ -83,9 +83,9 @@ Faking the Method with ``_method`` 2.3, use the :ref:`configuration-framework-http_method_override` option. Unfortunately, life isn't quite this simple, since most browsers do not -support sending PUT and DELETE requests. Fortunately Symfony2 provides you +support sending PUT and DELETE requests. Fortunately, Symfony provides you with a simple way of working around this limitation. By including a ``_method`` -parameter in the query string or parameters of an HTTP request, Symfony2 will +parameter in the query string or parameters of an HTTP request, Symfony will use this as the method when matching routes. Forms automatically include a hidden field for this parameter if their submission method is not GET or POST. See :ref:`the related chapter in the forms documentation` diff --git a/cookbook/routing/redirect_trailing_slash.rst b/cookbook/routing/redirect_trailing_slash.rst index 65a09c9467c..01b0010fc1e 100644 --- a/cookbook/routing/redirect_trailing_slash.rst +++ b/cookbook/routing/redirect_trailing_slash.rst @@ -89,5 +89,5 @@ system, as explained below: Make sure to include this route in your routing configuration at the very end of your route listing. Otherwise, you risk redirecting real - routes (including Symfony2 core routes) that actually *do* have a trailing + routes (including Symfony core routes) that actually *do* have a trailing slash in their path. diff --git a/cookbook/security/acl.rst b/cookbook/security/acl.rst index 0ee5b34fecd..b26b271b4db 100644 --- a/cookbook/security/acl.rst +++ b/cookbook/security/acl.rst @@ -25,7 +25,7 @@ posts. Now, you want a user to be able to edit their own comments, but not those of other users; besides, you yourself want to be able to edit all comments. In this scenario, ``Comment`` would be the domain object that you want to restrict access to. You could take several approaches to accomplish this using -Symfony2, two basic approaches are (non-exhaustive): +Symfony, two basic approaches are (non-exhaustive): - *Enforce security in your business methods*: Basically, that means keeping a reference inside each ``Comment`` to all users who have access, and then @@ -189,7 +189,7 @@ Checking Access } In this example, you check whether the user has the ``EDIT`` permission. -Internally, Symfony2 maps the permission to several integer bitmasks, and +Internally, Symfony maps the permission to several integer bitmasks, and checks whether the user has any of them. .. note:: diff --git a/cookbook/security/acl_advanced.rst b/cookbook/security/acl_advanced.rst index 9dbbe722b4f..7d6efe5dc8f 100644 --- a/cookbook/security/acl_advanced.rst +++ b/cookbook/security/acl_advanced.rst @@ -10,10 +10,10 @@ also explain some of the design decisions behind it. Design Concepts --------------- -Symfony2's object instance security capabilities are based on the concept of +Symfony's object instance security capabilities are based on the concept of an Access Control List. Every domain object **instance** has its own ACL. The ACL instance holds a detailed list of Access Control Entries (ACEs) which are -used to make access decisions. Symfony2's ACL system focuses on two main +used to make access decisions. Symfony's ACL system focuses on two main objectives: - providing a way to efficiently retrieve a large amount of ACLs/ACEs for your @@ -21,7 +21,7 @@ objectives: - providing a way to easily make decisions of whether a person is allowed to perform an action on a domain object or not. -As indicated by the first point, one of the main capabilities of Symfony2's +As indicated by the first point, one of the main capabilities of Symfony's ACL system is a high-performance way of retrieving ACLs/ACEs. This is extremely important since each ACL might have several ACEs, and inherit from another ACL in a tree-like fashion. Therefore, no ORM is leveraged, instead @@ -70,7 +70,7 @@ Scope of Access Control Entries ------------------------------- Access control entries can have different scopes in which they apply. In -Symfony2, there are basically two different scopes: +Symfony, there are basically two different scopes: - Class-Scope: These entries apply to all objects with the same class. - Object-Scope: This was the scope solely used in the previous chapter, and diff --git a/cookbook/security/custom_authentication_provider.rst b/cookbook/security/custom_authentication_provider.rst index 83972ce2277..4232c04ba32 100644 --- a/cookbook/security/custom_authentication_provider.rst +++ b/cookbook/security/custom_authentication_provider.rst @@ -14,7 +14,7 @@ How to Create a custom Authentication Provider * :doc:`/cookbook/security/api_key_authentication` If you have read the chapter on :doc:`/book/security`, you understand the -distinction Symfony2 makes between authentication and authorization in the +distinction Symfony makes between authentication and authorization in the implementation of security. This chapter discusses the core classes involved in the authentication process, and how to implement a custom authentication provider. Because authentication and authorization are separate concepts, @@ -38,7 +38,7 @@ REST. There is plenty of great documentation on `WSSE`_, but this article will focus not on the security protocol, but rather the manner in which a custom -protocol can be added to your Symfony2 application. The basis of WSSE is +protocol can be added to your Symfony application. The basis of WSSE is that a request header is checked for encrypted credentials, verified using a timestamp and `nonce`_, and authenticated for the requested user using a password digest. @@ -51,7 +51,7 @@ password digest. The Token --------- -The role of the token in the Symfony2 security context is an important one. +The role of the token in the Symfony security context is an important one. A token represents the user authentication data present in the request. Once a request is authenticated, the token retains the user's data, and delivers this data across the security context. First, you'll create your token class. diff --git a/cookbook/security/form_login.rst b/cookbook/security/form_login.rst index 6e6b14133f5..79ce5f808d1 100644 --- a/cookbook/security/form_login.rst +++ b/cookbook/security/form_login.rst @@ -5,7 +5,7 @@ How to Customize your Form Login ================================ Using a :ref:`form login ` for authentication is -a common, and flexible, method for handling authentication in Symfony2. Pretty +a common, and flexible, method for handling authentication in Symfony. Pretty much every aspect of the form login can be customized. The full, default configuration is shown in the next section. diff --git a/cookbook/security/securing_services.rst b/cookbook/security/securing_services.rst index b13a8fbc99b..641a43f04ec 100644 --- a/cookbook/security/securing_services.rst +++ b/cookbook/security/securing_services.rst @@ -146,7 +146,7 @@ Securing Methods Using Annotations You can also secure method calls in any service with annotations by using the optional `JMSSecurityExtraBundle`_ bundle. This bundle is not included in the -Symfony2 Standard Distribution, but you can choose to install it. +Symfony Standard Distribution, but you can choose to install it. To enable the annotations functionality, :ref:`tag ` the service you want to secure with the ``security.secure_service`` tag diff --git a/cookbook/security/voters.rst b/cookbook/security/voters.rst index e27f922a700..6d39cee8ec3 100644 --- a/cookbook/security/voters.rst +++ b/cookbook/security/voters.rst @@ -4,10 +4,10 @@ How to Implement your own Voter to Blacklist IP Addresses ========================================================= -The Symfony2 Security component provides several layers to authorize users. +The Symfony Security component provides several layers to authorize users. One of the layers is called a "voter". A voter is a dedicated class that checks if the user has the rights to connect to the application or access a specific -resource/URL. For instance, Symfony2 provides a layer that checks if the user +resource/URL. For instance, Symfony provides a layer that checks if the user is fully authorized or if it has some expected roles. It is sometimes useful to create a custom voter to handle a specific case not diff --git a/cookbook/security/voters_data_permission.rst b/cookbook/security/voters_data_permission.rst index 8992eb43ceb..071f3733176 100644 --- a/cookbook/security/voters_data_permission.rst +++ b/cookbook/security/voters_data_permission.rst @@ -4,7 +4,7 @@ How to Use Voters to Check User Permissions =========================================== -In Symfony2 you can check the permission to access data by using the +In Symfony, you can check the permission to access data by using the :doc:`ACL module `, which is a bit overwhelming for many applications. A much easier solution is to work with custom voters, which are like simple conditional statements. @@ -135,7 +135,7 @@ edit a particular object. Here's an example implementation:: } break; } - + return VoterInterface::ACCESS_DENIED; } } diff --git a/cookbook/templating/PHP.rst b/cookbook/templating/PHP.rst index b589ff15c5a..b3b142d1016 100644 --- a/cookbook/templating/PHP.rst +++ b/cookbook/templating/PHP.rst @@ -4,9 +4,9 @@ How to Use PHP instead of Twig for Templates ============================================ -Symfony2 defaults to Twig for its template engine, but you can still use +Symfony defaults to Twig for its template engine, but you can still use plain PHP code if you want. Both templating engines are supported equally in -Symfony2. Symfony2 adds some nice features on top of PHP to make writing +Symfony. Symfony adds some nice features on top of PHP to make writing templates with PHP more powerful. Rendering PHP Templates @@ -85,7 +85,7 @@ Decorating Templates -------------------- More often than not, templates in a project share common elements, like the -well-known header and footer. In Symfony2, this problem is thought about +well-known header and footer. In Symfony, this problem is thought about differently: a template can be decorated by another one. The ``index.html.php`` template is decorated by ``layout.html.php``, thanks to @@ -114,7 +114,7 @@ Now, have a look at the ``layout.html.php`` file: output('_content') ?> -The layout is itself decorated by another one (``::base.html.php``). Symfony2 +The layout is itself decorated by another one (``::base.html.php``). Symfony supports multiple decoration levels: a layout can itself be decorated by another one. When the bundle part of the template name is empty, views are looked for in the ``app/Resources/views/`` directory. This directory stores @@ -138,7 +138,7 @@ For both layouts, the ``$view['slots']->output('_content')`` expression is replaced by the content of the child template, ``index.html.php`` and ``layout.html.php`` respectively (more on slots in the next section). -As you can see, Symfony2 provides methods on a mysterious ``$view`` object. In +As you can see, Symfony provides methods on a mysterious ``$view`` object. In a template, the ``$view`` variable is always available and refers to a special object that provides a bunch of methods that makes the template engine tick. @@ -266,9 +266,9 @@ you more about those. Using Template Helpers ---------------------- -The Symfony2 templating system can be easily extended via helpers. Helpers are +The Symfony templating system can be easily extended via helpers. Helpers are PHP objects that provide features useful in a template context. ``actions`` and -``slots`` are two of the built-in Symfony2 helpers. +``slots`` are two of the built-in Symfony helpers. Creating Links between Pages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -300,7 +300,7 @@ Using Assets: Images, JavaScripts and Stylesheets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ What would the Internet be without images, JavaScripts, and stylesheets? -Symfony2 provides the ``assets`` tag to deal with them easily: +Symfony provides the ``assets`` tag to deal with them easily: .. code-block:: html+php diff --git a/cookbook/templating/namespaced_paths.rst b/cookbook/templating/namespaced_paths.rst index 5835206c77d..e4ce2331f71 100644 --- a/cookbook/templating/namespaced_paths.rst +++ b/cookbook/templating/namespaced_paths.rst @@ -27,7 +27,7 @@ With namespaced paths, the following works as well: {% extends "@AcmeDemo/layout.html.twig" %} {% include "@AcmeDemo/Foo/bar.html.twig" %} -Both paths are valid and functional by default in Symfony2. +Both paths are valid and functional by default in Symfony. .. tip:: diff --git a/cookbook/testing/profiling.rst b/cookbook/testing/profiling.rst index 3b6ece0d159..deb242498f2 100644 --- a/cookbook/testing/profiling.rst +++ b/cookbook/testing/profiling.rst @@ -9,7 +9,7 @@ you write functional tests that monitor your production servers, you might want to write tests on the profiling data as it gives you a great way to check various things and enforce some metrics. -The Symfony2 :ref:`Profiler ` gathers a lot of data for +The Symfony :ref:`Profiler ` gathers a lot of data for each request. Use this data to check the number of database calls, the time spent in the framework, etc. But before writing assertions, enable the profiler and check that the profiler is indeed available (it is enabled by default in diff --git a/cookbook/validation/custom_constraint.rst b/cookbook/validation/custom_constraint.rst index 1aa828b76a0..5cfd2312759 100644 --- a/cookbook/validation/custom_constraint.rst +++ b/cookbook/validation/custom_constraint.rst @@ -49,7 +49,7 @@ includes some simple default logic:: } In other words, if you create a custom ``Constraint`` (e.g. ``MyConstraint``), -Symfony2 will automatically look for another class, ``MyConstraintValidator`` +Symfony will automatically look for another class, ``MyConstraintValidator`` when actually performing the validation. The validator class is also simple, and only has one required method ``validate()``:: @@ -85,7 +85,7 @@ The validator class is also simple, and only has one required method ``validate( Using the new Validator ----------------------- -Using custom validators is very easy, just as the ones provided by Symfony2 itself: +Using custom validators is very easy, just as the ones provided by Symfony itself: .. configuration-block:: @@ -194,11 +194,11 @@ validator:: return 'alias_name'; } -As mentioned above, Symfony2 will automatically look for a class named after +As mentioned above, Symfony will automatically look for a class named after the constraint, with ``Validator`` appended. If your constraint validator is defined as a service, it's important that you override the ``validatedBy()`` method to return the alias used when defining your service, -otherwise Symfony2 won't use the constraint validator service, and will +otherwise Symfony won't use the constraint validator service, and will instantiate the class instead, without any dependencies injected. Class Constraint Validator diff --git a/cookbook/web_services/php_soap_extension.rst b/cookbook/web_services/php_soap_extension.rst index 507906303d9..f01516f61c2 100644 --- a/cookbook/web_services/php_soap_extension.rst +++ b/cookbook/web_services/php_soap_extension.rst @@ -1,8 +1,10 @@ .. index:: single: Web Services; SOAP -How to Create a SOAP Web Service in a Symfony2 Controller -========================================================= +.. _how-to-create-a-soap-web-service-in-a-symfony2-controller: + +How to Create a SOAP Web Service in a Symfony Controller +======================================================== Setting up a controller to act as a SOAP server is simple with a couple tools. You must, of course, have the `PHP SOAP`_ extension installed. diff --git a/cookbook/workflow/new_project_git.rst b/cookbook/workflow/new_project_git.rst index 580b3807cc7..c40cba6d53f 100644 --- a/cookbook/workflow/new_project_git.rst +++ b/cookbook/workflow/new_project_git.rst @@ -1,8 +1,10 @@ .. index:: single: Workflow; Git -How to Create and Store a Symfony2 Project in Git -================================================= +.. _how-to-create-and-store-a-symfony2-project-in-git: + +How to Create and Store a Symfony Project in Git +================================================ .. tip:: @@ -11,7 +13,7 @@ How to Create and Store a Symfony2 Project in Git Once you've read through :doc:`/book/page_creation` and become familiar with using Symfony, you'll no-doubt be ready to start your own project. In this -cookbook article, you'll learn the best way to start a new Symfony2 project +cookbook article, you'll learn the best way to start a new Symfony project that's stored using the `Git`_ source control management system. Initial Project Setup @@ -20,7 +22,7 @@ Initial Project Setup To get started, you'll need to download Symfony and initialize your local git repository: -#. Download the `Symfony2 Standard Edition`_ using Composer: +#. Download the `Symfony Standard Edition`_ using Composer: .. code-block:: bash @@ -65,7 +67,7 @@ git repository: $ git commit -m "Initial commit" -At this point, you have a fully-functional Symfony2 project that's correctly +At this point, you have a fully-functional Symfony project that's correctly committed to Git. You can immediately begin development, committing the new changes to your Git repository. @@ -74,7 +76,7 @@ to learn more about how to configure and develop inside your application. .. tip:: - The Symfony2 Standard Edition comes with some example functionality. To + The Symfony Standard Edition comes with some example functionality. To remove the sample code, follow the instructions in the ":doc:`/cookbook/bundles/remove`" article. @@ -95,7 +97,7 @@ which libraries depend on which other libraries. Storing your Project on a remote Server --------------------------------------- -You now have a fully-functional Symfony2 project stored in Git. However, +You now have a fully-functional Symfony project stored in Git. However, in most cases, you'll also want to store your project on a remote server both for backup purposes, and so that other developers can collaborate on the project. @@ -110,7 +112,7 @@ a `barebones repository`_ and then pushing to it. One library that helps manage this is `Gitolite`_. .. _`Git`: http://git-scm.com/ -.. _`Symfony2 Standard Edition`: http://symfony.com/download +.. _`Symfony Standard Edition`: http://symfony.com/download .. _`Installing Symfony using Composer`: http://symfony.com/doc/current/book/installation.html#option-1-composer .. _`git submodules`: http://git-scm.com/book/en/Git-Tools-Submodules .. _`GitHub`: https://github.com/ diff --git a/cookbook/workflow/new_project_svn.rst b/cookbook/workflow/new_project_svn.rst index 2e08d4e7cfa..c8140d1f09a 100644 --- a/cookbook/workflow/new_project_svn.rst +++ b/cookbook/workflow/new_project_svn.rst @@ -1,8 +1,10 @@ .. index:: single: Workflow; Subversion -How to Create and Store a Symfony2 Project in Subversion -======================================================== +.. _how-to-create-and-store-a-symfony2-project-in-subversion: + +How to Create and Store a Symfony Project in Subversion +======================================================= .. tip:: @@ -11,14 +13,14 @@ How to Create and Store a Symfony2 Project in Subversion Once you've read through :doc:`/book/page_creation` and become familiar with using Symfony, you'll no-doubt be ready to start your own project. The -preferred method to manage Symfony2 projects is using `Git`_ but some prefer +preferred method to manage Symfony projects is using `Git`_ but some prefer to use `Subversion`_ which is totally fine!. In this cookbook article, you'll learn how to manage your project using `SVN`_ in a similar manner you would do with `Git`_. .. tip:: - This is **a** method to tracking your Symfony2 project in a Subversion + This is **a** method to tracking your Symfony project in a Subversion repository. There are several ways to do and this one is simply one that works. @@ -44,9 +46,9 @@ widespread standard structure: Initial Project Setup --------------------- -To get started, you'll need to download Symfony2 and get the basic Subversion setup: +To get started, you'll need to download Symfony and get the basic Subversion setup: -1. Download the `Symfony2 Standard Edition`_ with or without vendors. +1. Download the `Symfony Standard Edition`_ with or without vendors. 2. Unzip/untar the distribution. It will create a folder called Symfony with your new project structure, config files, etc. Rename it to whatever you @@ -59,7 +61,7 @@ To get started, you'll need to download Symfony2 and get the basic Subversion se $ svn checkout http://myproject.googlecode.com/svn/trunk myproject -4. Copy the Symfony2 project files in the Subversion folder: +4. Copy the Symfony project files in the Subversion folder: .. code-block:: bash @@ -108,7 +110,7 @@ To get started, you'll need to download Symfony2 and get the basic Subversion se If you rely on any "dev" versions, then Git may be used to install those libraries, since there is no archive available for download. -At this point, you have a fully-functional Symfony2 project stored in your +At this point, you have a fully-functional Symfony project stored in your Subversion repository. The development can start with commits in the Subversion repository. @@ -117,7 +119,7 @@ to learn more about how to configure and develop inside your application. .. tip:: - The Symfony2 Standard Edition comes with some example functionality. To + The Symfony Standard Edition comes with some example functionality. To remove the sample code, follow the instructions in the ":doc:`/cookbook/bundles/remove`" article. @@ -142,7 +144,7 @@ central repository to work. You then have several solutions: .. _`Git`: http://git-scm.com/ .. _`SVN`: http://subversion.apache.org/ .. _`Subversion`: http://subversion.apache.org/ -.. _`Symfony2 Standard Edition`: http://symfony.com/download +.. _`Symfony Standard Edition`: http://symfony.com/download .. _`Version Control with Subversion`: http://svnbook.red-bean.com/ .. _`GitHub`: https://github.com/ .. _`Google code`: http://code.google.com/hosting/ diff --git a/glossary.rst b/glossary.rst index 21755d21e91..07f3eeb44a4 100644 --- a/glossary.rst +++ b/glossary.rst @@ -7,12 +7,12 @@ Glossary :sorted: Distribution - A *Distribution* is a package made of the Symfony2 Components, a + A *Distribution* is a package made of the Symfony Components, a selection of bundles, a sensible directory structure, a default configuration, and an optional configuration system. Dependency Injection - The Dependency Injection is a design pattern highly used in the Symfony2 Framework. + The Dependency Injection is a design pattern highly used in the Symfony Framework. It encourages loosely coupled and more maintainable architecture of an application. The main principle of this pattern is that it allows developers to *inject* objects (also known as services) in other objects, generally passing them as parameters. @@ -33,7 +33,7 @@ Glossary Bundle A *Bundle* is a directory containing a set of files (PHP files, stylesheets, JavaScripts, images, ...) that *implement* a single - feature (a blog, a forum, etc). In Symfony2, (*almost*) everything + feature (a blog, a forum, etc). In Symfony, (*almost*) everything lives inside a bundle. (see :ref:`page-creation-bundles`) Front Controller @@ -52,7 +52,7 @@ Glossary Service A *Service* is a generic term for any PHP object that performs a specific task. A service is usually used "globally", such as a database - connection object or an object that delivers email messages. In Symfony2, + connection object or an object that delivers email messages. In Symfony, services are often configured and retrieved from the service container. An application that has many decoupled services is said to follow a `service-oriented architecture`_. @@ -83,10 +83,10 @@ Glossary that's optimized for speed. Vendor - A *vendor* is a supplier of PHP libraries and bundles including Symfony2 + A *vendor* is a supplier of PHP libraries and bundles including Symfony itself. Despite the usual commercial connotations of the word, vendors in Symfony often (even usually) include free software. Any library you - add to your Symfony2 project should go in the ``vendor`` directory. See + add to your Symfony project should go in the ``vendor`` directory. See :ref:`The Architecture: Using Vendors `. Acme @@ -107,13 +107,13 @@ Glossary to the web directory using the ``assets:install`` console task. Kernel - The *Kernel* is the core of Symfony2. The Kernel object handles HTTP + The *Kernel* is the core of Symfony. The Kernel object handles HTTP requests using all the bundles and libraries registered to it. See :ref:`The Architecture: The Application Directory ` and the :doc:`/book/internals` chapter. Firewall - In Symfony2, a *Firewall* doesn't have to do with networking. Instead, + In Symfony, a *Firewall* doesn't have to do with networking. Instead, it defines the authentication mechanisms (i.e. it handles the process of determining the identity of your users), either for the whole application or for just a part of it. See the @@ -122,7 +122,7 @@ Glossary YAML *YAML* is a recursive acronym for "YAML Ain't a Markup Language". It's a lightweight, humane data serialization language used extensively in - Symfony2's configuration files. See the :doc:`/components/yaml/introduction` + Symfony's configuration files. See the :doc:`/components/yaml/introduction` chapter. diff --git a/images/contributing/docs-pull-request-change-base.png b/images/contributing/docs-pull-request-change-base.png new file mode 100644 index 00000000000..d824e8ef1bc Binary files /dev/null and b/images/contributing/docs-pull-request-change-base.png differ diff --git a/images/contributing/release-process.jpg b/images/contributing/release-process.jpg new file mode 100644 index 00000000000..28c58b3fdad Binary files /dev/null and b/images/contributing/release-process.jpg differ diff --git a/index.rst b/index.rst index ed63453278f..23959281381 100644 --- a/index.rst +++ b/index.rst @@ -1,5 +1,7 @@ -Symfony2 Documentation -====================== +.. _symfony2-documentation: + +Symfony Documentation +===================== .. toctree:: :hidden: @@ -9,7 +11,7 @@ Symfony2 Documentation Quick Tour ---------- -Get started fast with the Symfony2 :doc:`Quick Tour `: +Get started fast with the Symfony :doc:`Quick Tour `: .. toctree:: :hidden: @@ -24,7 +26,7 @@ Get started fast with the Symfony2 :doc:`Quick Tour `: Book ---- -Dive into Symfony2 with the topical guides: +Dive into Symfony with the topical guides: .. toctree:: :hidden: @@ -81,7 +83,7 @@ CMF --- The Symfony CMF project makes it easier for developers to add CMS functionality -to applications built with the Symfony2 PHP framework. +to applications built with the Symfony PHP framework. .. toctree:: :hidden: @@ -91,7 +93,7 @@ to applications built with the Symfony2 PHP framework. Contributing ------------ -Contribute to Symfony2: +Contribute to Symfony: .. toctree:: :hidden: diff --git a/quick_tour/the_architecture.rst b/quick_tour/the_architecture.rst index eca018061b5..927f4512e60 100644 --- a/quick_tour/the_architecture.rst +++ b/quick_tour/the_architecture.rst @@ -4,13 +4,13 @@ The Architecture You are my hero! Who would have thought that you would still be here after the first three parts? Your efforts will be well rewarded soon. The first three parts didn't look too deeply at the architecture of the framework. Because it -makes Symfony2 stand apart from the framework crowd, let's dive into the +makes Symfony stand apart from the framework crowd, let's dive into the architecture now. Understanding the Directory Structure ------------------------------------- -The directory structure of a Symfony2 :term:`application` is rather flexible, +The directory structure of a Symfony :term:`application` is rather flexible, but the recommended structure is as follows: * ``app/``: the application configuration; @@ -66,14 +66,14 @@ Understanding the Bundle System ------------------------------- This section introduces one of the greatest and most powerful features of -Symfony2, the :term:`bundle` system. +Symfony, the :term:`bundle` system. A bundle is kind of like a plugin in other software. So why is it called a *bundle* and not a *plugin*? This is because *everything* is a bundle in -Symfony2, from the core framework features to the code you write for your +Symfony, from the core framework features to the code you write for your application. -Bundles are first-class citizens in Symfony2. This gives you the flexibility +Bundles are first-class citizens in Symfony. This gives you the flexibility to use pre-built features packaged in third-party bundles or to distribute your own bundles. It makes it easy to pick and choose which features to enable in your application and optimize them the way you want. And at the end of the day, @@ -233,7 +233,7 @@ Logical File Names .................. When you want to reference a file from a bundle, use this notation: -``@BUNDLE_NAME/path/to/file``; Symfony2 will resolve ``@BUNDLE_NAME`` +``@BUNDLE_NAME/path/to/file``; Symfony will resolve ``@BUNDLE_NAME`` to the real path to the bundle. For instance, the logical path ``@AcmeDemoBundle/Controller/DemoController.php`` would be converted to ``src/Acme/DemoBundle/Controller/DemoController.php``, because Symfony knows @@ -267,7 +267,7 @@ first look for the ``WelcomeController`` class in AcmeNewBundle and, if it doesn't exist, then look inside AcmeDemoBundle. This means that one bundle can override almost any part of another bundle! -Do you understand now why Symfony2 is so flexible? Share your bundles between +Do you understand now why Symfony is so flexible? Share your bundles between applications, store them locally or globally, your choice. .. _using-vendors: @@ -277,18 +277,18 @@ Using Vendors Odds are that your application will depend on third-party libraries. Those should be stored in the ``vendor/`` directory. This directory already contains -the Symfony2 libraries, the SwiftMailer library, the Doctrine ORM, the Twig +the Symfony libraries, the SwiftMailer library, the Doctrine ORM, the Twig templating system, and some other third party libraries and bundles. Understanding the Cache and Logs -------------------------------- -Symfony2 is probably one of the fastest full-stack frameworks around. But how +Symfony is probably one of the fastest full-stack frameworks around. But how can it be so fast if it parses and interprets tens of YAML and XML files for each request? The speed is partly due to its cache system. The application configuration is only parsed for the very first request and then compiled down to plain PHP code stored in the ``app/cache/`` directory. In the development -environment, Symfony2 is smart enough to flush the cache when you change a +environment, Symfony is smart enough to flush the cache when you change a file. But in the production environment, to speed things up, it is your responsibility to clear the cache when you update your code or change its configuration. @@ -320,12 +320,12 @@ Final Thoughts -------------- Call me crazy, but after reading this part, you should be comfortable with -moving things around and making Symfony2 work for you. Everything in Symfony2 +moving things around and making Symfony work for you. Everything in Symfony is designed to get out of your way. So, feel free to rename and move directories around as you see fit. And that's all for the quick tour. From testing to sending emails, you still -need to learn a lot to become a Symfony2 master. Ready to dig into these +need to learn a lot to become a Symfony master. Ready to dig into these topics now? Look no further - go to the official :doc:`/book/index` and pick any topic you want. diff --git a/quick_tour/the_big_picture.rst b/quick_tour/the_big_picture.rst index a79bc9d2e08..190a03a1813 100644 --- a/quick_tour/the_big_picture.rst +++ b/quick_tour/the_big_picture.rst @@ -1,19 +1,21 @@ The Big Picture =============== -Start using Symfony2 in 10 minutes! This chapter will walk you through some of -the most important concepts behind Symfony2 and explain how you can get started +Start using Symfony in 10 minutes! This chapter will walk you through some of +the most important concepts behind Symfony and explain how you can get started quickly by showing you a simple project in action. If you've used a web framework before, you should feel right at home with -Symfony2. If not, welcome to a whole new way of developing web applications. +Symfony. If not, welcome to a whole new way of developing web applications. -Installing Symfony2 -------------------- +.. _installing-symfony2: -First, check that the PHP version installed on your computer meets the Symfony2 +Installing Symfony +------------------ + +First, check that the PHP version installed on your computer meets the Symfony requirements: 5.3.3 or higher. Then, open a console and execute the following -command to install the latest version of Symfony2 in the ``myproject/`` +command to install the latest version of Symfony in the ``myproject/`` directory: .. code-block:: bash @@ -23,7 +25,7 @@ directory: .. note:: `Composer`_ is the package manager used by modern PHP applications and the - only recommended way to install Symfony2. To install Composer on your + only recommended way to install Symfony. To install Composer on your Linux or Mac system, execute the following commands: .. code-block:: bash @@ -33,16 +35,18 @@ directory: To install Composer on a Windows system, download the `executable installer`_. -Beware that the first time you install Symfony2, it may take a few minutes to +Beware that the first time you install Symfony, it may take a few minutes to download all its components. At the end of the installation process, the -installer will ask you to provide some configuration options for the Symfony2 +installer will ask you to provide some configuration options for the Symfony project. For this first project you can safely ignore this configuration by pressing the ```` key repeatedly. -Running Symfony2 ----------------- +.. _running-symfony2: + +Running Symfony +--------------- -Before running Symfony2 for the first time, execute the following command to +Before running Symfony for the first time, execute the following command to make sure that your system meets all the technical requirements: .. code-block:: bash @@ -68,11 +72,11 @@ if you prefer a traditional web server such as Apache or Nginx, read the :doc:`/cookbook/configuration/web_server_configuration` article. Open your browser and access the ``http://localhost:8000`` URL to see the -Welcome page of Symfony2: +Welcome page of Symfony: .. image:: /images/quick_tour/welcome.png :align: center - :alt: Symfony2 Welcome Page + :alt: Symfony Welcome Page Understanding the Fundamentals ------------------------------ @@ -83,7 +87,7 @@ calls, HTML tags and business logic in the same script. To achieve this goal with Symfony, you'll first need to learn a few fundamental concepts and terms. Symfony comes with some sample code that you can use to learn more about its -main concepts. Go to the following URL to be greeted by Symfony2 (replace +main concepts. Go to the following URL to be greeted by Symfony (replace *Fabien* with your first name): .. code-block:: text @@ -116,7 +120,7 @@ Your responsibility as a developer is to write the code that maps the user's Routing ~~~~~~~ -Symfony2 routes the request to the code that handles it by matching the +Symfony routes the request to the code that handles it by matching the requested URL (i.e. the virtual path) against some configured paths. The demo paths are defined in the ``app/config/routing_dev.yml`` configuration file: @@ -154,7 +158,7 @@ will be executed. In the next section, you'll learn exactly what that means. In addition to YAML files, routes can be configured in XML or PHP files and can even be embedded in PHP annotations. This flexibility is one of the - main features of Symfony2, a framework that never imposes a particular + main features of Symfony, a framework that never imposes a particular configuration format on you. Controllers @@ -173,7 +177,7 @@ controller might create the response by hand, based on the request:: return new Response('Hello '.$name); -Symfony2 chooses the controller based on the ``_controller`` value from the +Symfony chooses the controller based on the ``_controller`` value from the routing configuration: ``AcmeDemoBundle:Welcome:index``. This string is the controller *logical name*, and it references the ``indexAction`` method from the ``Acme\DemoBundle\Controller\WelcomeController`` class:: @@ -288,17 +292,17 @@ template (or ``AcmeDemoBundle:Demo:hello.html.twig`` if you use the logical name

Hello {{ name }}!

{% endblock %} -By default, Symfony2 uses `Twig`_ as its template engine but you can also use +By default, Symfony uses `Twig`_ as its template engine but you can also use traditional PHP templates if you choose. The :doc:`second part of this tutorial
` will introduce how -templates work in Symfony2. +templates work in Symfony. Bundles ~~~~~~~ You might have wondered why the :term:`Bundle` word is used in many names you have seen so far. All the code you write for your application is organized in -bundles. In Symfony2 speak, a bundle is a structured set of files (PHP files, +bundles. In Symfony speak, a bundle is a structured set of files (PHP files, stylesheets, JavaScripts, images, ...) that implements a single feature (a blog, a forum, ...) and which can be easily shared with other developers. As of now, you have manipulated one bundle, AcmeDemoBundle. You will learn @@ -309,10 +313,10 @@ more about bundles in the :doc:`last part of this tutorial
`". .. _Composer: https://getcomposer.org/ diff --git a/quick_tour/the_controller.rst b/quick_tour/the_controller.rst index 9b1947d29db..decb50b98a7 100644 --- a/quick_tour/the_controller.rst +++ b/quick_tour/the_controller.rst @@ -1,7 +1,7 @@ The Controller ============== -Still here after the first two parts? You are already becoming a Symfony2 +Still here after the first two parts? You are already becoming a Symfony addict! Without further ado, discover what controllers can do for you. Using Formats @@ -10,7 +10,7 @@ Using Formats Nowadays, a web application should be able to deliver more than just HTML pages. From XML for RSS feeds or Web Services, to JSON for Ajax requests, there are plenty of different formats to choose from. Supporting those formats -in Symfony2 is straightforward. Tweak the route by adding a default value of +in Symfony is straightforward. Tweak the route by adding a default value of ``xml`` for the ``_format`` variable:: // src/Acme/DemoBundle/Controller/DemoController.php @@ -29,7 +29,7 @@ in Symfony2 is straightforward. Tweak the route by adding a default value of } By using the request format (as defined by the special ``_format`` variable), -Symfony2 automatically selects the right template, here ``hello.xml.twig``: +Symfony automatically selects the right template, here ``hello.xml.twig``: .. code-block:: xml+php @@ -38,7 +38,7 @@ Symfony2 automatically selects the right template, here ``hello.xml.twig``: {{ name }} -That's all there is to it. For standard formats, Symfony2 will also +That's all there is to it. For standard formats, Symfony will also automatically choose the best ``Content-Type`` header for the response. If you want to support different formats for a single action, use the ``{_format}`` placeholder in the route path instead:: @@ -136,9 +136,9 @@ In a template, you can also access the ``Request`` object via the Persisting Data in the Session ------------------------------ -Even if the HTTP protocol is stateless, Symfony2 provides a nice session object +Even if the HTTP protocol is stateless, Symfony provides a nice session object that represents the client (be it a real person using a browser, a bot, or a -web service). Between two requests, Symfony2 stores the attributes in a cookie +web service). Between two requests, Symfony stores the attributes in a cookie by using native PHP sessions. Storing and retrieving information from the session can be easily achieved @@ -176,7 +176,7 @@ Caching Resources ----------------- As soon as your website starts to generate more traffic, you will want to -avoid generating the same resource again and again. Symfony2 uses HTTP cache +avoid generating the same resource again and again. Symfony uses HTTP cache headers to manage resources cache. For simple caching strategies, use the convenient ``@Cache()`` annotation:: @@ -195,7 +195,7 @@ convenient ``@Cache()`` annotation:: } In this example, the resource will be cached for a day (``86400`` seconds). -Resource caching is managed by Symfony2 itself. But because caching is managed +Resource caching is managed by Symfony itself. But because caching is managed using standard HTTP cache headers, you can use Varnish or Squid without having to modify a single line of code in your application. @@ -205,5 +205,5 @@ Final Thoughts That's all there is to it, and I'm not even sure you'll have spent the full 10 minutes. You were briefly introduced to bundles in the first part, and all the features you've learned about so far are part of the core framework bundle. -But thanks to bundles, everything in Symfony2 can be extended or replaced. +But thanks to bundles, everything in Symfony can be extended or replaced. That's the topic of the :doc:`next part of this tutorial`. diff --git a/quick_tour/the_view.rst b/quick_tour/the_view.rst index 1dc675538ec..c641eb6db10 100644 --- a/quick_tour/the_view.rst +++ b/quick_tour/the_view.rst @@ -1,7 +1,7 @@ The View ======== -After reading the first part of this tutorial, you have decided that Symfony2 +After reading the first part of this tutorial, you have decided that Symfony was worth another 10 minutes. In this second part, you will learn more about `Twig`_, the fast, flexible, and secure template engine for PHP. Twig makes your templates more readable and concise; it also makes them more friendly for web @@ -248,7 +248,7 @@ Including Assets: Images, JavaScripts and Stylesheets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ What would the Internet be without images, JavaScripts, and stylesheets? -Symfony2 provides the ``asset`` function to deal with them easily: +Symfony provides the ``asset`` function to deal with them easily: .. code-block:: jinja @@ -269,14 +269,14 @@ inclusions, it is very easy to organize your templates in a logical and extensible way. However, if you're not comfortable with Twig, you can always use PHP templates inside Symfony without any issues. -You have only been working with Symfony2 for about 20 minutes, but you can -already do pretty amazing stuff with it. That's the power of Symfony2. Learning +You have only been working with Symfony for about 20 minutes, but you can +already do pretty amazing stuff with it. That's the power of Symfony. Learning the basics is easy, and you will soon learn that this simplicity is hidden under a very flexible architecture. But I'm getting ahead of myself. First, you need to learn more about the controller and that's exactly the topic of the :doc:`next part of this tutorial `. -Ready for another 10 minutes with Symfony2? +Ready for another 10 minutes with Symfony? .. _Twig: http://twig.sensiolabs.org/ .. _Twig documentation: http://twig.sensiolabs.org/documentation diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 0c34d6cd7ab..6f8fbf73562 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -23,7 +23,7 @@ Full default configuration commented: true # If enabled all tables not prefixed with sf2_ will be ignored by the schema # tool. This is for custom tables which should not be altered automatically. - #schema_filter: ^sf2_ + #schema_filter: ^sf2_ connections: default: @@ -401,7 +401,7 @@ If you want to configure multiple connections in YAML, put them under the default_connection: default connections: default: - dbname: Symfony2 + dbname: Symfony user: root password: null host: localhost diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 2c5a3138bff..00120a616f8 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -346,7 +346,7 @@ assets_base_urls This option allows you to define base URLs to be used for assets referenced from ``http`` and ``ssl`` (``https``) pages. A string value may be provided in -lieu of a single-element array. If multiple base URLs are provided, Symfony2 +lieu of a single-element array. If multiple base URLs are provided, Symfony will select one from the collection each time it generates an asset's path. For your convenience, ``assets_base_urls`` can be set directly with a string or diff --git a/reference/configuration/security.rst b/reference/configuration/security.rst index cbaaf60ce49..029649b0ae6 100644 --- a/reference/configuration/security.rst +++ b/reference/configuration/security.rst @@ -4,7 +4,7 @@ SecurityBundle Configuration ("security") ========================================= -The security system is one of the most powerful parts of Symfony2, and can +The security system is one of the most powerful parts of Symfony, and can largely be controlled via its configuration. Full default Configuration diff --git a/reference/constraints.rst b/reference/constraints.rst index 0b209bbf012..7f11b66c930 100644 --- a/reference/constraints.rst +++ b/reference/constraints.rst @@ -60,12 +60,12 @@ Validation Constraints Reference The Validator is designed to validate objects against *constraints*. In real life, a constraint could be: "The cake must not be burned". In -Symfony2, constraints are similar: They are assertions that a condition is +Symfony, constraints are similar: They are assertions that a condition is true. Supported Constraints --------------------- -The following constraints are natively available in Symfony2: +The following constraints are natively available in Symfony: .. include:: /reference/constraints/map.rst.inc diff --git a/reference/constraints/Collection.rst b/reference/constraints/Collection.rst index 6f028e358e2..2c93325da2f 100644 --- a/reference/constraints/Collection.rst +++ b/reference/constraints/Collection.rst @@ -144,7 +144,7 @@ blank but is no longer than 100 characters in length, you would do the following $metadata->addPropertyConstraint('profileData', new Assert\Collection(array( 'fields' => array( 'personal_email' => new Assert\Email(), - 'lastName' => array( + 'short_bio' => array( new Assert\NotBlank(), new Assert\Length(array( 'max' => 100, diff --git a/reference/constraints/Regex.rst b/reference/constraints/Regex.rst index 489f01675b9..fbd12230830 100644 --- a/reference/constraints/Regex.rst +++ b/reference/constraints/Regex.rst @@ -32,7 +32,7 @@ characters at the beginning of your string: Acme\BlogBundle\Entity\Author: properties: description: - - Regex: "/^\w+/" + - Regex: '/^\w+/' .. code-block:: php-annotations @@ -98,7 +98,7 @@ message: properties: firstName: - Regex: - pattern: "/\d/" + pattern: '/\d/' match: false message: Your name cannot contain a number diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index 682c5590529..d1c9978892a 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -9,7 +9,7 @@ you can flag it with the ``kernel.event_listener`` tag. You can learn a little bit more about "tags" by reading the ":ref:`book-service-container-tags`" section of the Service Container chapter. -Below is information about all of the tags available inside Symfony2. There +Below is information about all of the tags available inside Symfony. There may also be tags in other bundles you use that aren't listed here. +-----------------------------------+---------------------------------------------------------------------------+ @@ -1127,7 +1127,7 @@ translation.extractor **Purpose**: To register a custom service that extracts messages from a file When executing the ``translation:update`` command, it uses extractors to -extract translation messages from a file. By default, the Symfony2 framework +extract translation messages from a file. By default, the Symfony framework has a :class:`Symfony\\Bridge\\Twig\\Translation\\TwigExtractor` and a :class:`Symfony\\Bundle\\FrameworkBundle\\Translation\\PhpExtractor`, which help to find and extract translation keys from Twig templates and PHP files. @@ -1208,7 +1208,7 @@ After an `Extractor `_ has extracted all messages from the templates, the dumpers are executed to dump the messages to a translation file in a specific format. -Symfony2 already comes with many dumpers: +Symfony already comes with many dumpers: * :class:`Symfony\\Component\\Translation\\Dumper\\CsvFileDumper` * :class:`Symfony\\Component\\Translation\\Dumper\\IcuResFileDumper` diff --git a/reference/forms/types.rst b/reference/forms/types.rst index 82b22bde79c..413c5bc2bc4 100644 --- a/reference/forms/types.rst +++ b/reference/forms/types.rst @@ -48,12 +48,12 @@ Form Types Reference types/form A form is composed of *fields*, each of which are built with the help of -a field *type* (e.g. a ``text`` type, ``choice`` type, etc). Symfony2 comes +a field *type* (e.g. a ``text`` type, ``choice`` type, etc). Symfony comes standard with a large list of field types that can be used in your application. Supported Field Types --------------------- -The following field types are natively available in Symfony2: +The following field types are natively available in Symfony: .. include:: /reference/forms/types/map.rst.inc diff --git a/reference/map.rst.inc b/reference/map.rst.inc index 2fdd8210ced..1b3ed361694 100644 --- a/reference/map.rst.inc +++ b/reference/map.rst.inc @@ -3,7 +3,7 @@ Ever wondered what configuration options you have available to you in files such as ``app/config/config.yml``? In this section, all the available configuration is broken down by the key (e.g. ``framework``) that defines each possible - section of your Symfony2 configuration. + section of your Symfony configuration. * :doc:`framework ` * :doc:`doctrine ` diff --git a/reference/requirements.rst b/reference/requirements.rst index 712a00e8f63..5edc791f788 100644 --- a/reference/requirements.rst +++ b/reference/requirements.rst @@ -1,10 +1,12 @@ .. index:: single: Requirements -Requirements for Running Symfony2 -================================= +.. _requirements-for-running-symfony2: -To run Symfony2, your system needs to adhere to a list of requirements. You can +Requirements for Running Symfony +================================ + +To run Symfony, your system needs to adhere to a list of requirements. You can easily see if your system passes all requirements by running the ``web/config.php`` in your Symfony distribution. Since the CLI often uses a different ``php.ini`` configuration file, it's also a good idea to check your requirements from @@ -26,7 +28,7 @@ Required .. caution:: - Be aware that Symfony2 has some known limitations when using a PHP version + Be aware that Symfony has some known limitations when using a PHP version less than 5.3.8 or equal to 5.3.16. For more information see the `Requirements section of the README`_. diff --git a/reference/twig_reference.rst b/reference/twig_reference.rst index 61c51fdf612..f70d7f5c6fc 100644 --- a/reference/twig_reference.rst +++ b/reference/twig_reference.rst @@ -1,16 +1,18 @@ .. index:: - single: Symfony2 Twig extensions + single: Symfony Twig extensions -Symfony2 Twig Extensions -======================== +.. _symfony2-twig-extensions: -Twig is the default template engine for Symfony2. By itself, it already contains +Symfony Twig Extensions +======================= + +Twig is the default template engine for Symfony. By itself, it already contains a lot of built-in functions, filters, tags and tests (`http://twig.sensiolabs.org/documentation`_ then scroll to the bottom). -Symfony2 adds more custom extension on top of Twig to integrate some components +Symfony adds more custom extension on top of Twig to integrate some components into the Twig templates. Below is information about all the custom functions, -filters, tags and tests that are added when using the Symfony2 Core Framework. +filters, tags and tests that are added when using the Symfony Core Framework. There may also be tags in bundles you use that aren't listed here. @@ -186,7 +188,7 @@ Global Variables Symfony Standard Edition Extensions ----------------------------------- -The Symfony Standard Edition adds some bundles to the Symfony2 Core Framework. +The Symfony Standard Edition adds some bundles to the Symfony Core Framework. Those bundles can have other Twig extensions: * **Twig Extensions** includes some interesting extensions that do not belong to the