Skip to content

Symfony -> Symfony2 #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contributing/code/bugs.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Reporting a Bug
===============

Whenever you find a bug in Symfony, we kindly ask you to report it. It helps
us make a better Symfony.
Whenever you find a bug in Symfony2, we kindly ask you to report it. It helps
us make a better Symfony2.

.. caution::
If you think you've found a security issue, please use the special
Expand Down
2 changes: 1 addition & 1 deletion contributing/code/patches.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Submitting a Patch
==================

Patches are the best way to provide a bug fix or to propose enhancements to
Symfony.
Symfony2.

Initial Setup
-------------
Expand Down
2 changes: 1 addition & 1 deletion contributing/code/security.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Reporting a Security Issue
==========================

Found a security issue in Symfony? Don't use the mailing-list or the bug
Found a security issue in Symfony2? Don't use the mailing-list or the bug
tracker. All security issues must be sent to **security [at]
symfony-project.com** instead. Emails sent to this address are forwarded to
the Symfony core-team private mailing-list.
Expand Down
4 changes: 2 additions & 2 deletions contributing/code/standards.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Coding Standards
================

When contributing code to Symfony, you must follow its coding standards. To
When contributing code to Symfony2, you must follow its coding standards. To
make a long story short, here is the golden rule: *Imitate the existing
Symfony code*.
Symfony2 code*.

Structure
---------
Expand Down
2 changes: 1 addition & 1 deletion guides/bundles/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ When creating an extension, follow these simple conventions:
* The extension should provide an XSD schema.

If you follow these simple conventions, your extensions will be registered
automatically by Symfony. If not, override the Bundle
automatically by Symfony2. If not, override the Bundle
:method:`Symfony\\Component\\HttpKernel\\Bundle\\Bundle::registerExtensions` method::

class HelloBundle extends Bundle
Expand Down
12 changes: 6 additions & 6 deletions guides/event/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ time. But when you have a long list of dependencies, using setter injection
can be the way to go, especially for optional dependencies.

.. tip::
If you use dependency injection like we did in the two examples above, you can
then easily use the Symfony Dependency Injection Component to elegantly manage
these objects.
If you use dependency injection like we did in the two examples above, you
can then easily use the Symfony2 Dependency Injection component to elegantly
manage these objects.

Doing something before or after a Method Call
---------------------------------------------
Expand Down Expand Up @@ -142,9 +142,9 @@ Eventually, add the new ``bar`` method to the ``Foo`` class::
Modifying Arguments
-------------------

If you want to allow third party classes to modify arguments passed to a
method just before that method is executed, add a ``filter`` event at the
beginning of the method::
If you want to allow third party classes to modify arguments passed to a method
just before that method is executed, add a ``filter`` event at the beginning of
the method::

class Foo
{
Expand Down
2 changes: 1 addition & 1 deletion guides/tools/YAML.rst
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ Comments can be added in YAML by prefixing them with a hash mark (``#``):
Dynamic YAML files
~~~~~~~~~~~~~~~~~~

In Symfony, a YAML file can contain PHP code that is evaluated just before the
In Symfony2, a YAML file can contain PHP code that is evaluated just before the
parsing occurs:

.. code-block:: yaml
Expand Down
4 changes: 2 additions & 2 deletions guides/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ unique identifier:
<target>J'aime Symfony2</target>
</trans-unit>
<trans-unit id="2">
<source>symfony.great</source>
<source>symfony2.great</source>
<target>J'aime Symfony2</target>
</trans-unit>
</body>
Expand All @@ -125,7 +125,7 @@ unique identifier:

return array(
'Symfony2 is great' => 'J\'aime Symfony2',
'symfony.great' => 'J\'aime Symfony2',
'symfony2.great' => 'J\'aime Symfony2',
);

.. note::
Expand Down
36 changes: 18 additions & 18 deletions quick_tour/the_architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Symfony2 stand apart from the framework crowd, let's dive into it now.
The Directory Structure
-----------------------

The directory structure of a Symfony :term:`application` is rather flexible
The directory structure of a Symfony2 :term:`application` is rather flexible
but the directory structure of a sandbox reflects the typical and recommended
structure of a Symfony application:
structure of a Symfony2 application:

* ``app/``: This directory contains the application configuration;

Expand Down Expand Up @@ -105,7 +105,7 @@ stored in the ``src/`` directory::
));
$loader->register();

The ``UniversalClassLoader`` from Symfony is used to autoload files that
The ``UniversalClassLoader`` from Symfony2 is used to autoload files that
respect either the technical interoperability `standards`_ for PHP 5.3
namespaces or the PEAR naming `convention`_ for classes. As you can see
here, all dependencies are stored under the ``vendor/`` directory, but this is
Expand All @@ -119,12 +119,12 @@ The Bundle System
-----------------

This section starts to scratch the surface of one of the greatest and more
powerful features of Symfony, its :term:`bundle` system.
powerful features of Symfony2, its :term:`bundle` system.

A bundle is kind of like a plugin in other software. But why is it called
bundle and not plugin then? Because everything is a bundle in Symfony, from
bundle and not plugin then? Because everything is a bundle in Symfony2, from
the core framework features to the code you write for your application.
Bundles are first-class citizens in Symfony. This gives you the flexibility to
Bundles are first-class citizens in Symfony2. This gives you the flexibility to
use pre-built features packaged in third-party bundles or to distribute your
own bundles. It makes it so easy to pick and choose which features to enable
in your application and optimize them the way you want.
Expand Down Expand Up @@ -363,8 +363,8 @@ specific configuration file:
));

As we have seen in the previous part, an application is made of bundles as
defined in the ``registerBundles()`` method but how does Symfony know where to
look for bundles? Symfony is quite flexible in this regard. The
defined in the ``registerBundles()`` method but how does Symfony2 know where to
look for bundles? Symfony2 is quite flexible in this regard. The
``registerBundleDirs()`` method must return an associative array that maps
namespaces to any valid directory (local or global ones)::

Expand All @@ -378,9 +378,9 @@ namespaces to any valid directory (local or global ones)::
}

So, when you reference the ``HelloBundle`` in a controller name or in a template
name, Symfony will look for it under the given directories.
name, Symfony2 will look for it under the given directories.

Do you understand now why Symfony is so flexible? Share your bundles between
Do you understand now why Symfony2 is so flexible? Share your bundles between
applications, store them locally or globally, your choice.

.. index::
Expand All @@ -390,7 +390,7 @@ Vendors
-------

Odds are your application will depend on third-party libraries. Those should
be stored in the ``src/vendor/`` directory. It already contains the Symfony
be stored in the ``src/vendor/`` directory. It already contains the Symfony2
libraries, the SwiftMailer library, the Doctrine ORM, the Propel ORM, the Twig
templating system, and a selection of the Zend Framework classes.

Expand All @@ -401,12 +401,12 @@ templating system, and a selection of the Zend Framework classes.
Cache and Logs
--------------

Symfony is probably one of the fastest full-stack frameworks around. But how
Symfony2 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? This 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 ``cache/`` application directory. In the
development environment, Symfony is smart enough to flush the cache when you
development environment, Symfony2 is smart enough to flush the cache when you
change a file. But in the production one, it is your responsibility to clear
the cache when you update your code or change its configuration.

Expand Down Expand Up @@ -441,14 +441,14 @@ Final Thoughts
--------------

Call me crazy, but after reading this part, you should be comfortable with
moving things around and making Symfony work for you. Everything is done in
Symfony to stand out of your way. So, feel free to rename and move directories
moving things around and making Symfony2 works for you. Everything is done in
Symfony2 to stand 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 of lot to become a Symfony master. Ready to dig into these
topics now? Look no further, go to the official `guides`_ page and pick any
topic you want.
need to learn a lot to become a Symfony2 master. Ready to dig into these topics
now? Look no further, go to the official `guides`_ page and pick any topic you
want.

.. _standards: http://groups.google.com/group/php-standards/web/psr-0-final-proposal
.. _convention: http://pear.php.net/
Expand Down
42 changes: 21 additions & 21 deletions quick_tour/the_big_picture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Download and Install
First, check that you have at least PHP 5.3.2 installed and correctly
configured to work with a web server like Apache.

Ready? Let's start by downloading Symfony. To get started even faster, we are
going to use the "Symfony sandbox". It is a Symfony project where all the
Ready? Let's start by downloading Symfony2. To get started even faster, we are
going to use the "Symfony2 sandbox". It is a Symfony2 project where all the
required libraries and some simple controllers are already included; the basic
configuration is also already done. The great advantage of the sandbox over
other types of installation is that you can start experimenting with Symfony
other types of installation is that you can start experimenting with Symfony2
immediately.

Download the `sandbox`_, and unpack it in your root web directory. You
Expand Down Expand Up @@ -50,24 +50,24 @@ Check the Configuration
-----------------------

To avoid some headaches further down the line, check that your configuration
can run a Symfony project smoothly by requesting the following URL:
can run a Symfony2 project smoothly by requesting the following URL:

http://localhost/sandbox/web/check.php

Read the script output carefully and fix any problem that it finds.

Now, request your first "real" Symfony webpage:
Now, request your first "real" Symfony2 webpage:

http://localhost/sandbox/web/index_dev.php/

Symfony should congratulate you for your hard work so far!
Symfony2 should congratulate you for your hard work so far!

Your first Application
----------------------

The sandbox comes with a simple Hello World ":term:`application`" and that's
the application we will use to learn more about Symfony. Go to the following
URL to be greeted by Symfony (replace Fabien with your first name):
the application we will use to learn more about Symfony2. Go to the following
URL to be greeted by Symfony2 (replace Fabien with your first name):

http://localhost/sandbox/web/index_dev.php/hello/Fabien

Expand All @@ -91,7 +91,7 @@ Fabien!``).
Configuration
~~~~~~~~~~~~~

But how does Symfony route the request to your code? Simply by reading some
But how does Symfony2 route the request to your code? Simply by reading some
configuration file.

All Symfony2 configuration files can be written in either PHP, XML, or `YAML`_
Expand All @@ -111,7 +111,7 @@ very easy).
Routing
~~~~~~~

So, Symfony routes the request by reading the routing configuration file:
So, Symfony2 routes the request by reading the routing configuration file:

.. configuration-block::

Expand Down Expand Up @@ -228,7 +228,7 @@ The controller is responsible for returning a representation of the resource

The code is pretty straightforward but let's explain this code line by line:

* *line 3*: Symfony takes advantage of new PHP 5.3 features and as such, all
* *line 3*: Symfony2 takes advantage of new PHP 5.3 features and as such, all
controllers are properly namespaced (the namespace is the first part of the
``_controller`` routing value: ``HelloBundle``).

Expand All @@ -246,8 +246,8 @@ The code is pretty straightforward but let's explain this code line by line:
(``HelloBundle:Hello:index``) with the variables passed as a second
argument.

But what is a :term:`bundle`? All the code you write in a Symfony project is
organized in bundles. In Symfony speak, a bundle is a structured set of files
But what is a :term:`bundle`? All the code you write in a Symfony2 project is
organized in bundles. In Symfony2 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. In our example, we only have one bundle, ``HelloBundle``.
Expand All @@ -267,8 +267,8 @@ is made of HTML and simple PHP expressions:

Hello <?php echo $name ?>!

Congratulations! You have looked at your first Symfony piece of code. That was
not so hard, was it? Symfony makes it really easy to implement web sites
Congratulations! You have looked at your first Symfony2 piece of code. That was
not so hard, was it? Symfony2 makes it really easy to implement web sites
better and faster.

.. index::
Expand All @@ -278,13 +278,13 @@ better and faster.
Environments
------------

Now that you have a better understanding on how Symfony works, have a closer
look at the bottom of the page; you will notice a small bar with the Symfony
Now that you have a better understanding on how Symfony2 works, have a closer
look at the bottom of the page; you will notice a small bar with the Symfony2
and PHP logos. It is called the "Web Debug Toolbar" and it is the developer's
best friend. Of course, such a tool must not be displayed when you deploy your
application to your production servers. That's why you will find another front
controller in the ``web/`` directory (``index.php``), optimized for the production
environment:
controller in the ``web/`` directory (``index.php``), optimized for the
production environment:

http://localhost/sandbox/web/index.php/hello/Fabien

Expand All @@ -299,7 +299,7 @@ better looking URL:

http://localhost/hello/Fabien

To make the production environment as fast as possible, Symfony maintains a
To make the production environment as fast as possible, Symfony2 maintains a
cache under the ``app/cache/`` directory. When you make changes, you need to
manually remove the cached files. That's why you should always use the
development front controller (``index_dev.php``) when working on a project.
Expand All @@ -310,7 +310,7 @@ Final Thoughts
The 10 minutes are over. By now, you should be able to create your own simple
routes, controllers, and templates. As an exercise, try to build something
more useful than the Hello application! But if you are eager to learn more
about Symfony, you can read the next part of this tutorial right away, where
about Symfony2, you can read the next part of this tutorial right away, where
we dive more into the templating system.

.. _sandbox: http://symfony-reloaded.org/code#sandbox
Expand Down
18 changes: 9 additions & 9 deletions quick_tour/the_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ 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 Symfony is straightforward. Edit ``routing.yml`` and add a ``_format`` with a
value of ``xml``:
in Symfony2 is straightforward. Edit ``routing.yml`` and add a ``_format`` with
a value of ``xml``:

.. configuration-block::

Expand Down Expand Up @@ -58,8 +58,8 @@ Then, add an ``index.xml.php`` template along side ``index.php``:
</hello>

That's all there is to it. No need to change the controller. 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
formats, Symfony2 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 pattern instead:

.. configuration-block::
Expand Down Expand Up @@ -178,9 +178,9 @@ If you want to redirect the user to another page, use the ``redirect()`` method:

$this->redirect($this->generateUrl('hello', array('name' => 'Lucas')));

The ``generateUrl()`` is the same method as the ``generate()`` method we used on
the ``router`` helper before. It takes the route name and an array of parameters
as arguments and returns the associated friendly URL.
The ``generateUrl()`` is the same method as the ``generate()`` method we used
on the ``router`` helper before. It takes the route name and an array of
parameters as arguments and returns the associated friendly URL.

You can also easily forward the action to another one with the ``forward()``
method. As for the ``actions`` helper, it makes an internal sub-request, but it
Expand Down Expand Up @@ -220,9 +220,9 @@ helper:
The Session
-----------

Even if the HTTP protocol is stateless, Symfony provides a nice session object
Even if the HTTP protocol is stateless, Symfony2 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, Symfony stores the attributes in a cookie
web service). Between two requests, Symfony2 stores the attributes in a cookie
by using the native PHP sessions.

Storing and retrieving information from the session can be easily achieved
Expand Down
Loading