10000 Merge branch '2.8' into 3.2 · symfony/symfony-docs@fdf537b · GitHub
[go: up one dir, main page]

Skip to content

Commit fdf537b

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: Simplified the requirements article [#6030] Simplifying and showing code Clearify behaviour of Blank and NotBlank validator [#5838] Tweaking comment - the phpdoc policy is not concrete Update standards to match actual practices Updated the Requirements article for Symfony 2.8
2 parents baaf7ec + 9151a3e commit fdf537b

File tree

4 files changed

+40
-47
lines changed

4 files changed

+40
-47
lines changed

contributing/code/standards.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ Service Naming Conventions
226226
Documentation
227227
-------------
228228

229-
* Add PHPDoc blocks for all classes, methods, and functions;
229+
* Add PHPDoc blocks for all classes, methods, and functions (though you may
230+
be asked to remove PHPDoc that do not add value);
230231

231232
* Group annotations together so that annotations of the same type immediately
232233
follow each other, and annotations of a different type are separated by a

reference/constraints/Blank.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
Blank
22
=====
33

4-
Validates that a value is blank, defined as equal to a blank string or equal
5-
to ``null``. To force that a value strictly be equal to ``null``, see the
6-
:doc:`/reference/constraints/IsNull` constraint. To force that a value is
7-
*not* blank, see :doc:`/reference/constraints/NotBlank`.
4+
Validates that a value is blank - meaning equal to an empty string or ``null``::
5+
6+
if ('' !== $value && null !== $value) {
7+
// validation will fail
8+
}
9+
10+
To force that a value strictly be equal to ``null``, see the
11+
:doc:`/reference/constraints/IsNull` constraint.
12+
13+
14+
To force that a value is *not* blank, see :doc:`/reference/constraints/NotBlank`.
15+
But be careful as ``NotBlank`` is *not* strictly the opposite of ``Blank``.
816

917
+----------------+---------------------------------------------------------------------+
1018
| Applies to | :ref:`property or method <validation-property-target>` |

reference/constraints/NotBlank.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
NotBlank
22
========
33

4-
Validates that a value is not blank, defined as not strictly ``false``,
5-
not equal to a blank string and also not equal to ``null``. To force that
6-
a value is simply not equal to ``null``, see the
4+
Validates that a value is not blank - meaning not equal to a blank string,
5+
a blank array or ``null``::
6+
7+
if (false === $value || (empty($value) && '0' != $value)) {
8+
// validation will fail
9+
}
10+
11+
To force that a value is simply not equal to ``null``, see the
712
:doc:`/reference/constraints/NotNull` constraint.
813

914
+----------------+------------------------------------------------------------------------+

reference/requirements.rst

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,29 @@
66
Requirements for Running Symfony
77
================================
88

9-
To run Symfony, your system needs to adhere to a list of requirements. You
10-
can easily see if your system passes all requirements by running the
11-
``web/config.php`` in your Symfony distribution. Since the CLI often uses
12-
a different ``php.ini`` configuration file, it's also a good idea to check
13-
your requirements from the command line via:
9+
Symfony 2.8 requires **PHP 5.3.9** or higher to run, in addition to other minor
10+
requirements. To make things simple, Symfony provides a tool to quickly check if
11+
your system meets all those requirements.
1412

15-
.. code-block:: terminal
16-
17-
$ php bin/symfony_requirements
18-
19-
Below is the list of required and optional requirements.
13+
Beware that PHP can define a different configuration for the command console and
14+
the web server, so you need to check requirements in both environments.
2015

21-
Required
22-
--------
16+
Checking Requirements for the Web Server
17+
----------------------------------------
2318

24-
* PHP needs to be a minimum version of PHP 5.5.9
25-
* `JSON extension`_ needs to be enabled
26-
* `ctype extension`_ needs to be enabled
27-
* Your ``php.ini`` needs to have the ``date.timezone`` setting
19+
Symfony includes a ``config.php`` file in the ``web/`` directory of your project.
20+
Open that file with your browser to check the requirements.
2821

29-
Optional
30-
--------
22+
Once you've fixed all the reported issues, delete the ``web/config.php`` file
23+
to avoid leaking internal information about your application to visitors.
3124

32-
* You need to have the PHP-XML module installed
33-
* You need to have at least version 2.6.21 of libxml
34-
* PHP tokenizer needs to be enabled
35-
* mbstring functions need to be enabled
36-
* iconv needs to be enabled
37-
* POSIX needs to be enabled (only on \*nix)
38-
* Intl needs to be installed with ICU 4+
39-
* APC 3.0.17+ (or another opcode cache needs to be installed)
40-
* ``php.ini`` recommended settings
25+
Checking Requirements for the Command Console
26+
---------------------------------------------
4127

42-
* ``short_open_tag = Off``
43-
* ``magic_quotes_gpc = Off``
44-
* ``register_globals = Off``
45-
* ``session.auto_start = Off``
28+
Open your console or terminal, enter in your project directory, execute this
29+
command and fix the reported issues:
4630

47-
Doctrine
48-
--------
49-
50-
If you want to use Doctrine, you will need to have PDO installed. Additionally,
51-
you need to have the PDO driver installed for the database server you want
52-
to use.
31+
.. code-block:: terminal
5332
54-
.. _`JSON extension`: https://php.net/manual/book.json.php
55-
.. _`ctype extension`: https://php.net/manual/book.ctype.php
33+
$ cd my-project/
34+
$ php app/check.php

0 commit comments

Comments
 (0)
0