8000 Merge branch '2.7' into 2.8 · symfony/symfony-docs@086b5ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 086b5ba

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: 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
2 parents 7ae141e + a965d4c commit 086b5ba

File tree

4 files changed

+40
-54
lines changed

4 files changed

+40
-54
lines changed

contributing/code/standards.rst

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

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

230231
* Group annotations together so that annotations of the same type immediately
231232
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 & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,57 +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.7 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 app/check.php
18-
19-
Below is the list of required and optional requirements.
20-
21-
Required
22-
--------
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.
2315

24-
* PHP needs to be a minimum version of PHP 5.3.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
16+
Checking Requirements for the Web Server
17+
----------------------------------------
2818

29-
.. caution::
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.
3021

31-
Be aware that PHP 5.3.16 is not suitable to run Symfony,
32-
because of a `major bug in the Reflection subsystem`_.
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.
3324

34-
Optional
35-
--------
25+
Checking Requirements for the Command Console
26+
---------------------------------------------
3627

37-
* You need to have the PHP-XML module installed
38-
* You need to have at least version 2.6.21 of libxml
39-
* PHP tokenizer needs to be enabled
40-
* mbstring functions need to be enabled
41-
* iconv needs to be enabled
42-
* POSIX needs to be enabled (only on \*nix)
43-
* Intl needs to be installed with ICU 4+
44-
* APC 3.0.17+ (or another opcode cache needs to be installed)
45-
* ``php.ini`` recommended settings
28+
Open your console or terminal, enter in your project directory, execute this
29+
command and fix the reported issues:
4630

47-
* ``short_open_tag = Off``
48 9544 -
* ``magic_quotes_gpc = Off``
49-
* ``register_globals = Off``
50-
* ``session.auto_start = Off``
51-
52-
Doctrine
53-
--------
54-
55-
If you want to use Doctrine, you will need to have PDO installed. Additionally,
56-
you need to have the PDO driver installed for the database server you want
57-
to use.
31+
.. code-block:: terminal
5832
59-
.. _`Requirements section of the README`: https://github.com/symfony/symfony/blob/2.8/README.md#requirements
60-
.. _`JSON extension`: https://php.net/manual/book.json.php
61-
.. _`ctype extension`: https://php.net/manual/book.ctype.php
62-
.. _`major bug in the Reflection subsystem`: https://bugs.php.net/bug.php?id=62715
33+
$ cd my-project/
34+
$ php app/check.php

0 commit comments

Comments
 (0)
0