Skip to content

Commit 525078f

Browse files
committed
Merge branch '4.2' into 4.3
* 4.2: Updated the setup articles to always use the Symfony local web server
2 parents c25442c + 7bacf00 commit 525078f

File tree

8 files changed

+61
-75
lines changed

8 files changed

+61
-75
lines changed

_build/redirection_map

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,3 +427,4 @@
427427
/contributing/community/other /contributing/community
428428
/profiler/storage /profiler
429429
/setup/composer /setup
430+
/security/security_checker /setup

contributing/code/security.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ Security Advisories
169169
.. tip::
170170

171171
You can check your Symfony application for known security vulnerabilities
172-
using the ``security:check`` command (see :doc:`/security/security_checker`).
172+
using the ``security:check`` command provided by the
173+
:ref:`Symfony security checker <security-checker>`.
173174

174175
Check the `Security Advisories`_ blog category for a list of all security
175176
vulnerabilities that were fixed in Symfony releases, starting from Symfony

quick_tour/the_big_picture.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ Symfony application:
4141
4242
Can we already load the project in a browser? Yes! You can setup
4343
:doc:`Nginx or Apache </setup/web_server_configuration>` and configure their
44-
document root to be the ``public/`` directory. But, for development, Symfony has
45-
its own server. Install and run it with:
44+
document root to be the ``public/`` directory. But, for development, it's better
45+
to :doc:`install the Symfony local web server </setup/symfony_server>` and run
46+
it as follows:
4647

4748
.. code-block:: terminal
4849
49-
$ composer require --dev server
50-
$ php bin/console server:start
50+
$ symfony server:start
5151
5252
Try your new app by going to ``http://localhost:8000`` in a browser!
5353

security.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -928,11 +928,6 @@ For example, in a controller extending from the :ref:`base controller <the-base-
928928
:doc:`security voter </security/voters>` that looks for the user roles
929929
in the database.
930930

931-
Checking for Security Vulnerabilities in your Dependencies
932-
----------------------------------------------------------
933-
934-
See :doc:`/security/security_checker`.
935-
936931
Frequently Asked Questions
937932
--------------------------
938933

@@ -1005,7 +1000,6 @@ Authorization (Denying Access)
10051000
security/access_denied_handler
10061001
security/acl
10071002
security/force_https
1008-
security/security_checker
10091003

10101004
.. _`frameworkextrabundle documentation`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html
10111005
.. _`HWIOAuthBundle`: https://github.com/hwi/HWIOAuthBundle

security/security_checker.rst

Lines changed: 0 additions & 29 deletions
This file was deleted.

setup.rst

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,57 @@ Installing & Setting up the Symfony Framework
1010
Do you prefer video tutorials? Check out the `Stellar Development with Symfony`_
1111
screencast series.
1212

13-
To create your new Symfony application, first make sure you're using PHP 7.1 or
14-
higher and have `Composer`_ installed. If you don't, start by `installing Composer`_.
13+
Installing Symfony
14+
------------------
1515

16-
Create your new project by running:
16+
Before creating your first Symfony application, make sure to meet the following
17+
requirements:
18+
19+
* Your server has PHP 7.1 or higher installed (and :doc:`these PHP extensions </reference/requirements>`
20+
which are installed and enabled by default by PHP);
21+
* You have `installed Composer`_, which is used to install PHP packages;
22+
* You have installed the :doc:`Symfony local web server </setup/symfony_server>`,
23+
which provides all the tools you need to develop your application locally.
24+
25+
Once these requirements are installed, open your terminal and run any of these
26+
commands to create the Symfony application:
1727

1828
.. code-block:: terminal
1929
20-
$ composer create-project symfony/website-skeleton my-project
30+
# run this if you are building a traditional web application
31+
$ symfony new --full my_project
2132
22-
This will create a new ``my-project`` directory, download some dependencies into
23-
it and even generate the basic directories and files you'll need to get started.
24-
In other words, your new app is ready!
33+
# run this if you are building a microservice, console application or API
34+
$ symfony new my-project
2535
26-
.. tip::
36+
The only difference between these two commands is the number of packages
37+
installed. The ``--full`` option installs all the packages that you usually
38+
need to build web apps. Therefore, the installation size will be much bigger.
2739

28-
The ``website-skeleton`` is optimized for traditional web applications. If
29-
you are building microservices, console applications or APIs, consider
30-
using the much simpler ``skeleton`` project:
40+
Both commands will create a new ``my-project/`` directory, download some
41+
dependencies into it and even generate the basic directories and files you'll
42+
need to get started. In other words, your new app is ready!
3143

32-
.. code-block:: terminal
44+
.. seealso::
3345

34-
$ composer create-project symfony/skeleton my-project
46+
If you can't use the ``symfony`` command provided by the Symfony local web
47+
server, use the alternative installation commands based on Composer and
48+
displayed on the `Symfony download page`_.
3549

3650
Running your Symfony Application
3751
--------------------------------
3852

3953
On production, you should use a web server like Nginx or Apache (see
4054
:doc:`configuring a web server to run Symfony </setup/web_server_configuration>`).
4155
But for development, it's more convenient to use the
42-
:doc:`Symfony Local Web Server </setup/symfony_server>`.
56+
:doc:`Symfony Local Web Server </setup/symfony_server>` installed earlier.
4357

4458
This local server provides support for HTTP/2, TLS/SSL, automatic generation of
4559
security certificates and many other features. It works with any PHP application,
4660
not only Symfony projects, so it's a very useful development tool.
4761

48-
`Download the Symfony local web server`_, install it, move into your new project
49-
directory and start the local web server as follows:
62+
Open your terminal, move into your new project directory and start the local web
63+
server as follows:
5064

5165
.. code-block:: terminal
5266
@@ -113,13 +127,6 @@ command which displays information about the app:
113127
114128
$ php bin/console about
115129
116-
Checking for Security Vulnerabilities
117-
-------------------------------------
118-
119-
Symfony provides a utility called the "Security Checker" to check whether your
120-
project's dependencies contain any known security vulnerability. Check out
121-
the integration instructions for `the Security Checker`_ to set it up.
122-
123130
The Symfony Demo application
124131
----------------------------
125132

@@ -153,8 +160,9 @@ Go Deeper with Setup
153160

154161
.. _`Stellar Development with Symfony`: http://symfonycasts.com/screencast/symfony
155162
.. _`Composer`: https://getcomposer.org/
156-
.. _`installing Composer`: https://getcomposer.org/download/
163+
.. _`installed Composer`: https://getcomposer.org/download/
157164
.. _`Download the Symfony local web server`: https://symfony.com/download
165+
.. _`Symfony download page`: https://symfony.com/download
158166
.. _`the Security Checker`: https://github.com/sensiolabs/security-checker#integration
159167
.. _`The Symfony Demo application`: https://github.com/symfony/demo
160168
.. _`symfony/symfony-demo`: https://github.com/symfony/demo

setup/built_in_web_server.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
How to Use PHP's built-in Web Server
55
====================================
66

7+
.. caution::
8+
9+
This article explains how to use the web server based on the WebServerBundle.
10+
This is no longer recommended in new Symfony applications. Instead, use the
11+
:doc:`Symfony Local Web Server </setup/symfony_server>`.
12+
713
The PHP CLI SAPI comes with a `built-in web server`_. It can be used to run your
814
PHP applications locally during development, for testing or for application
915
demonstrations. This way, you don't have to bother configuring a full-featured
1016
web server such as :doc:`Apache or Nginx </setup/web_server_configuration>`.
1117

12-
.. tip::
13-
14-
The preferred way to develop your Symfony application is to use
15-
:doc:`Symfony Local Web Server </setup/symfony_server>`.
16-
1718
.. caution::
1819

1920
The built-in web server is meant to be run in a controlled environment.

setup/symfony_server.rst

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,20 +321,29 @@ Bonus Features
321321
In addition to being a local web server, the Symfony server provides other
322322
useful features:
323323

324+
.. _security-checker:
325+
324326
Looking for Security Vulnerabilities
325327
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
326328

327-
Instead of installing the :doc:`Symfony Security Checker </security/security_checker>`
328-
as a dependency of your projects, you can run the following command:
329+
Run the following command to check whether your project's dependencies contain
330+
any known security vulnerability:
329331

330332
.. code-block:: terminal
331333
332334
$ symfony security:check
333335
334-
This command uses the same vulnerability database as the Symfony Security
335-
Checker but it does not make HTTP calls to the official API endpoint. Everything
336-
(except cloning the public database) is done locally, which is the best for CI
337-
(*continuous integration*) scenarios.
336+
A good security practice is to execute this command regularly to be able to
337+
update or replace compromised dependencies as soon as possible. The security
338+
check is done locally by cloning the public `PHP security advisories database`_,
339+
so your ``composer.lock`` file is not sent on the network.
340+
341+
.. tip::
342+
343+
The ``security:check`` command terminates with a non-zero exit code if
344+
any of your dependencies is affected by a known security vulnerability.
345+
This way you can add it to your project build process and your continuous
346+
integration workflows to make them fail when there are vulnerabilities.
338347

339348
Creating Symfony Projects
340349
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -370,3 +379,4 @@ that Composer will also set the stability to ``dev`` for all root dependencies):
370379
.. _`Docker`: https://en.wikipedia.org/wiki/Docker_(software)
371380
.. _`SymfonyCloud`: https://symfony.com/cloud/
372381
.. _`Read SymfonyCloud technical docs`: https://symfony.com/doc/master/cloud/intro.html
382+
.. _`PHP security advisories database`: https://github.com/FriendsOfPHP/security-advisories

0 commit comments

Comments
 (0)