Skip to content

Commit 0b442c7

Browse files
committed
[quick_tour] simplified drastically the first two sections of "The Big Picture" chapter
1 parent bdc6c3f commit 0b442c7

File tree

3 files changed

+57
-119
lines changed

3 files changed

+57
-119
lines changed
404 KB
Loading
99.3 KB
Loading

quick_tour/the_big_picture.rst

Lines changed: 57 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,94 @@
11
The Big Picture
22
===============
33

4-
Start using Symfony2 in 10 minutes! This chapter will walk you through some
5-
of the most important concepts behind Symfony2 and explain how you can get
6-
started quickly by showing you a simple project in action.
4+
This chapter will teach you how to develop a simple Symfony2 project in 10
5+
minutes! If you've used a web framework before, you should feel right at home
6+
with Symfony2. If not, welcome to a whole new way of developing web applications.
77

8-
If you've used a web framework before, you should feel right at home with
9-
Symfony2. If not, welcome to a whole new way of developing web applications!
8+
Installing Symfony2
9+
-------------------
1010

11-
.. tip::
12-
13-
Want to learn why and when you need to use a framework? Read the "`Symfony
14-
in 5 minutes`_" document.
15-
16-
Downloading Symfony2
17-
--------------------
18-
19-
First, check that you have installed and configured a Web server (such as
20-
Apache) with PHP 5.3.3 or higher.
21-
22-
.. tip::
23-
24-
If you have PHP 5.4, you could use the built-in web server to start trying
25-
things out. We'll tell you how to start the built-in web server
26-
:ref:`after downloading Symfony<quick-tour-big-picture-built-in-server>`.
27-
28-
Ready? Start by downloading the "`Symfony2 Standard Edition`_": a Symfony
29-
:term:`distribution` that is preconfigured for the most common use cases and
30-
also contains some code that demonstrates how to use Symfony2 (get the archive
31-
with the *vendors* included to get started even faster).
32-
33-
After unpacking the archive under your web server root directory (if you'll
34-
use the built-in PHP web server, you can unpack it anywhere), you should
35-
have a ``Symfony/`` directory that looks like this:
11+
First, check that the PHP version installed on your computer meets the Symfony2
12+
requirements: 5.3.3 or higher. Then, open a command console and execute the
13+
following command to install the latest version of Symfony2 in the ``myproject/``
14+
directory:
3615

37-
.. code-block:: text
16+
.. code-block:: bash
3817
39-
www/ <- your web root directory
40-
Symfony/ <- the unpacked archive
41-
app/
42-
cache/
43-
config/
44-
logs/
45-
Resources/
46-
bin/
47-
src/
48-
Acme/
49-
DemoBundle/
50-
Controller/
51-
Resources/
52-
...
53-
vendor/
54-
symfony/
55-
doctrine/
56-
...
57-
web/
58-
app.php
59-
...
18+
$ composer create-project symfony/framework-standard-edition myproject/ ~2.4
6019
6120
.. note::
6221

63-
If you are familiar with `Composer`_, you can download Composer and then
64-
run the following command instead of downloading the archive:
22+
`Composer <https://getcomposer.org/>` is the package manager used by modern
23+
PHP applications and the only recommended way to install Symfony2. To
24+
install Composer on your Linux or Mac system, execute the following commands:
6525

6626
.. code-block:: bash
6727
68-
$ php composer.phar create-project symfony/framework-standard-edition Symfony 2.4.*
69-
70-
.. _`quick-tour-big-picture-built-in-server`:
71-
72-
If you have PHP 5.4, you can use the built-in web server:
73-
74-
.. code-block:: bash
75-
76-
# check your PHP CLI configuration
77-
$ php app/check.php
78-
79-
# run the built-in web server
80-
$ php app/console server:run
81-
82-
Then the URL to your application will be "http://localhost:8000/app_dev.php"
83-
84-
The built-in server should be used only for development purpose, but it
85-
can help you to start your project quickly and easily.
28+
$ curl -sS https://getcomposer.org/installer | php
29+
$ sudo mv composer.phar /usr/local/bin/composer
8630
87-
If you're using a traditional web server like Apache, your URL depends on
88-
your configuration. If you've unzipped Symfony under your web root into a
89-
``Symfony`` directory, then the URL to your application will be:
90-
"http://localhost/Symfony/web/app_dev.php".
91-
92-
.. note::
31+
To install Composer on a Windows system, download the executable installer
32+
from `getcomposer.org/download <http://getcomposer.org/download>`.
9333

94-
Read more in our :doc:`/cookbook/configuration/web_server_configuration`
95-
section.
34+
Beware that the first time you install Symfony2, it may take a few minutes to
35+
download all its components. At the end of the installation process, the
36+
installer will ask you to provide some configuration options for the Symfony2
37+
project. For this first project you can safely ignore this configuration by
38+
pressing the ``<Enter>`` key repeatedly.
9639

97-
Checking the Configuration
98-
--------------------------
99-
100-
Symfony2 comes with a visual server configuration tester to help avoid some
101-
headaches that come from Web server or PHP misconfiguration. Use the following
102-
URL to see the diagnostics for your machine:
40+
.. The following GIF is only useful if the user can "click" on it
41+
.. to activate the animation. Otherwise, it shouldn't be included
42+
.. because it's too long and it doesn't make sense to see it half-started.
43+
.. image:: /images/quick_tour/installing_symfony2.gif
44+
:align: center
45+
:alt: Installing Symfony2 on the command console
10346

104-
.. code-block:: text
47+
Running Symfony2
48+
----------------
10549

106-
http://localhost/config.php
50+
Before running Symfony2 for the first time, execute the following command to
51+
make sure that your system meets all the technical requirements:
10752

108-
.. note::
53+
.. code-block:: bash
10954
110-
All of the example URLs assume you've setup your web server to point
111-
directly to the ``web/`` directory of your new project, which is different
112-
and a bit more advanced than the process shown above. So, the URL on your
113-
machine will vary - e.g. ``http://localhost:8000/config.php``
114-
or ``http://localhost/Symfony/web/config.php``. See the
115-
:ref:`above section<quick-tour-big-picture-built-in-server>` for details
116-
on what your URL should be and use it below in all of the examples.
55+
$ cd myproject/
56+
$ php app/check.php
11757
118-
If there are any outstanding issues listed, correct them. You might also tweak
119-
your configuration by following any given recommendations. When everything is
120-
fine, click on "*Bypass configuration and go to the Welcome page*" to request
121-
your first "real" Symfony2 webpage:
58+
Fix any error reported by the command and then, use the PHP built-in web server
59+
to run Symfony:
12260

123-
.. code-block:: text
61+
.. code-block:: bash
12462
125-
http://localhost/app_dev.php/
63+
$ php app/console server:run
12664
127-
Symfony2 should welcome and congratulate you for your hard work so far!
65+
Open your browser and access to the ``http://localhost:8000/`` URL to see the
66+
Welcome page of Symfony2:
12867

129-
.. image:: /images/quick_tour/welcome.png
68+
.. image:: /images/quick_tour/symfony2_welcome_page.png
13069
:align: center
70+
:alt: Symfony2 Welcome Page
71+
72+
The built-in web server is available for PHP 5.4.0 or higher. If you have an
73+
older version of PHP or if you prefer a traditional web server such as Apache
74+
or Nginx, read the :doc:`/cookbook/configuration/web_server_configuration`
75+
article.
13176

13277
Understanding the Fundamentals
13378
------------------------------
13479

135-
One of the main goals of a framework is to ensure `Separation of Concerns`_.
136-
This keeps your code organized and allows your application to evolve easily
137-
over time by avoiding the mixing of database calls, HTML tags, and business
138-
logic in the same script. To achieve this goal with Symfony, you'll first
139-
need to learn a few fundamental concepts and terms.
140-
141-
.. tip::
142-
143-
Want proof that using a framework is better than mixing everything
144-
in the same script? Read the ":doc:`/book/from_flat_php_to_symfony2`"
145-
chapter of the book.
80+
One of the main goals of a framework is to keep your code organized and allow
81+
your application to evolve easily over time by avoiding the mixing of database
82+
calls, HTML tags, and business logic in the same script. To achieve this goal
83+
with Symfony, you'll first need to learn a few fundamental concepts and terms.
14684

147-
The distribution comes with some sample code that you can use to learn more
148-
about the main Symfony2 concepts. Go to the following URL to be greeted by
149-
Symfony2 (replace *Fabien* with your first name):
85+
Symfony comes with some sample code that you can use to learn more about its
86+
main concepts. Go to the following URL to be greeted by Symfony2 (replace
87+
*Fabien* with your first name):
15088

15189
.. code-block:: text
15290
153-
http://localhost/app_dev.php/demo/hello/Fabien
91+
http://localhost:8000/app_dev.php/demo/hello/Fabien
15492
15593
.. image:: /images/quick_tour/hello_fabien.png
15694
:align: center

0 commit comments

Comments
 (0)